java-repl icon indicating copy to clipboard operation
java-repl copied to clipboard

Anything returning a Stream breaks REPL

Open NeQuissimus opened this issue 9 years ago • 3 comments

It seems that returning a stream into one of the resX variables breaks the REPL.

The following breaks JavaREPL reliably:

Object[] o1 = new Object[1];
o1[0] = "hello"
o1
Object[] o2 = new Object[2];
o2[0] = "world";
o2[1] = "foo"
List<Object[]> l = new ArrayList<>()
l.add(o1)
l.add(o2)
l.stream()

From this point forward, every single command will output the following:

ERROR: package java.util.stream.ReferencePipeline does not exist
  public java.util.stream.ReferencePipeline.Head res14 = valueOf("res14");

However, streams themselves seem to be okay. The following works flawlessly:

Object[] o1 = new Object[1];
o1[0] = "hello"
o1
Object[] o2 = new Object[2];
o2[0] = "world";
o2[1] = "foo"
List<Object[]> l = new ArrayList<>()
l.add(o1)
l.add(o2)
l.stream().map(java.util.Arrays::toString).collect(Collectors.toList())

I am using Java 1.8.0_11

NeQuissimus avatar Jul 24 '14 15:07 NeQuissimus