Community
Participate
Working Groups
3.1 The attaches patch fixes the following bugs, mostly related to bugs that quick fix has whe dealing with generic types bug 99398, bug 99389, bug 100551, bug 100236, bug 106013 Some explanations for the reviewers: - correct mapping of types: ASTResolving.guessBindingForTypeReference tries to find a guess for unknown types: E.g. here X will be guessed as String: List<X> list= new List<String>(); - where is which type allowed: ASTResolving.getPossibleTypeKinds returns a set of flags to decide if a location can be primitive, class/interface/.. or a type variable E.g here X can only be a class or interface X<String> list; UtilitiesTest tests these two methods. - NewCUCompletionUsingWizardProposal now sets the type name including type parameters. The type name field is then editable as we should give the user a chance to modify the chosen type parameter names. Other changes are to improve the guessing of the super type. Note that its better to not guess anything than something wrong. - to get a display string for a type binding, BindingLabelProvider.getBindingLabel(...) should be used, never typeBinding.getName.
Created attachment 25688 [details] patch for jdt.ui
Created attachment 25689 [details] patch for jdt.ui.tests
Markus, can you please have a look at this patch as well. If we feel confident this is something we might want to put into 3.1.1 to improve quick fix in the space of the new 1.5 language features.
I reviewed the patch and after some testing in the 3.2 stream I opt to back port/release it to 3.1.1.
NewCUCompletionUsingWizardProposal#getTypeName(int, Name): Nice workaround for NON-NLS warnings, but the following would be smaller, faster, and easier to read: typeArgBaseName= name.startsWith("T") ? "S" : "T" When I have java.util.Map m= new X<String, Integer>(); in a 1.4 project and invoke quick fix on 'X', the wizard is pre-filled with type parameters and comes up with an error. IMO, it's no problem if we leave it this way, since the error message tells about source level 5.0, etc. Otherwise, the patch looks fine, and I agree that it would be a valuable contribution for 3.1.1.
patches released in 3.1.1 streams > 20050818
verifying...
verified all scenarios in bug 99398, bug 99389, bug 100551, bug 100236, bug 106013 work as expected in 3.1.1.