Closed
Description
When attempting to run a project that contains one of the setups described below, the following exception is risen:
Exception in thread "main" java.lang.VerifyError: class "classname" overrides final method "methodname".
Both run commands contain the -noverify. Tested with jdk 6 and 7.
The first example doesn't print the "Hello World!" while the second does print it.
First Example
Exception
Exception in thread "main" java.lang.VerifyError: class test.Implementation2 overrides final method process1.
Run command
java -javaagent:/work/springloaded-1.1.4.jar -noverify Implementation3
Implementation1.java
public abstract class Implementation1<T> implements Interface1<T> {
@Override
public final T process1(T type) {
return type;
}
}
Implementation2.java
public abstract class Implementation2<T1,T2> extends Implementation1<T2> implements Interface2<T1,T2> {
}
Implementation3.java
public class Implementation3 extends Implementation2<String, Integer> {
public static void main(String [] args) {
System.out.println("Hello World!");
}
}
Interface1.java
public interface Interface1<T> {
public T process1(T type);
}
Interface2.java
public interface Interface2<T1, T2> extends Interface1<T2> {
}
Second Example
Exception
Exception in thread "main" java.lang.VerifyError: class test.InnerEnum$sorters overrides final method equals.(Ljava/lang/Object;)
Run command
java -javaagent:/work/springloaded-1.1.4.jar -noverify InnerEnum
InnerEnum.java
import java.util.Comparator;
import java.util.Map;
import java.util.TreeMap;
public class InnerEnum {
public static void main(String [] args) {
System.out.println("Hello World!");
Map<String, String> map = new TreeMap<String, String>(sorters.string);
}
private static enum sorters implements Comparator<String> {
string {
private static final long serialVersionUID = 1L;
@Override
public int compare(String o1, String o2) {
return o1.compareTo(o2);
}
}
}
}
Metadata
Metadata
Assignees
Labels
No labels