Open make opened 7 years ago
Found that lambda expressions seem to have nothing to do with this issue.
Updated https://github.com/make/lambda-reload-bug to contain only code that crashes the JVM.
To sum up, calling Bug.crash()
crashes JVM when having following code:
package crash;
import com.google.common.collect.MinMaxPriorityQueue;
public class Foo {
class Sub {
Sub(double[] data) {}
}
public Foo() {}
public void bar(double[] data, int size) {
new Sub(data);
MinMaxPriorityQueue.expectedSize(size);
}
}
package crash;
public class Bug {
public static void crash() {
System.out.println("foo");
Foo foo = new Foo();
while(true)
foo.bar(new double[]{}, 10);
}
}
Weird thing is that neither of following crashes the JVM:
public void bar(double[] data, int size) {
// new Sub(data);
MinMaxPriorityQueue.expectedSize(size);
}
or
public void bar(double[] data, int size) {
new Sub(data);
// MinMaxPriorityQueue.expectedSize(size);
}
Using lambda expression in Grails 3.2.3 (spring loaded 1.2.6) causes JVM (1.8.0_111-b14) to crash.
The workaround is to disable class reloading in build.gradle with
This can be reproduced with Grails app: https://github.com/make/lambda-reload-bug