Skip to content

Instantly share code, notes, and snippets.

@tomwhoiscontrary
Created July 18, 2019 10:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomwhoiscontrary/a1cc6280d95113ca2da1cace78020db3 to your computer and use it in GitHub Desktop.
Save tomwhoiscontrary/a1cc6280d95113ca2da1cace78020db3 to your computer and use it in GitHub Desktop.
Breaking IntelliJ stream trace
java.lang.IncompatibleClassChangeError: Type StreamTraceTest$GeneratedEvaluationClass$8 is not a nest member of StreamTraceTest: types are in different packages
import org.junit.Test;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
import java.util.stream.Stream;
public class StreamTraceTest {
@Test
public void test() {
AtomicInteger mapCount = new AtomicInteger(0);
String result = Stream.of("red", "green", "blue")
.map(s -> {
mapCount.incrementAndGet();
return s.charAt(0);
})
.map(Object::toString)
.collect(Collectors.joining());
System.out.println("result = " + result);
System.out.println("mapCount = " + mapCount);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment