Summary: | compiler error, method declaration in interface -> NullPointerException | ||||||
---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Jari Kujansuu <Jari.Kujansuu> | ||||
Component: | Core | Assignee: | Philipe Mulet <philippe_mulet> | ||||
Status: | RESOLVED WORKSFORME | QA Contact: | |||||
Severity: | major | ||||||
Priority: | P3 | ||||||
Version: | 2.0.1 | ||||||
Target Milestone: | 2.1 M2 | ||||||
Hardware: | PC | ||||||
OS: | Windows XP | ||||||
Whiteboard: | |||||||
Attachments: |
|
Description
Jari Kujansuu
2002-10-09 06:59:35 EDT
I cannot reproduce with the following test case: interface A { int hashCode(); } interface B extends A { } class C implements B { public int hashCode(){ return super.hashCode(); } } public class Test { public static void main(String[] arguments) { C c = new C(); System.out.println("((A)c).hashCode() : "+ ((A)c).hashCode()); System.out.println("((B)c).hashCode() : "+ ((B)c).hashCode()); System.out.println("((C)c).hashCode() : "+ ((C)c).hashCode()); } } Can you provide exact test case ? It seems to depend on the fact that an Object method is involved, but I need exact case. Created attachment 2138 [details]
JAR containing class and java files for test case that showed error.
Tried your test case, works fine either in latest 2.1 integration build or 2.0.2: Object: 16032330 Object.toString(): C.toString() Interface A.test(): 16032330 Interface A.toString(): C.toString() Interface A.hashCode(): 16032330 Interface B.test(): 16032330 Interface B.hashCode(): 16032330 Interface B.toString(): C.toString() Class C.test():16032330 Class C.hashCode():16032330 Class C.toString(): C.toString() Couldn't reproduce it either on 2.0.1. Could this be a VM bug ? Which JRE are you using. I am using Sun JDK 1.4.1 b18 (b14 had numerous issues on this front). Installed Sun's SDK 1.4.1 and error was gone. When compiling with Eclipse and running 1.4.0 (01 and 02) it doesn't work. When compiling with normal 1.4.0 everything works. When compiling with Eclipse and running 1.4.1 it works. Ok, then closing as VM bug. |