@NotNull annotations in instruction classes
This commit is contained in:
+1
@@ -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
|
||||
|
||||
+1
@@ -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) {
|
||||
|
||||
+1
@@ -35,6 +35,7 @@ public class LoadUnitValueInstruction extends InstructionWithNext {
|
||||
return "read (Unit)";
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected Instruction createCopy() {
|
||||
return new LoadUnitValueInstruction((JetExpression) element);
|
||||
|
||||
+1
@@ -62,6 +62,7 @@ public class LocalFunctionDeclarationInstruction extends InstructionWithNext {
|
||||
return "d" + "(" + element.getText() + ")";
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected Instruction createCopy() {
|
||||
return new LocalFunctionDeclarationInstruction(element, body);
|
||||
|
||||
+1
@@ -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);
|
||||
|
||||
+1
@@ -41,6 +41,7 @@ public class SubroutineEnterInstruction extends InstructionWithNext {
|
||||
return "<START>";
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected Instruction createCopy() {
|
||||
return new SubroutineEnterInstruction(subroutine);
|
||||
|
||||
+1
@@ -57,6 +57,7 @@ public class SubroutineExitInstruction extends InstructionImpl {
|
||||
return debugLabel;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected Instruction createCopy() {
|
||||
return new SubroutineExitInstruction(subroutine, debugLabel);
|
||||
|
||||
+1
@@ -51,6 +51,7 @@ public class SubroutineSinkInstruction extends InstructionImpl {
|
||||
return debugLabel;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected Instruction createCopy() {
|
||||
return new SubroutineSinkInstruction(subroutine, debugLabel);
|
||||
|
||||
+1
@@ -35,6 +35,7 @@ public class UnsupportedElementInstruction extends InstructionWithNext {
|
||||
return "unsupported(" + element + " : " + element.getText() + ")";
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected Instruction createCopy() {
|
||||
return new UnsupportedElementInstruction(element);
|
||||
|
||||
+1
@@ -45,6 +45,7 @@ public class VariableDeclarationInstruction extends InstructionWithNext {
|
||||
return "v(" + element.getText() + ")";
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected Instruction createCopy() {
|
||||
if (element instanceof JetParameter) {
|
||||
|
||||
+2
-1
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user