@NotNull annotations in instruction classes

This commit is contained in:
Andrey Breslav
2013-11-29 20:30:42 +04:00
parent 3110edaca6
commit 0b575da5d3
14 changed files with 15 additions and 2 deletions
@@ -54,6 +54,7 @@ public abstract class AbstractJumpInstruction extends InstructionImpl {
return updateCopyInfo(createCopy(newLabel));
}
@NotNull
@Override
protected Instruction createCopy() {
return createCopy(targetLabel);
@@ -32,7 +32,7 @@ public interface Instruction {
@NotNull
Collection<Instruction> getNextInstructions();
void accept(InstructionVisitor visitor);
void accept(@NotNull InstructionVisitor visitor);
@NotNull
Collection<Instruction> getCopies();
@@ -71,6 +71,7 @@ public abstract class InstructionImpl implements Instruction {
return updateCopyInfo(createCopy());
}
@NotNull
protected abstract Instruction createCopy();
@NotNull
@@ -20,6 +20,7 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.psi.JetElement;
public abstract class JetElementInstructionImpl extends InstructionImpl implements JetElementInstruction {
@NotNull
protected final JetElement element;
public JetElementInstructionImpl(@NotNull JetElement element) {
@@ -35,6 +35,7 @@ public class LoadUnitValueInstruction extends InstructionWithNext {
return "read (Unit)";
}
@NotNull
@Override
protected Instruction createCopy() {
return new LoadUnitValueInstruction((JetExpression) element);
@@ -62,6 +62,7 @@ public class LocalFunctionDeclarationInstruction extends InstructionWithNext {
return "d" + "(" + element.getText() + ")";
}
@NotNull
@Override
protected Instruction createCopy() {
return new LocalFunctionDeclarationInstruction(element, body);
@@ -85,6 +85,7 @@ public class NondeterministicJumpInstruction extends InstructionImpl{
return sb.toString();
}
@NotNull
@Override
protected Instruction createCopy() {
return createCopy(getTargetLabels());
@@ -35,6 +35,7 @@ public class ReadValueInstruction extends InstructionWithNext {
return "r(" + element.getText() + ")";
}
@NotNull
@Override
protected Instruction createCopy() {
return new ReadValueInstruction(element);
@@ -41,6 +41,7 @@ public class SubroutineEnterInstruction extends InstructionWithNext {
return "<START>";
}
@NotNull
@Override
protected Instruction createCopy() {
return new SubroutineEnterInstruction(subroutine);
@@ -57,6 +57,7 @@ public class SubroutineExitInstruction extends InstructionImpl {
return debugLabel;
}
@NotNull
@Override
protected Instruction createCopy() {
return new SubroutineExitInstruction(subroutine, debugLabel);
@@ -51,6 +51,7 @@ public class SubroutineSinkInstruction extends InstructionImpl {
return debugLabel;
}
@NotNull
@Override
protected Instruction createCopy() {
return new SubroutineSinkInstruction(subroutine, debugLabel);
@@ -35,6 +35,7 @@ public class UnsupportedElementInstruction extends InstructionWithNext {
return "unsupported(" + element + " : " + element.getText() + ")";
}
@NotNull
@Override
protected Instruction createCopy() {
return new UnsupportedElementInstruction(element);
@@ -45,6 +45,7 @@ public class VariableDeclarationInstruction extends InstructionWithNext {
return "v(" + element.getText() + ")";
}
@NotNull
@Override
protected Instruction createCopy() {
if (element instanceof JetParameter) {
@@ -35,7 +35,7 @@ public class WriteValueInstruction extends InstructionWithNext {
}
@Override
public void accept(InstructionVisitor visitor) {
public void accept(@NotNull InstructionVisitor visitor) {
visitor.visitWriteValue(this);
}
@@ -48,6 +48,7 @@ public class WriteValueInstruction extends InstructionWithNext {
return "w(" + lValue.getText() + ")";
}
@NotNull
@Override
protected Instruction createCopy() {
return new WriteValueInstruction(element, lValue);