mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IG: register problem on navigation element when identifier is not physical (in Groovy)
This commit is contained in:
+13
-6
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
* Copyright 2000-2016 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.
|
||||
@@ -15,10 +15,7 @@
|
||||
*/
|
||||
package com.siyeh.ig.junit;
|
||||
|
||||
import com.intellij.psi.PsiClass;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiModifier;
|
||||
import com.intellij.psi.PsiTypeParameter;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.util.InheritanceUtil;
|
||||
import com.siyeh.InspectionGadgetsBundle;
|
||||
import com.siyeh.ig.BaseInspectionVisitor;
|
||||
@@ -96,7 +93,17 @@ public class JUnitAbstractTestClassNamingConventionInspectionBase extends Conven
|
||||
if (isValid(name)) {
|
||||
return;
|
||||
}
|
||||
registerClassError(aClass, name);
|
||||
final PsiIdentifier identifier = aClass.getNameIdentifier();
|
||||
if (identifier == null) {
|
||||
return;
|
||||
}
|
||||
if (!identifier.isPhysical()) {
|
||||
final PsiElement navigationElement = identifier.getNavigationElement();
|
||||
registerError(navigationElement, name);
|
||||
}
|
||||
else {
|
||||
registerClassError(aClass, name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+12
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
* Copyright 2000-2016 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.
|
||||
@@ -95,7 +95,17 @@ public class JUnitTestClassNamingConventionInspectionBase extends ConventionInsp
|
||||
if (isValid(name)) {
|
||||
return;
|
||||
}
|
||||
registerClassError(aClass, name);
|
||||
final PsiIdentifier identifier = aClass.getNameIdentifier();
|
||||
if (identifier == null) {
|
||||
return;
|
||||
}
|
||||
if (!identifier.isPhysical()) {
|
||||
final PsiElement navigationElement = identifier.getNavigationElement();
|
||||
registerError(navigationElement, name);
|
||||
}
|
||||
else {
|
||||
registerClassError(aClass, name);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean hasJUnit4TestMethods(@NotNull PsiClass aClass) {
|
||||
|
||||
Reference in New Issue
Block a user