mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
EA-41372 - AIOOBE: JavaMethodsConflictResolver.isMoreSpecific
(cherry picked from commit 6f6a46ec1e26294e4a478fc6dee158123ccba406)
This commit is contained in:
+2
-2
@@ -456,8 +456,8 @@ public class JavaMethodsConflictResolver implements PsiConflictResolver{
|
||||
PsiType[] types1 = new PsiType[max];
|
||||
PsiType[] types2 = new PsiType[max];
|
||||
for (int i = 0; i < max; i++) {
|
||||
PsiType type1 = params1[Math.min(i, params1.length - 1)].getType();
|
||||
PsiType type2 = params2[Math.min(i, params2.length - 1)].getType();
|
||||
PsiType type1 = params1.length > 0 ? params1[Math.min(i, params1.length - 1)].getType() : null;
|
||||
PsiType type2 = params2.length > 0 ? params2[Math.min(i, params2.length - 1)].getType() : null;
|
||||
if (applicabilityLevel == MethodCandidateInfo.ApplicabilityLevel.VARARGS) {
|
||||
if (type1 instanceof PsiEllipsisType && type2 instanceof PsiEllipsisType &&
|
||||
(!JavaVersionService.getInstance().isAtLeast(class1, JavaSdkVersion.JDK_1_7) || ((PsiArrayType)type1).getComponentType().equalsToText(CommonClassNames.JAVA_LANG_OBJECT) || ((PsiArrayType)type2).getComponentType().equalsToText(CommonClassNames.JAVA_LANG_OBJECT))) {
|
||||
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
interface Func<TIn, TOut>{
|
||||
TOut run(TIn in);
|
||||
}
|
||||
|
||||
|
||||
class Main {
|
||||
|
||||
public static void main(final String[] args) {
|
||||
Func<Integer, String> func = Integer::toString;
|
||||
System.out.println(func.run(6));
|
||||
}
|
||||
}
|
||||
+4
@@ -145,6 +145,10 @@ public class MethodRefHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
doTest(true);
|
||||
}
|
||||
|
||||
public void testResolveConflicts() throws Exception {
|
||||
doTest(true);
|
||||
}
|
||||
|
||||
private void doTest() throws Exception {
|
||||
doTest(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user