mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
revert
This commit is contained in:
+6
-8
@@ -411,7 +411,7 @@ public class JavaMethodsConflictResolver implements PsiConflictResolver{
|
||||
|
||||
Specifics isMoreSpecific = null;
|
||||
for (int i = 0; i < types1.length; i++) {
|
||||
Specifics specifics = checkSubstitutorSpecific(method1, method2, classSubstitutor1, classSubstitutor2, types1[i], types2[i], isMoreSpecific);
|
||||
Specifics specifics = checkSubstitutorSpecific(method1, method2, classSubstitutor1, classSubstitutor2, types1[i], types2[i]);
|
||||
if (specifics == null) {
|
||||
PsiSubstitutor methodSubstitutor1 = PsiSubstitutor.EMPTY;
|
||||
PsiSubstitutor methodSubstitutor2 = PsiSubstitutor.EMPTY;
|
||||
@@ -488,7 +488,7 @@ public class JavaMethodsConflictResolver implements PsiConflictResolver{
|
||||
PsiSubstitutor classSubstitutor1,
|
||||
PsiSubstitutor classSubstitutor2,
|
||||
PsiType type1,
|
||||
PsiType type2, Specifics moreSpecific) {
|
||||
PsiType type2) {
|
||||
final Map<PsiTypeParameter, PsiType> map1 = classSubstitutor1.getSubstitutionMap();
|
||||
final Map<PsiTypeParameter, PsiType> map2 = classSubstitutor2.getSubstitutionMap();
|
||||
|
||||
@@ -506,14 +506,13 @@ public class JavaMethodsConflictResolver implements PsiConflictResolver{
|
||||
else {
|
||||
final PsiTypeParameter p1 = map1.keySet().iterator().next();
|
||||
final PsiTypeParameter p2 = map2.keySet().iterator().next();
|
||||
return checkTypeParams(method1, method2, classSubstitutor1, classSubstitutor2, type1, type2, p1, p2, moreSpecific);
|
||||
return checkTypeParams(method1, method2, classSubstitutor1, classSubstitutor2, type1, type2, p1, p2);
|
||||
}
|
||||
} else {
|
||||
final PsiClass aClass1 = PsiUtil.resolveClassInClassTypeOnly(type1);
|
||||
final PsiClass aClass2 = PsiUtil.resolveClassInClassTypeOnly(type2);
|
||||
if (aClass1 instanceof PsiTypeParameter && aClass2 instanceof PsiTypeParameter) {
|
||||
return checkTypeParams(method1, method2, classSubstitutor1, classSubstitutor2, type1, type2, (PsiTypeParameter)aClass1, (PsiTypeParameter)aClass2,
|
||||
moreSpecific);
|
||||
return checkTypeParams(method1, method2, classSubstitutor1, classSubstitutor2, type1, type2, (PsiTypeParameter)aClass1, (PsiTypeParameter)aClass2);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
@@ -527,7 +526,7 @@ public class JavaMethodsConflictResolver implements PsiConflictResolver{
|
||||
PsiType type1,
|
||||
PsiType type2,
|
||||
PsiTypeParameter p1,
|
||||
PsiTypeParameter p2, Specifics moreSpecific) {
|
||||
PsiTypeParameter p2) {
|
||||
Specifics specifics = checkSubtyping(TypeConversionUtil.erasure(PsiSubstitutor.EMPTY.substitute(p1)),
|
||||
TypeConversionUtil.erasure(PsiSubstitutor.EMPTY.substitute(p2)), method1, method2);
|
||||
if (specifics == Specifics.NEITHER) {
|
||||
@@ -555,8 +554,7 @@ public class JavaMethodsConflictResolver implements PsiConflictResolver{
|
||||
} else {
|
||||
final PsiType ctype1 = classSubstitutor1.substitute(type1);
|
||||
final PsiType ctype2 = classSubstitutor2.substitute(type2);
|
||||
specifics = checkSubtyping(ctype1, ctype2, method1, method2);
|
||||
return specifics == null && moreSpecific == null ? Specifics.NEITHER : specifics;
|
||||
return checkSubtyping(ctype1, ctype2, method1, method2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package pck;
|
||||
|
||||
class Key<K>{}
|
||||
|
||||
public class C {
|
||||
public <T> void putCopyableUserData(Key<T> key, T value) {
|
||||
}
|
||||
}
|
||||
|
||||
interface D {
|
||||
<T> void putCopyableUserData(Key<T> key, T value);
|
||||
}
|
||||
|
||||
class B extends C implements D {}
|
||||
|
||||
class A {
|
||||
private static final Key<Integer> INDENT_INFO = new Key<Integer>();
|
||||
|
||||
public static void foo(B b, int oldIndentation) {
|
||||
b.putCopyableUserData(INDENT_INFO, oldIndentation >= 0 ? oldIndentation : null);
|
||||
}
|
||||
}
|
||||
+12
-9
@@ -157,7 +157,7 @@ public class AdvHighlightingJdk7Test extends DaemonAnalyzerTestCase {
|
||||
doTestAmbiguous();
|
||||
}
|
||||
|
||||
public void testAmbiguousIDEA67832() throws Exception {
|
||||
public void _testAmbiguousIDEA67832() throws Exception {
|
||||
doTestAmbiguous();
|
||||
}
|
||||
|
||||
@@ -172,17 +172,20 @@ public class AdvHighlightingJdk7Test extends DaemonAnalyzerTestCase {
|
||||
public void testAmbiguousIDEA25097() throws Exception {
|
||||
doTestAmbiguous();
|
||||
}
|
||||
|
||||
|
||||
public void testAmbiguousIDEA24768() throws Exception {
|
||||
doTestAmbiguous();
|
||||
}
|
||||
|
||||
|
||||
public void testAmbiguousIDEA21660() throws Exception {
|
||||
doTestAmbiguous();
|
||||
}
|
||||
|
||||
doTestAmbiguous();
|
||||
}
|
||||
|
||||
public void testAmbiguousIDEA22547() throws Exception {
|
||||
doTestAmbiguous();
|
||||
}
|
||||
|
||||
doTestAmbiguous();
|
||||
}
|
||||
|
||||
public void testAmbiguousInferenceOrder() throws Exception {
|
||||
doTestAmbiguous();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user