Bug 323855 - [1.5][compiler] Wrong compile errors from reconciler when referencing 1.4 project from 1.5 code
Summary: [1.5][compiler] Wrong compile errors from reconciler when referencing 1.4 pro...
Status: VERIFIED DUPLICATE of bug 323633
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.7 M2   Edit
Assignee: Srikanth Sankaran CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-27 12:44 EDT by Markus Keller CLA
Modified: 2011-01-25 12:35 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2010-08-27 12:44:39 EDT
I20100824-1210

I've set the compliance of org.eclipse.jdt.ui.tests.refactoring to 1.5, and now I'm seeing a compile error in CopyToClipboardActionTest that looks very similar to bug 305259 and only shows up in the reconciler.

	private IFile createFile(IFolder folder, String fileName) throws Exception {
		IFile file= folder.getFile(fileName);
		file.create(getStream("aa"), true, null);
		return file;
	}

=> "folder.getFile(fileName)" gets marked with error "The type Comparable is not generic; it cannot be parameterized with arguments <String>".


Another problem is in PushDownTests, where the reconciler says (at offset 0): "The type AbstractList is not generic; it cannot be parameterized with arguments <E>".
Comment 1 Frederic Fusier CLA 2010-08-27 13:06:21 EDT
Srikanth, could you please follow-up?
Thanks
Comment 2 Srikanth Sankaran CLA 2010-08-27 21:11:38 EDT
See also bug 323633 comment 3.

As explained there, prior to the fix for bug 305259,
when a 1.4 project references a binary type, we drop
all generics information and materialize the fully
erased form. For source types, we used to just drop
the type parameters - this results in a semi erased
form with the type parameter still lingering around
in return types and such.

After the fix for bug 305259, binary types continue
to be fully erased, but source types carry the full
generic information. This turns out to have its own
complications as shown by the current bug and bug 323633.

I am looking into this.
Comment 3 Srikanth Sankaran CLA 2010-08-28 22:42:17 EDT
In order to centralize the discussion in one
place, I am closing this as a duplicate of
bug 323633.

I'll include this scenario in the regression
tests there.

For follow ups, onto bug 323633 -- Thanks.

*** This bug has been marked as a duplicate of bug 323633 ***
Comment 4 Srikanth Sankaran CLA 2010-08-30 23:16:40 EDT
(In reply to comment #0)
> I20100824-1210
> 
> I've set the compliance of org.eclipse.jdt.ui.tests.refactoring to 1.5, and now
> I'm seeing a compile error in CopyToClipboardActionTest that looks very similar
> to bug 305259 and only shows up in the reconciler.
> 
>     private IFile createFile(IFolder folder, String fileName) throws Exception
> {
>         IFile file= folder.getFile(fileName);
>         file.create(getStream("aa"), true, null);
>         return file;
>     }
> 
> => "folder.getFile(fileName)" gets marked with error "The type Comparable is
> not generic; it cannot be parameterized with arguments <String>".

(1) With JDT/Core HEAD version, I am not able to reproduce this:

I have the HEAD version of the following projects in my workspace:

org.eclipse.jdt.ui
org.eclipse.jdt.ui.tests
org.eclipse.jdt.ui.tests.refactoring
org.eclipse.text.tests

> Another problem is in PushDownTests, where the reconciler says (at offset 0):
> "The type AbstractList is not generic; it cannot be parameterized with
> arguments <E>".

I am able to reproduce this with JDT/Core HEAD and the above projects.
This problem is successfully fixed by the patch posted at bug 323633 comment 9
Comment 5 Markus Keller CLA 2010-09-01 14:18:59 EDT
The problem in CopyToClipboardActionTest indeed needs a few more projects in source to reproduce. These are sufficient for me in I20100831-1001 (with all necessary JREs installed):

org.eclipse.jdt.ui
org.eclipse.jdt.ui.tests
org.eclipse.jdt.ui.tests.refactoring
org.eclipse.jface.text.tests
org.eclipse.ltk.core.refactoring
org.eclipse.test.performance
org.eclipse.text.tests

The patch from bug 323633 comment 9 also fixes this problem.
Comment 6 Olivier Thomann CLA 2011-01-25 12:35:45 EST
Verified.