mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-13 09:19:13 +07:00
add explicit type arguments: preserve nested wildcards (IDEA-134967)
This commit is contained in:
+1
-1
@@ -73,7 +73,7 @@ public class AddTypeArgumentsFix extends MethodArgumentFix {
|
||||
PsiTypeParameter typeParameter = typeParameters[i];
|
||||
final PsiType substitution = helper.getSubstitutionForTypeParameter(typeParameter, returnType, toType, false, level);
|
||||
if (substitution == null || PsiType.NULL.equals(substitution)) return null;
|
||||
mappings[i] = GenericsUtil.eliminateWildcards(substitution);
|
||||
mappings[i] = GenericsUtil.eliminateWildcards(substitution, false);
|
||||
}
|
||||
|
||||
final PsiElementFactory factory = JavaPsiFacade.getInstance(expression.getProject()).getElementFactory();
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
// "Add explicit type arguments" "true"
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
class Bar {
|
||||
|
||||
public static void main(String[] args) {
|
||||
new Bar().complexTypeParams(Collections.<Class<?>>emptyList());
|
||||
}
|
||||
|
||||
void complexTypeParams(List<Class<?>> list) {}
|
||||
}
|
||||
|
||||
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
// "Add explicit type arguments" "true"
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
class Bar {
|
||||
|
||||
public static void main(String[] args) {
|
||||
new Bar().complexTypeParams(Collections.e<caret>mptyList());
|
||||
}
|
||||
|
||||
void complexTypeParams(List<Class<?>> list) {}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user