mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-06 05:10:22 +07:00
type params: error for jdk < 1.7 (IDEA-67861)
This commit is contained in:
@@ -145,7 +145,7 @@ public class GenericsHighlightUtil {
|
||||
final String description;
|
||||
if (targetParametersNum == 0) {
|
||||
if (PsiTreeUtil.getParentOfType(referenceParameterList, PsiCall.class) != null &&
|
||||
PsiUtil.isLanguageLevel7OrHigher(referenceParameterList)) {
|
||||
JavaVersionService.getInstance().isAtLeast(referenceParameterList, JavaSdkVersion.JDK_1_7)) {
|
||||
description = null;
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
*/
|
||||
package com.intellij.psi.infos;
|
||||
|
||||
import com.intellij.openapi.projectRoots.JavaSdkVersion;
|
||||
import com.intellij.openapi.projectRoots.JavaVersionService;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.pom.java.LanguageLevel;
|
||||
import com.intellij.psi.*;
|
||||
@@ -136,7 +138,7 @@ public class MethodCandidateInfo extends CandidateInfo{
|
||||
final PsiMethod psiMethod = getElement();
|
||||
PsiTypeParameter[] typeParams = psiMethod.getTypeParameters();
|
||||
if (myTypeArguments != null && typeParams.length != myTypeArguments.length && !PsiUtil.isLanguageLevel7OrHigher(psiMethod)){
|
||||
return false;
|
||||
return typeParams.length == 0 && JavaVersionService.getInstance().isAtLeast(psiMethod, JavaSdkVersion.JDK_1_7);
|
||||
}
|
||||
PsiSubstitutor substitutor = getSubstitutor();
|
||||
return GenericsUtil.isTypeArgumentsApplicable(typeParams, substitutor, getParent());
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
abstract class C {
|
||||
<T> void foo(Object s){ }
|
||||
abstract String foo(String s);
|
||||
|
||||
{
|
||||
this.<String>foo("").toLowerCase();
|
||||
}
|
||||
}
|
||||
@@ -195,6 +195,7 @@ public class GenericsHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
public void testIDEA98421() { doTest5(false); }
|
||||
public void testErasureTypeParameterBound() { doTest5(false); }
|
||||
public void testThisAsAccessObject() { doTest5(false); }
|
||||
public void testIDEA67861() { doTest7Incompatibility(false); }
|
||||
|
||||
public void testJavaUtilCollections_NoVerify() throws Exception {
|
||||
PsiClass collectionsClass = getJavaFacade().findClass("java.util.Collections", GlobalSearchScope.moduleWithLibrariesScope(getModule()));
|
||||
|
||||
Reference in New Issue
Block a user