mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
accept type arguments on raw types for > 1.6 javac
This commit is contained in:
+5
-2
@@ -1128,9 +1128,12 @@ public class GenericsHighlightUtil {
|
||||
if (element instanceof PsiMethod) {
|
||||
if (((PsiMethod)element).findSuperMethods().length > 0) return null;
|
||||
if (qualifier instanceof PsiReferenceExpression){
|
||||
final PsiClass typeParameter = PsiUtil.resolveClassInType(((PsiReferenceExpression)qualifier).getType());
|
||||
final PsiType type = ((PsiReferenceExpression)qualifier).getType();
|
||||
final boolean isJavac7 = JavaVersionService.getInstance().isAtLeast(containingClass, JavaSdkVersion.JDK_1_7);
|
||||
if (type instanceof PsiClassType && isJavac7 && ((PsiClassType)type).isRaw()) return null;
|
||||
final PsiClass typeParameter = PsiUtil.resolveClassInType(type);
|
||||
if (typeParameter instanceof PsiTypeParameter) {
|
||||
if (JavaVersionService.getInstance().isAtLeast(containingClass, JavaSdkVersion.JDK_1_7)) return null;
|
||||
if (isJavac7) return null;
|
||||
for (PsiClassType classType : typeParameter.getExtendsListTypes()) {
|
||||
final PsiClass resolve = classType.resolve();
|
||||
if (resolve != null) {
|
||||
|
||||
+2
-2
@@ -15,7 +15,7 @@ abstract class B<S> {
|
||||
public abstract <T extends Iterable<String>> void foo();
|
||||
<T extends B> void bar(T x){
|
||||
B a = null;
|
||||
a.<error descr="Type arguments given on a raw method"><Iterable<String>></error> foo();
|
||||
a.<Iterable<String>> foo();
|
||||
x.<Iterable<String>> foo();
|
||||
}
|
||||
}
|
||||
@@ -37,7 +37,7 @@ abstract class B1<S> {
|
||||
public abstract <T extends Iterable<String>> void foo();
|
||||
<T extends B1 & I1> void bar(T x){
|
||||
B1 a = null;
|
||||
a.<error descr="Type arguments given on a raw method"><Iterable<String>></error> foo();
|
||||
a.<Iterable<String>> foo();
|
||||
x.<Iterable<String>> foo();
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -15,7 +15,7 @@ abstract class B<S> {
|
||||
public abstract <T extends Iterable<String>> void foo();
|
||||
<T extends B> void bar(T x){
|
||||
B a = null;
|
||||
a.<error descr="Type arguments given on a raw method"><Iterable<String>></error> foo();
|
||||
a.<Iterable<String>> foo();
|
||||
x.<Iterable<String>> foo();
|
||||
}
|
||||
}
|
||||
@@ -37,7 +37,7 @@ abstract class B1<S> {
|
||||
public abstract <T extends Iterable<String>> void foo();
|
||||
<T extends B1 & I1> void bar(T x){
|
||||
B1 a = null;
|
||||
a.<error descr="Type arguments given on a raw method"><Iterable<String>></error> foo();
|
||||
a.<Iterable<String>> foo();
|
||||
x.<Iterable<String>> foo();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user