-
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
Add CFEqual, CFDictionaryRef.ByReference, CFStringRef.ByReference to CoreFoundation #1433
Conversation
macos-latest failure is unrelated, looks like com.sun.jna.platform.mac.XAttrUtilTest#testWriteAlignedCliTool is blinking |
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.
See comments inline.
I'm also thinking there's a potential to implement the ByReference
bits at the CFTypeRef
level, with a CFTypeRef
return type and an internal conditional return type based on the CFType: in this case, there's no exception, and the user can just cast the return to use it. See Advapi32Util.registryGetValue()
and Cfgmgr32Util.CM_Get_DevNode_Registry_Property()
for examples.
contrib/platform/src/com/sun/jna/platform/mac/CoreFoundation.java
Outdated
Show resolved
Hide resolved
contrib/platform/src/com/sun/jna/platform/mac/CoreFoundation.java
Outdated
Show resolved
Hide resolved
If we actually want to write type-safe code, IMHO casting types is no-go. It is, however, possible to write typed code if we remove the parameter-less constructor: https://gist.github.com/shalupov/31c53bbdff73a412662507ef19383973 downsides: clunky management of value factories and type-checking at setValue |
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.
OK, looks good from here!
…erence fixes after review java-native-access#1433
No description provided.