Community
Participate
Working Groups
N20050508-0010 ASTParser#createASTs(..) restores wrong bindings from keys when multiple capture bindings are to be restored at once. In the example below, take the binding of the reference to 'list_wildcard' and the binding of type argument of 'list_wildcard'. Their keys are: - Ljava/util/List<Lgeneric/TestCaptureAssignments;!Ljava/util/List;*166;>; - Lgeneric/TestCaptureAssignments;!Ljava/util/List;*166; The restored binding for the first key is a ParameterizedTypeBinding List<TestCaptureAssignments> with a different key: - Ljava/util/List<Lgeneric/TestCaptureAssignments;>; package generic; import java.util.List; public class TestCaptureAssignments { Object o= null; List<?> list_wildcard; void use() { o= list_wildcard; } } To reproduce, you can also run the refactoring test org.eclipse.jdt.ui.tests.typeconstraints.TypeEnvironmentTests with constant BUG_93102_core_restore_capture_binding set to false and the above version of resources/TypeEnvironment/TestProject/generic/TestCaptureAssignments.java
Changed the binding key for parameterized types to put the capture's source type first. Adapted BindingKeyParser and its subclasses to this change. Added regression test BatchASTCreationTests#test064()
Verified in i20050527-0010