2 * Copyright 2000-2009 JetBrains s.r.o.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package com
.intellij
.codeInspection
.dataFlow
;
18 import com
.intellij
.codeInspection
.dataFlow
.instructions
.*;
23 public class DelegatingInstructionVisitor
extends InstructionVisitor
{
24 private final InstructionVisitor myDelegate
;
26 public DelegatingInstructionVisitor(InstructionVisitor delegate
) {
27 myDelegate
= delegate
;
28 }public DfaInstructionState
[] visitAssign(AssignInstruction instruction
, DataFlowRunner runner
, DfaMemoryState memState
) {
29 return myDelegate
.visitAssign(instruction
, runner
, memState
);
32 public DfaInstructionState
[] visitInstanceof(InstanceofInstruction instruction
, DataFlowRunner runner
, DfaMemoryState memState
) {
33 return myDelegate
.visitInstanceof(instruction
, runner
, memState
);
36 public DfaInstructionState
[] visitBinop(BinopInstruction instruction
, DataFlowRunner runner
, DfaMemoryState memState
) {
37 return myDelegate
.visitBinop(instruction
, runner
, memState
);
40 public DfaInstructionState
[] visitCheckReturnValue(CheckReturnValueInstruction instruction
,
41 DataFlowRunner runner
,
42 DfaMemoryState memState
) {
43 return myDelegate
.visitCheckReturnValue(instruction
, runner
, memState
);
46 public DfaInstructionState
[] visitConditionalGoto(ConditionalGotoInstruction instruction
, DataFlowRunner runner
, DfaMemoryState memState
) {
47 return myDelegate
.visitConditionalGoto(instruction
, runner
, memState
);
50 public DfaInstructionState
[] visitEmptyStack(EmptyStackInstruction instruction
, DataFlowRunner runner
, DfaMemoryState memState
) {
51 return myDelegate
.visitEmptyStack(instruction
, runner
, memState
);
54 public DfaInstructionState
[] visitFieldReference(FieldReferenceInstruction instruction
, DataFlowRunner runner
, DfaMemoryState memState
) {
55 return myDelegate
.visitFieldReference(instruction
, runner
, memState
);
58 public DfaInstructionState
[] visitFlushVariable(FlushVariableInstruction instruction
, DataFlowRunner runner
, DfaMemoryState memState
) {
59 return myDelegate
.visitFlushVariable(instruction
, runner
, memState
);
62 public DfaInstructionState
[] visitMethodCall(MethodCallInstruction instruction
, DataFlowRunner runner
, DfaMemoryState memState
) {
63 return myDelegate
.visitMethodCall(instruction
, runner
, memState
);
66 public DfaInstructionState
[] visitCast(MethodCallInstruction instruction
, DataFlowRunner runner
, DfaMemoryState memState
) {
67 return myDelegate
.visitCast(instruction
, runner
, memState
);
70 public DfaInstructionState
[] visitNot(NotInstruction instruction
, DataFlowRunner runner
, DfaMemoryState memState
) {
71 return myDelegate
.visitNot(instruction
, runner
, memState
);
74 public DfaInstructionState
[] visitPush(PushInstruction instruction
, DataFlowRunner runner
, DfaMemoryState memState
) {
75 return myDelegate
.visitPush(instruction
, runner
, memState
);
78 public DfaInstructionState
[] visitTypeCast(TypeCastInstruction instruction
, DataFlowRunner runner
, DfaMemoryState memState
) {
79 return myDelegate
.visitTypeCast(instruction
, runner
, memState
);