Bug 363724

Summary: compile error when clone in interface type-parameter
Product: [Eclipse Project] JDT Reporter: kurt <kurt2002>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: VERIFIED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: amj87.iitr, kurt2002, srikanth_sankaran
Version: 3.8   
Target Milestone: 3.7 M1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
test-classes (source) none

Description kurt CLA 2011-11-14 12:01:22 EST
Build Identifier: Version: 3.6.2  Build id: M20110210-1200 and Version: 3.8.0  Build id: I20111027-1800

One of the compilers (of 3.6.2 or 3.8M3) seems to be wrong.

Compiler of 3.6.2 gives no error, where compiler of 3.8 (for java 6 and 7) gives the following error on interface-class CloneError:

The inherited method Object.clone() cannot hide the public abstract method in ICloneable	CloneError.java	/J6/src/strange	line 3	Java Problem

My guess:

As the type-parameter in interface CloneError does extend only interfaces, the implicit type-parameter class is java.lang.Object, which has the methode clone() - but defined protected only which is in conflict with one of the declared extending interfaces (ICloneable).

But changing the extends just a little (see NoCloneError_[1-4]) makes the error vanish.

Another guess:

The reported error on CloneError should not be an error at all or the evaluation for the No-interfaces is "not complete".

Will attach my test-classes after I submitted the report.


Reproducible: Always
Comment 1 kurt CLA 2011-11-14 12:03:13 EST
Created attachment 206965 [details]
test-classes (source)
Comment 2 Ayushman Jain CLA 2011-11-14 13:29:24 EST
This was a bug in eclipse compiler which was fixed in 3.7 timeframe. Current behaviour matches javac6 and 7.

*** This bug has been marked as a duplicate of bug 314556 ***