mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
change signature: don't ask about covariant overrides when types are equal, e.g. when super type is changed based on override method return type
type annotations: ensure annotations are cloned so invalidating initial type doesn't break the consequence refactoring EA-93296 - PIEAE: PsiUtilCore.ensureValid
This commit is contained in:
+1
-1
@@ -193,7 +193,7 @@ public class ChangeSignatureProcessor extends ChangeSignatureProcessorBase {
|
||||
return;
|
||||
}
|
||||
final PsiType overriderType = overrider.getReturnType();
|
||||
if (overriderType != null && type.isAssignableFrom(overriderType)) {
|
||||
if (overriderType != null && !type.equals(overriderType) && type.isAssignableFrom(overriderType)) {
|
||||
covariantOverriderInfos.add(usageInfo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,7 +58,13 @@ public class CanonicalTypes {
|
||||
protected final TypeAnnotationProvider myProvider;
|
||||
|
||||
public AnnotatedType(@NotNull TypeAnnotationProvider provider) {
|
||||
myProvider = TypeAnnotationProvider.Static.create(provider.getAnnotations());
|
||||
PsiAnnotation[] annotations = ContainerUtil.map(provider.getAnnotations(), new Function<PsiAnnotation, PsiAnnotation>() {
|
||||
@Override
|
||||
public PsiAnnotation fun(PsiAnnotation annotation) {
|
||||
return (PsiAnnotation)annotation.copy();
|
||||
}
|
||||
}, PsiAnnotation.EMPTY_ARRAY);
|
||||
myProvider = TypeAnnotationProvider.Static.create(annotations);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
// "Make 'a.f' return 'java.util.List<java.lang.@N String>'" "true"
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Target;
|
||||
import java.util.List;
|
||||
|
||||
@Target({ElementType.TYPE_USE})
|
||||
@interface N {}
|
||||
|
||||
class a {
|
||||
List<@N String> f() {
|
||||
return ;
|
||||
}
|
||||
}
|
||||
|
||||
class b extends a {
|
||||
List<@N String> f() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
// "Make 'a.f' return 'java.util.List<java.lang.@N String>'" "true"
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Target;
|
||||
import java.util.List;
|
||||
|
||||
@Target({ElementType.TYPE_USE})
|
||||
@interface N {}
|
||||
|
||||
class a {
|
||||
void f() {
|
||||
return ;
|
||||
}
|
||||
}
|
||||
|
||||
class b extends a {
|
||||
<caret>List<@N String> f() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user