Skip to content

[GITHUB-1087] Fix wrong calls to Structure#toArray with zero sized arrays#1088

Merged
matthiasblaesing merged 1 commit intojava-native-access:masterfrom
matthiasblaesing:github-1087
Apr 26, 2019
Merged

[GITHUB-1087] Fix wrong calls to Structure#toArray with zero sized arrays#1088
matthiasblaesing merged 1 commit intojava-native-access:masterfrom
matthiasblaesing:github-1087

Conversation

@matthiasblaesing
Copy link
Copy Markdown
Member

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: #1087

@matthiasblaesing
Copy link
Copy Markdown
Member Author

@hc-codersatlas please check this PR. It is a partial revert of your changeset (performance optimization by using a zero sized array in Collection#toArray.

I plan to do a patch release next weekend, as this is a regression.

Here is a test build:
test-build.zip

@re-thc
Copy link
Copy Markdown
Contributor

re-thc commented Apr 26, 2019

Good find. Thanks. Didn't notice the Structure. All good.

Comment thread CHANGES.md

Bug Fixes
---------
* [#1087](https://github.com/java-native-access/jna/pull/1087): Fix wrong calls to Structure#toArray with zero sized arrays - [@matthiasblaesing](https://github.com/matthiasblaesing).
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be 1088? (Yay, I found something to comment on. I did look over the PR and otherwise think it looks good.)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there is an issue open for a changeset, I'm referencing that. If there is no issue, then it is the PR that brought the change in. In this case the original PR is #1087 and replaces an issue.

Thank you for your review!

…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 matthiasblaesing merged commit cdf119c into java-native-access:master Apr 26, 2019
@matthiasblaesing matthiasblaesing deleted the github-1087 branch April 26, 2019 17:56
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.

3 participants