mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
varargs check can be applied for new java only (fix resolve tests)
This commit is contained in:
+1
-1
@@ -454,7 +454,7 @@ public class JavaMethodsConflictResolver implements PsiConflictResolver{
|
||||
PsiType type2 = params2[Math.min(i, params2.length - 1)].getType();
|
||||
if (applicabilityLevel == MethodCandidateInfo.ApplicabilityLevel.VARARGS) {
|
||||
if (type1 instanceof PsiEllipsisType && type2 instanceof PsiEllipsisType &&
|
||||
(((PsiArrayType)type1).getComponentType().equalsToText(CommonClassNames.JAVA_LANG_OBJECT) || ((PsiArrayType)type2).getComponentType().equalsToText(CommonClassNames.JAVA_LANG_OBJECT))) {
|
||||
(!JavaVersionService.getInstance().isAtLeast(class1, JavaSdkVersion.JDK_1_8) || ((PsiArrayType)type1).getComponentType().equalsToText(CommonClassNames.JAVA_LANG_OBJECT) || ((PsiArrayType)type2).getComponentType().equalsToText(CommonClassNames.JAVA_LANG_OBJECT))) {
|
||||
type1 = ((PsiEllipsisType)type1).toArrayType();
|
||||
type2 = ((PsiEllipsisType)type2).toArrayType();
|
||||
}
|
||||
|
||||
+11
-1
@@ -18,6 +18,9 @@ package com.intellij.codeInsight.daemon.lambda;
|
||||
import com.intellij.codeInsight.daemon.LightDaemonAnalyzerTestCase;
|
||||
import com.intellij.codeInspection.LocalInspectionTool;
|
||||
import com.intellij.codeInspection.unusedSymbol.UnusedSymbolLocalInspection;
|
||||
import com.intellij.openapi.projectRoots.JavaSdkVersion;
|
||||
import com.intellij.openapi.projectRoots.JavaVersionService;
|
||||
import com.intellij.openapi.projectRoots.JavaVersionServiceImpl;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
|
||||
public class MethodRefHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
@@ -99,6 +102,13 @@ public class MethodRefHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
}
|
||||
|
||||
private void doTest(final boolean warnings) throws Exception {
|
||||
doTest(BASE_PATH + "/" + getTestName(false) + ".java", warnings, false);
|
||||
final JavaVersionServiceImpl versionService = (JavaVersionServiceImpl)JavaVersionService.getInstance();
|
||||
try {
|
||||
versionService.setTestVersion(JavaSdkVersion.JDK_1_8);
|
||||
doTest(BASE_PATH + "/" + getTestName(false) + ".java", warnings, false);
|
||||
}
|
||||
finally {
|
||||
versionService.setTestVersion(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user