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

Closed
almson opened this issue Dec 27, 2024 · 1 comment · Fixed by #30
Closed

JNASupport.structureFieldOrder is wrong #29

almson opened this issue Dec 27, 2024 · 1 comment · 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.

@sheinbergon
Copy link
Owner

HI @almson. Thank you for contributing the fix.

Just out of curiousty :-D - Did something break for you before applying this fix?

As regards for my coding standards. I should have created a contribution guide, But it's all summed to loading the styling rules from the checkstyle.xml file to InteliJ or whatever platform you are using and it's all get sorted out. I've encountered this practice in almost any project I contributed to to. It's not about having fun.

As for stream processing. I like FP, what can I say. Maybe someday when this project gains a community (you are the first contributor, aside from me, that is) we can agree on better standards.

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.

2 participants