JDK-4633201 : generics: bridge for inherited final method can cause verify error
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 5.0
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: solaris_8
  • CPU: generic
  • Submitted: 2002-02-05
  • Updated: 2002-03-08
  • Resolved: 2002-03-08
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
1.4.1 hopperFixed
Related Reports
Relates :  
Relates :  
Description
frog:~/workspaces/test/Generic11 $ ls -la
total 7
drwxr-xr-x   2 gafter        512 Feb  4 22:14 .
drwxr-xr-x 116 gafter       3072 Feb  4 22:19 ..
-rw-r--r--   1 gafter         75 Feb  4 22:14 MyColor.java
-rw-r--r--   1 gafter         82 Feb  4 14:53 MyComparable.java
-rw-r--r--   1 gafter        125 Feb  4 22:11 MyEnum.java
frog:~/workspaces/test/Generic11 $ cat -n MyColor.java 
     1	class MyColor extends MyEnum<MyColor> {
     2	    public static void main() {}
     3	}
frog:~/workspaces/test/Generic11 $ cat -n MyComparable.java 
     1	interface MyComparable<T extends MyComparable<T>> {
     2	    int compareTo(T other);
     3	}
frog:~/workspaces/test/Generic11 $ cat -n MyEnum.java 
     1	class MyEnum<E extends MyEnum<E>> implements MyComparable<E> {
     2	
     3	    public final int compareTo(E other) {
     4		return 0;
     5	    }
     6	}
frog:~/workspaces/test/Generic11 $ newjavac -gj *.java
frog:~/workspaces/test/Generic11 $ /usr/java1.4/bin/java -Xfuture MyColor
Exception in thread "main" java.lang.VerifyError: class MyColor overrides final method .
	at java.lang.ClassLoader.defineClass0(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:509)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:246)
	at java.net.URLClassLoader.access$100(URLClassLoader.java:54)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:193)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:262)
	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:322)
frog:~/workspaces/test/Generic11 $ jdis MyColor.class
super class MyColor
	extends MyEnum
{


Method "<init>":"()V"
	stack 1 locals 1
{
		aload_0;
		invokespecial	Method MyEnum."<init>":"()V";
		return;
}

public static Method main:"()V"
	stack 0 locals 0
{
		return;
}

public Method compareTo:"(LMyEnum;)I"
	stack 2 locals 2
{
		aload_0;
		aload_1;
		checkcast	class MyColor;
		invokespecial	Method MyEnum.compareTo:"(LMyEnum;)I";
		ireturn;
}

} // end Class MyColor
frog:~/workspaces/test/Generic11 $ 

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: hopper FIXED IN: hopper INTEGRATED IN: hopper
14-06-2004

EVALUATION Assigned to Martin@. ###@###.### 2002-02-06
11-06-2004

PUBLIC COMMENTS ..
10-06-2004