update encode throw signature

This commit is contained in:
Kevin Ramharak 2019-01-22 19:20:07 +01:00
parent 1157bd5df5
commit d2e7084354

View File

@ -1,6 +1,6 @@
package net.simon987.server.assembly; package net.simon987.server.assembly;
import net.simon987.server.assembly.exception.AssemblyException;
import net.simon987.server.assembly.exception.IllegalOperandException; import net.simon987.server.assembly.exception.IllegalOperandException;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
@ -133,7 +133,7 @@ public abstract class Instruction {
* *
* @param out encoded bytes will be written here * @param out encoded bytes will be written here
*/ */
public void encode(ByteArrayOutputStream out, int currentLine) throws IllegalOperandException { public void encode(ByteArrayOutputStream out, int currentLine) throws AssemblyException {
if (!noOperandsValid()) { if (!noOperandsValid()) {
throw new IllegalOperandException("This instruction must have operand(s)!", currentLine); throw new IllegalOperandException("This instruction must have operand(s)!", currentLine);
@ -148,7 +148,7 @@ public abstract class Instruction {
} }
public void encode(ByteArrayOutputStream out, Operand o1, Operand o2, int currentLine) public void encode(ByteArrayOutputStream out, Operand o1, Operand o2, int currentLine)
throws IllegalOperandException { throws AssemblyException {
MachineCode code = new MachineCode(); MachineCode code = new MachineCode();
code.writeOpcode(opCode); code.writeOpcode(opCode);
@ -183,7 +183,7 @@ public abstract class Instruction {
} }
public void encode(ByteArrayOutputStream out, Operand o1, int currentLine) public void encode(ByteArrayOutputStream out, Operand o1, int currentLine)
throws IllegalOperandException { throws AssemblyException {
MachineCode code = new MachineCode(); MachineCode code = new MachineCode();
code.writeOpcode(opCode); code.writeOpcode(opCode);