Created
July 18, 2019 10:11
-
-
Save tomwhoiscontrary/a1cc6280d95113ca2da1cace78020db3 to your computer and use it in GitHub Desktop.
Breaking IntelliJ stream trace
This file contains 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
java.lang.IncompatibleClassChangeError: Type StreamTraceTest$GeneratedEvaluationClass$8 is not a nest member of StreamTraceTest: types are in different packages |
This file contains 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
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