Bug 329589 - [1.4/1.5][compiler] Class comparison using '==' has issue with java.lang.Class and the 1.4/1.5 mixed mode
Summary: [1.4/1.5][compiler] Class comparison using '==' has issue with java.lang.Clas...
Status: VERIFIED DUPLICATE of bug 329593
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 3.7 M4   Edit
Assignee: Srikanth Sankaran CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-05 16:25 EDT by Olivier Thomann CLA
Modified: 2010-12-07 12:14 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Olivier Thomann CLA 2010-11-05 16:25:22 EDT
Using HEAD code, some code that is comparing Class objects using '==' has some issues when 1.4 and 1.5 types are mixed up.
Regression test to follow.
Comment 1 Olivier Thomann CLA 2010-11-05 16:26:44 EDT
Regression test in:
org.eclipse.jdt.core.tests.compiler.regression.MethodVerifyTest._test329589()
Comment 2 Olivier Thomann CLA 2010-11-06 12:10:41 EDT
The regression test still fails for this one with the fixes for the other issues, but there is no longer any error in the OSGi workspace.

Tom, could you please try JDT/Core from HEAD with your own workspace and confirm that everything compiles fine ?

Thanks.
Comment 3 Srikanth Sankaran CLA 2010-11-06 13:56:04 EDT
(In reply to comment #2)
> The regression test still fails for this one with the fixes for the other
> issues, but there is no longer any error in the OSGi workspace.

This regression test is "unreal" and cannot be a correct model
of the user's setup, since in this test case, the class 'Class'
will appear both as BinaryTypeBinding (1.5 type) and SourceTypeBinding
(1.4 type) to the compiler. There can be no equivalence between
two such types.

I think the appropriate test case should have Class as a generic binary
type from 1.5 jar and again as a non generic 1.4 binary type.
I suspect the underlying problem is the same as the one in bug 329593
to do with type equivalence in the presence of plain, raw and parameterized
versions of a type.

> Tom, could you please try JDT/Core from HEAD with your own workspace and
> confirm that everything compiles fine ?

Olivier, Tom, Appreciate all the help with triaging and testing.
Thanks also for your patience, this area has been the veritable hornet's
nest that has been stirred up.
Comment 4 Srikanth Sankaran CLA 2010-11-06 22:32:26 EDT
I deleted the junit as it is not the right test case.

Closing as duplicate of bug 329593.

*** This bug has been marked as a duplicate of bug 329593 ***
Comment 5 Thomas Watson CLA 2010-11-08 08:57:35 EST
(In reply to comment #2)
> Tom, could you please try JDT/Core from HEAD with your own workspace and
> confirm that everything compiles fine ?

My workspace is compiling fine using JDT/Core from HEAD.  Thanks for the quick turnaround!
Comment 6 Olivier Thomann CLA 2010-12-07 12:14:24 EST
Verified using I20101207-0250 (4.1 I-build)