-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Integrate reported quality issues #1570
Integrate reported quality issues #1570
Conversation
… unload Reported by: @sebbASF Closes: java-native-access#1561
@dbwiddis could you please have a look at this? There are differences regarding the suggested approach by @sebbASF, but the core matches. Where I took a different route:
|
Good point; not sure how I missed that. I no longer think that handle needs to be volatile. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks sane to me. One suggestion (see also #1571)
@@ -245,7 +245,7 @@ public static Function getFunction(Pointer p, int callFlags, String encoding) { | |||
this.library = library; | |||
this.functionName = functionName; | |||
this.callFlags = callFlags; | |||
this.options = library.options; | |||
this.options = library.getOptions(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This map is still mutable; if someone modified the library map (e.g. getOptions.clear()
that would echo here.
Now that we are on JDK8 I'd suggest making this version of it an unmodifiable copy. (I'd suggest making the getter return unmodifiable but that's probably a breaking change.)
this.options = library.getOptions(); | |
this.options = Map.copyOf(library.getOptions()); |
Thanks for the review. I'll integrate as if for now, I think the discussion about potentially user facing changes needs some more time. |
Closes: #1560
Closes: #1561