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

Android 2.1, 2.2 issue workaround #47

Merged
merged 2 commits into from
Jun 7, 2016
Merged

Conversation

andrey-shikhov
Copy link

Because method Arrays.copyOf added in android 2.3 (https://developer.android.com/reference/java/util/Arrays.html#copyOf(T[], int))
next code will fail:

Stream.of("ab","bc","ce").toArray(String[]::new);

with Exception:

java.lang.NoSuchMethodError: java.util.Arrays.copyOf at com.annimon.stream.Stream.newArray(Stream.java:1244)

This pull request contains workaround for this issue.

@coveralls
Copy link

coveralls commented Jun 7, 2016

Coverage Status

Coverage remained the same at 100.0% when pulling 3b9a8d8 on andrey-shikhov:master into 70baa8b on aNNiMON:master.

@aNNiMON
Copy link
Owner

aNNiMON commented Jun 7, 2016

@andrey-shikhov one remark before I merge you pull request, use System.arraycopy(array, 0, res, 0, Math.min(res.length, array.length));

@coveralls
Copy link

coveralls commented Jun 7, 2016

Coverage Status

Coverage remained the same at 100.0% when pulling 61afa31 on andrey-shikhov:master into 70baa8b on aNNiMON:master.

@aNNiMON aNNiMON merged commit 40c4db4 into aNNiMON:master Jun 7, 2016
@aNNiMON
Copy link
Owner

aNNiMON commented Jun 7, 2016

Merged. Thanks!

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.

None yet

3 participants