Always causes ArrayIndexOutOfBoundsException#1087
Closed
ertauren wants to merge 1 commit intojava-native-access:masterfrom
ertauren:patch-1
Closed
Always causes ArrayIndexOutOfBoundsException#1087ertauren wants to merge 1 commit intojava-native-access:masterfrom ertauren:patch-1
ertauren wants to merge 1 commit intojava-native-access:masterfrom
ertauren:patch-1
Conversation
https://github.com/java-native-access/jna/blob/db28278447a82bf7dd4e2fe8e73df80398c92235/contrib/platform/src/com/sun/jna/platform/win32/Kernel32Util.java#L675 at this line, spesifiying Array's length as 0 does cause ArrayIndexOutOfBoundsException. Either need to alter Structure.java's toArray method or some change in here. I am bit new in java and github so there might be better solution than writing "((SYSTEM_LOGICAL_PROCESSOR_INFORMATION[])firstInformation).length" instead of "0". If there is better solution please consider this propose of file change as bug report.
matthiasblaesing
added a commit
to matthiasblaesing/jna
that referenced
this pull request
Apr 24, 2019
…rays As a performance optimization calls to Collections#toArray where changed from providing a correctly sized array to using a zero sized array. See 07f3ce0 The change is invalid if the object toArray is called on is a Structure, the calls just look the same. This changeset is a partial revert of the above mentioned commit. Closes: java-native-access#1087
Member
|
Please see here for a different PR: #1088 (the problem is a bit bigger). |
matthiasblaesing
added a commit
to matthiasblaesing/jna
that referenced
this pull request
Apr 25, 2019
…rays As a performance optimization calls to Collections#toArray where changed from providing a correctly sized array to using a zero sized array. See 07f3ce0 The change is invalid if the object toArray is called on is a Structure, the calls just look the same. This changeset is a partial revert of the above mentioned commit. Closes: java-native-access#1087
matthiasblaesing
added a commit
to matthiasblaesing/jna
that referenced
this pull request
Apr 26, 2019
…rays As a performance optimization calls to Collections#toArray where changed from providing a correctly sized array to using a zero sized array. See 07f3ce0 The change is invalid if the object toArray is called on is a Structure, the calls just look the same. This changeset is a partial revert of the above mentioned commit. Closes: java-native-access#1087
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
jna/contrib/platform/src/com/sun/jna/platform/win32/Kernel32Util.java
Line 675 in db28278
at this line, spesifiying Array's length as 0 does cause ArrayIndexOutOfBoundsException. Either need to alter Structure.java's toArray method or some change in here. I am bit new in java and github so there might be better solution than writing "((SYSTEM_LOGICAL_PROCESSOR_INFORMATION[])firstInformation).length" instead of "0". If my solution is wrong or there is better solution please consider this propose of file change as bug report.
If somehow this isn't bug please give me some pointers so that i can learn