mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
conflict resolution: missed null checks for diamonds non-physical static methods (IDEA-132534)
This commit is contained in:
+3
-2
@@ -231,7 +231,8 @@ public class JavaMethodsConflictResolver implements PsiConflictResolver{
|
||||
final PsiMethod method = ((MethodCandidateInfo)conflict).getElement();
|
||||
for (HierarchicalMethodSignature methodSignature : method.getHierarchicalMethodSignature().getSuperSignatures()) {
|
||||
final PsiMethod superMethod = methodSignature.getMethod();
|
||||
if (!CommonClassNames.JAVA_LANG_OBJECT.equals(superMethod.getContainingClass().getQualifiedName())) {
|
||||
final PsiClass aClass = superMethod.getContainingClass();
|
||||
if (aClass != null && !CommonClassNames.JAVA_LANG_OBJECT.equals(aClass.getQualifiedName())) {
|
||||
superMethods.add(superMethod);
|
||||
}
|
||||
}
|
||||
@@ -513,7 +514,7 @@ public class JavaMethodsConflictResolver implements PsiConflictResolver{
|
||||
if (varargsPosition) {
|
||||
if (type1 instanceof PsiEllipsisType && type2 instanceof PsiEllipsisType &&
|
||||
params1.length == params2.length &&
|
||||
(!JavaVersionService.getInstance().isAtLeast(class1, JavaSdkVersion.JDK_1_7) || ((PsiArrayType)type1).getComponentType().equalsToText(CommonClassNames.JAVA_LANG_OBJECT) || ((PsiArrayType)type2).getComponentType().equalsToText(CommonClassNames.JAVA_LANG_OBJECT))) {
|
||||
class1 != null && (!JavaVersionService.getInstance().isAtLeast(class1, JavaSdkVersion.JDK_1_7) || ((PsiArrayType)type1).getComponentType().equalsToText(CommonClassNames.JAVA_LANG_OBJECT) || ((PsiArrayType)type2).getComponentType().equalsToText(CommonClassNames.JAVA_LANG_OBJECT))) {
|
||||
type1 = ((PsiEllipsisType)type1).toArrayType();
|
||||
type2 = ((PsiEllipsisType)type2).toArrayType();
|
||||
}
|
||||
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
class Test {
|
||||
enum FooBar {Foo, Bar}
|
||||
|
||||
void someMethod() {
|
||||
new Infer<>((FooBar) null, FooBar.class);
|
||||
new Infer<FooBar>( (FooBar) null, FooBar.class );
|
||||
}
|
||||
|
||||
|
||||
public class Infer<T extends Enum<T>> {
|
||||
@SafeVarargs
|
||||
public Infer(T inst, Class<T> tClass, T... excludes) {
|
||||
}
|
||||
|
||||
@SafeVarargs
|
||||
public Infer(String inst, Class<T> tClass, T... excludes) {
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
@@ -107,6 +107,7 @@ public class LightAdvHighlightingJdk7Test extends LightDaemonAnalyzerTestCase {
|
||||
public void testInnerInTypeArguments() { doTest(false, false); }
|
||||
public void testRawSubstitutor() { doTest(false, false); }
|
||||
public void testIncompleteDiamonds() { doTest(false, false); }
|
||||
public void testResolveConflictDiamonds() { doTest(false, false); }
|
||||
|
||||
public void testDynamicallyAddIgnoredAnnotations() {
|
||||
ExtensionPoint<EntryPoint> point = Extensions.getRootArea().getExtensionPoint(ToolExtensionPoints.DEAD_CODE_TOOL);
|
||||
|
||||
Reference in New Issue
Block a user