mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
don't use inferred purity in "Result of method call ignored" inspection for now (IDEA-130584)
This commit is contained in:
@@ -271,6 +271,9 @@ ide.non.english.keyboard.layout.fix.description=Enables a fix for key codes with
|
||||
ide.dfa.getters.with.side.effects=java\\.nio\\..*ByteBuffer\\.get.*
|
||||
ide.dfa.getters.with.side.effects.description=A regex on qualified names of methods that look like getters but are not. For Constant Conditions & Exception inspection
|
||||
|
||||
ide.ignore.call.result.inspection.honor.inferred.pure=false
|
||||
ide.ignore.call.result.inspection.honor.inferred.pure.description=Whether inferred @Contract(pure=true) annotations should be taken into account in ''Result of method call ignored'' inspection
|
||||
|
||||
ide.enable.toolwindow.stack=false
|
||||
|
||||
change.signature.awesome.mode=true
|
||||
|
||||
+7
-2
@@ -19,6 +19,7 @@ import com.intellij.codeInsight.AnnotationUtil;
|
||||
import com.intellij.codeInspection.dataFlow.ControlFlowAnalyzer;
|
||||
import com.intellij.openapi.util.InvalidDataException;
|
||||
import com.intellij.openapi.util.WriteExternalException;
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.util.InheritanceUtil;
|
||||
import com.intellij.psi.util.PsiUtilCore;
|
||||
@@ -148,8 +149,12 @@ public class IgnoreResultOfCallInspectionBase extends BaseInspection {
|
||||
registerMethodCallError(call, aClass);
|
||||
return;
|
||||
}
|
||||
|
||||
if (ControlFlowAnalyzer.isPure(method)) {
|
||||
|
||||
PsiAnnotation anno = ControlFlowAnalyzer.findContractAnnotation(method);
|
||||
boolean honorInferred = Registry.is("ide.ignore.call.result.inspection.honor.inferred.pure");
|
||||
if (anno != null &&
|
||||
(honorInferred || !AnnotationUtil.isInferredAnnotation(anno)) &&
|
||||
Boolean.TRUE.equals(AnnotationUtil.getBooleanAttributeValue(anno, "pure"))) {
|
||||
registerMethodCallError(call, aClass);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user