Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Publish AbstractStreamEx class #90

Closed
5 tasks done
amaembo opened this issue Mar 31, 2016 · 2 comments
Closed
5 tasks done

Publish AbstractStreamEx class #90

amaembo opened this issue Mar 31, 2016 · 2 comments
Labels
Milestone

Comments

@amaembo
Copy link
Owner

amaembo commented Mar 31, 2016

Currently some methods are defined in the AbstractStreamEx class which is package-private. This limits the possibilities to use method references with javac <8u102 (see JDK-8143647). Seems that ECJ also sometimes compiles such references incorrectly. Here's testcase which fails:

List<String> input = asList("a", "b", "c");
assertEquals(input, input.stream().map(StreamEx::of).reduce(StreamEx::append).get().toList());

When compiling with javac:

java.lang.IllegalAccessError: one/util/streamex/AbstractStreamEx

When compiling with ecj:

java.lang.NoSuchMethodError: one.util.streamex.StreamEx.append(Ljava/util/stream/Stream;)Lone/util/streamex/StreamEx;

Seems that it's possible to make AbstractStreamEx public which would also solve some javadoc-related issues and compilation errors in some corner cases (like reported in #81). If you have better idea for its name, you're welcome.

  • Write AbstractStreamEx class JavaDoc
  • Make it public
  • Deduplicate chain method
  • Provide at least some tests from another package which validate this change (see also Move API tests to the separate package #91)
  • Changes
@lirikooda
Copy link

I'm seeing the something similar with code compiled with kotlin (1.7.10).
Calling a StreamEx .distinct() works fine, but .distinct(java.util.function.Function) fails with NoSuchMethodError.
Any idea?

@amaembo
Copy link
Owner Author

amaembo commented Sep 13, 2022

Please provide a link to a minimal project that illustrates the problem. Thanks. Likely a Kotlin compiler problem.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants