mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-13 21:55:01 +07:00
revert (IDEA-152685)
This commit is contained in:
@@ -23,7 +23,10 @@ import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
|
||||
public class MethodSignatureUtil {
|
||||
@@ -320,16 +323,20 @@ public class MethodSignatureUtil {
|
||||
result = result.put(superTypeParameters[i], factory.createType(methodTypeParameter));
|
||||
}
|
||||
|
||||
final PsiSubstitutor methodSubstitutor = methodSignature.getSubstitutor();
|
||||
|
||||
//check bounds
|
||||
for (int i = 0; i < methodTypeParameters.length; i++) {
|
||||
PsiTypeParameter methodTypeParameter = methodTypeParameters[i];
|
||||
PsiTypeParameter superTypeParameter = superTypeParameters[i];
|
||||
final Set<PsiType> methodSupers = new HashSet<PsiType>();
|
||||
Collections.addAll(methodSupers, methodTypeParameter.getSuperTypes());
|
||||
for (PsiClassType methodSuper : methodTypeParameter.getSuperTypes()) {
|
||||
methodSupers.add(methodSubstitutor.substitute(methodSuper));
|
||||
}
|
||||
|
||||
final Set<PsiType> superSupers = new HashSet<PsiType>();
|
||||
for (PsiClassType superSuper : superTypeParameter.getSuperTypes()) {
|
||||
superSupers.add(result.substitute(superSuper));
|
||||
superSupers.add(methodSubstitutor.substitute(result.substitute(superSuper)));
|
||||
}
|
||||
methodSupers.remove(PsiType.getJavaLangObject(methodTypeParameter.getManager(), methodTypeParameter.getResolveScope()));
|
||||
superSupers.remove(PsiType.getJavaLangObject(superTypeParameter.getManager(), superTypeParameter.getResolveScope()));
|
||||
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
import java.io.Serializable;
|
||||
import java.math.BigInteger;
|
||||
|
||||
class C extends B<String, BigInteger> {
|
||||
@Override
|
||||
public <S extends String> S save(S entity) {
|
||||
return super.save(entity);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class B<T, ID extends Serializable> implements A<T, ID> {
|
||||
public <S extends T> S save(S entity) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
interface A<T, ID extends Serializable> {
|
||||
<S extends T> S save(S var1);
|
||||
}
|
||||
+4
@@ -986,4 +986,8 @@ public class GenericsHighlighting8Test extends LightDaemonAnalyzerTestCase {
|
||||
public void testUncheckedWarningsInsideIncorporationPhase() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testUnifiedSubstitutorUpInTheHierarchy() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user