mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-06 03:21:12 +07:00
leaks in AddAnnotationFix
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
package com.intellij.codeInsight.daemon.quickFix;
|
||||
|
||||
import com.intellij.codeInspection.AnnotateMethodFix;
|
||||
import com.intellij.codeInspection.LocalInspectionTool;
|
||||
import com.intellij.codeInspection.nullable.NullableStuffInspection;
|
||||
import com.intellij.psi.PsiMethod;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.PsiMethod;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
|
||||
public class AnnotateMethodTest extends LightQuickFix15TestCase {
|
||||
@@ -18,14 +19,20 @@ public class AnnotateMethodTest extends LightQuickFix15TestCase {
|
||||
protected LocalInspectionTool[] configureLocalInspectionTools() {
|
||||
return new LocalInspectionTool[]{new NullableStuffInspection(){
|
||||
@Override
|
||||
protected int annotateBaseMethod(final PsiMethod method, final PsiMethod superMethod, final Project project) {
|
||||
@NonNls String name = method.getName();
|
||||
int ret = name.startsWith("annotateBase") ? 0 // yes, annotate all
|
||||
: name.startsWith("dontAnnotateBase") ? 1 // do not annotate base
|
||||
: 2; //abort
|
||||
myMustBeAvailableAfterInvoke = ret == 2;
|
||||
return ret;
|
||||
protected AnnotateMethodFix createAnnotateMethodFix(String defaultNotNull, String[] annotationsToRemove) {
|
||||
return new AnnotateMethodFix(defaultNotNull, annotationsToRemove){
|
||||
@Override
|
||||
public int annotateBaseMethod(final PsiMethod method, final PsiMethod superMethod, final Project project) {
|
||||
@NonNls String name = method.getName();
|
||||
int ret = name.startsWith("annotateBase") ? 0 // yes, annotate all
|
||||
: name.startsWith("dontAnnotateBase") ? 1 // do not annotate base
|
||||
: 2; //abort
|
||||
myMustBeAvailableAfterInvoke = ret == 2;
|
||||
return ret;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
}};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user