Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JNASupport.structureFieldOrder is wrong #29

Open
almson opened this issue Dec 27, 2024 · 0 comments · May be fixed by #30
Open

JNASupport.structureFieldOrder is wrong #29

almson opened this issue Dec 27, 2024 · 0 comments · May be fixed by #30

Comments

@almson
Copy link

almson commented Dec 27, 2024

The javadoc for getDeclaredFields clearly states:

The elements in the returned array are not sorted and are not in any particular order.

That is the reason JNA requires the field order to be manually specified. Also see https://stackoverflow.com/questions/5001172/java-reflection-getting-fields-and-methods-in-declaration-order

Also, considering cutting out the crap with making every parameter final, every loop a Stream operation, every function an Optional chain, indent 2, etc. You've had your fun, now it's time to realize it's all counterproductive.

@almson almson linked a pull request Dec 27, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant