mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
SideEffectVisitor: fixes after separation of FlushVariableInstruction and FlushFieldsInstruction
This commit is contained in:
+10
-6
@@ -1,10 +1,7 @@
|
||||
// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.codeInspection.dataFlow;
|
||||
|
||||
import com.intellij.codeInspection.dataFlow.instructions.AssignInstruction;
|
||||
import com.intellij.codeInspection.dataFlow.instructions.FlushVariableInstruction;
|
||||
import com.intellij.codeInspection.dataFlow.instructions.MethodCallInstruction;
|
||||
import com.intellij.codeInspection.dataFlow.instructions.ReturnInstruction;
|
||||
import com.intellij.codeInspection.dataFlow.instructions.*;
|
||||
import com.intellij.codeInspection.dataFlow.value.DfaValue;
|
||||
import com.intellij.codeInspection.dataFlow.value.DfaVariableValue;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -24,12 +21,19 @@ public class SideEffectVisitor extends StandardInstructionVisitor {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DfaInstructionState[] visitFlushFields(FlushFieldsInstruction instruction,
|
||||
DataFlowRunner runner,
|
||||
DfaMemoryState memState) {
|
||||
runner.cancel();
|
||||
return super.visitFlushFields(instruction, runner, memState);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DfaInstructionState[] visitFlushVariable(FlushVariableInstruction instruction,
|
||||
DataFlowRunner runner,
|
||||
DfaMemoryState memState) {
|
||||
final DfaVariableValue variable = instruction.getVariable();
|
||||
if (variable == null || !isModificationAllowed(variable)) {
|
||||
if (!isModificationAllowed(instruction.getVariable())) {
|
||||
runner.cancel();
|
||||
}
|
||||
return super.visitFlushVariable(instruction, runner, memState);
|
||||
|
||||
Reference in New Issue
Block a user