Bug 93102

Summary: [1.5] Cannot restore capture binding from binding key
Product: [Eclipse Project] JDT Reporter: Markus Keller <markus.kell.r>
Component: CoreAssignee: Jerome Lanneluc <jerome_lanneluc>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: 3.1 M7   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Markus Keller CLA 2005-04-28 07:07:36 EDT
I20050426-1700

Cannot restore capture binding from binding key using
ASTRequestor()#acceptBinding(...):

package xy;
import java.util.Vector;
public class Cap {
	{
		Vector<?> v= null;
		v.get(0);
	}
}

- The capture binding for "v.get(0)" has key "Lxy/Cap;!*634;".
-> The resolved binding is for class xy.Cap (key "Lxy/Cap;").

- The capture binding for the reference to "v" has key
"Ljava/util/Vector<Lxy/Cap;!*634;>;"
-> The resolved binding is for parameterized type Vector<Cap> (key
"Ljava/util/Vector<Lxy/Cap;>;").

Same problem for wildcards with upper/lower bounds.
Comment 1 Jerome Lanneluc CLA 2005-04-29 07:17:17 EDT
Changed wildcard key to include the generic type of the wildcard (that can be
different from the capture's source type).
Adpated BindingKeyParser and its subclasses.
Added regression test BatchASTCreationTests#test060() and adapted other tests.
Comment 2 Frederic Fusier CLA 2005-05-12 09:48:24 EDT
Verified for 3.1 M7 using build I20050509-2010 + jdt.core HEAD.