Bug 73837 - Java 1.5 generics problem (Eclipse 3.1M1)
Summary: Java 1.5 generics problem (Eclipse 3.1M1)
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.1 M2   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-13 19:44 EDT by Ayal Spitz CLA
Modified: 2004-09-24 04:39 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ayal Spitz CLA 2004-09-13 19:44:27 EDT
The following series of classes produce an error (The constructor B<Z>(Z, D<Y>)
is undefined) in the 'test' method of the 'C' class. There appears to be some
problem with multi level generics.

public class D<Y>{}

public class B<X>{
   public B(X str,D dValue){}
}

public class C<Z,Y> {
   public B<Z> test(Z zValue,D<Y> yValue){ return new B<Z>(zValue,yValue); }
}

This appears to work with IntelliJ 4.5
Comment 1 Kent Johnson CLA 2004-09-14 16:31:28 EDT
This case works if all the types are compiled from source but fails if B is 
picked up as .class file.

ParameterizedTypeBinding.isEquivalentTo does not accept BinaryTypeBindings... 
just RawTypeBindings.
Comment 2 Ayal Spitz CLA 2004-09-14 23:19:55 EDT
Building on Kents comment, the temporary work around to this bug is to clean the
project and then rebuild it. Trying this approach out on both the example
outlined and the original, more complex code, seems to do the trick.

I知 interested in helping resolve this bug if possible
Comment 3 Kent Johnson CLA 2004-09-15 16:03:14 EDT
Philippe: double check the fix to BinaryTypeBinding.
Comment 4 Philipe Mulet CLA 2004-09-16 09:54:37 EDT
Fix looks good (matching unresolved scenario). Added GenericTypeTests#test293.
Comment 5 Kent Johnson CLA 2004-09-16 11:27:48 EDT
.
Comment 6 Frederic Fusier CLA 2004-09-24 04:39:47 EDT
Verified for 3.1 M2 with build I200409231635.