mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
lambda: do not try to annotate super method with Nullable from lambda body (IDEA-120205) annotation for super methods was removed by cdr
This commit is contained in:
+10
-6
@@ -506,12 +506,16 @@ public class DataFlowInspectionBase extends BaseJavaBatchLocalInspectionTool {
|
||||
final String text = isNullLiteralExpression(expr)
|
||||
? InspectionsBundle.message("dataflow.message.return.null.from.notnullable", presentableNullable)
|
||||
: InspectionsBundle.message("dataflow.message.return.nullable.from.notnullable", presentableNullable);
|
||||
holder.registerProblem(expr, text, new AnnotateMethodFix(defaultNullable, ArrayUtil.toStringArray(manager.getNotNulls())){
|
||||
@Override
|
||||
public int shouldAnnotateBaseMethod(PsiMethod method, PsiMethod superMethod, Project project) {
|
||||
return 1;
|
||||
}
|
||||
});
|
||||
final LocalQuickFix[] fixes =
|
||||
PsiTreeUtil.skipParentsOfType(expr, PsiCodeBlock.class, PsiReturnStatement.class) instanceof PsiLambdaExpression
|
||||
? LocalQuickFix.EMPTY_ARRAY
|
||||
: new LocalQuickFix[]{ new AnnotateMethodFix(defaultNullable, ArrayUtil.toStringArray(manager.getNotNulls())) {
|
||||
@Override
|
||||
public int shouldAnnotateBaseMethod(PsiMethod method, PsiMethod superMethod, Project project) {
|
||||
return 1;
|
||||
}
|
||||
}};
|
||||
holder.registerProblem(expr, text, fixes);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user