mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
can be final: don't suggest private methods
This commit is contained in:
+1
@@ -133,6 +133,7 @@ public class CanBeFinalInspection extends GlobalJavaBatchInspectionTool {
|
||||
else if (refElement instanceof RefMethod) {
|
||||
RefMethod refMethod = (RefMethod)refElement;
|
||||
if (refMethod.getOwnerClass().isFinal()) return null;
|
||||
if (psiMember.hasModifierProperty(PsiModifier.PRIVATE)) return null;
|
||||
if (!isReportMethods()) return null;
|
||||
psiIdentifier = ((PsiMethod)psiMember).getNameIdentifier();
|
||||
}
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
// A.java
|
||||
class A implements Runnable {
|
||||
public void run() {
|
||||
a();
|
||||
}
|
||||
|
||||
private void a() {}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user