Community
Participate
Working Groups
The following is generated on neon.1: java.lang.ArrayIndexOutOfBoundsException at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.InferenceContext18.addConstraintsToC(InferenceContext18.java:467) at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.InferenceContext18.addConstraintsToC_OneExpr(InferenceContext18.java:546) at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.InferenceContext18.addConstraintsToC(InferenceContext18.java:470) at org.aspectj.org.eclipse.jdt ... run(GlobalBuildAction.java:177) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55) Compile error: ArrayIndexOutOfBoundsException thrown: -1 The following class triggers this exception: import java.util.HashSet; import java.util.Set; import java.util.stream.Collectors; public class TestCollectors { Set<Integer> ids; public TestCollectors(Set<Inner> inners) { ids = inners.stream().collect(Collectors.toList(Inner::getId)); } public static void main() { Set<Inner> inners = new HashSet<>(); inners.add(new Inner(1, "a")); inners.add(new Inner(1, "a")); new TestCollectors(inners); } public static class Inner { private int id; private String name; public Inner(int id, String name) { this.id = id; this.name = name; } public int getId() { return id; } public String getName() { return name; } } } I believe it is triggered by compiling the inner.stream()...
Thanks so much for the testcase. I can confirm that after upgrading AspectJ to the latest Eclipse JDT this problem is fixed.