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

Do not throw Win32Exception on success for empty section in Kernel32Util#getPrivateProfileSection #1411

Merged
merged 2 commits into from
Feb 23, 2022

Conversation

mkarg
Copy link
Contributor

@mkarg mkarg commented Jan 26, 2022

Fixes #1410

Apparently what the caller in such a situation expects is to get the content of the existing section, i. e. an empty String array.

Using a constant object to reduce heap pollution.

@mkarg mkarg marked this pull request as ready for review January 26, 2022 09:58
@matthiasblaesing
Copy link
Member

Change looks sane to me. Thank you. I would not have pulled out the empty array creation as filling the heap is kind of helpful for JNA (memory freeing is tied to GC), but I see the idea. Would you please

  • use the title of the issue as the commit message
  • add a entry to the CHANGES.md file

Thank you.

btw: there is no need to open issues, if you want to directly fix them. A PR is enough :-)

@dbwiddis dbwiddis changed the title Fixes #1410 Do not throw Win32Exception on success for empty section in Kernel32Util#getPrivateProfileSection Feb 23, 2022
in Kernel32Util#getPrivateProfileSection
@dbwiddis dbwiddis merged commit 69bf22f into java-native-access:master Feb 23, 2022
@mkarg mkarg deleted the fix-1410 branch February 24, 2022 15:30
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 this pull request may close these issues.

Kernel32Util.getPrivateProfileSection() throws Win32Exception for empty sections
3 participants