mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-13 21:55:01 +07:00
add explicit arguments: eliminate wildcards (IDEA-106741)
This commit is contained in:
+1
-1
@@ -75,7 +75,7 @@ public class AddTypeArgumentsConditionalFix implements IntentionAction {
|
||||
public String fun(PsiTypeParameter parameter) {
|
||||
final PsiType substituteTypeParam = mySubstitutor.substitute(parameter);
|
||||
LOG.assertTrue(substituteTypeParam != null);
|
||||
return substituteTypeParam.getCanonicalText();
|
||||
return GenericsUtil.eliminateWildcards(substituteTypeParam).getCanonicalText();
|
||||
}
|
||||
}, ", ") + ">";
|
||||
final PsiExpression expression = myExpression.getMethodExpression().getQualifierExpression();
|
||||
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// "Add explicit type arguments" "true"
|
||||
import java.util.*;
|
||||
|
||||
class Test {
|
||||
static class A {}
|
||||
static class B extends A {}
|
||||
|
||||
|
||||
public Collection<? extends A> run(boolean flag) {
|
||||
return flag ? Collections.singletonList(new B()) : Collections.<A>emptyList();
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// "Add explicit type arguments" "true"
|
||||
import java.util.*;
|
||||
|
||||
class Test {
|
||||
static class A {}
|
||||
static class B extends A {}
|
||||
|
||||
|
||||
public Collection<? extends A> run(boolean flag) {
|
||||
return flag ? Collections.singletonList(new B()) : Collections.<caret>emptyList();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user