Fix a multitude of format related issues with immutable instructions

This commit is contained in:
Ben Gruver 2012-10-23 22:50:45 -07:00
parent 0033480503
commit e2f2c89ddc
10 changed files with 10 additions and 10 deletions

View File

@ -39,7 +39,7 @@ import org.jf.dexlib2.util.Preconditions;
import javax.annotation.Nonnull;
public class ImmutableInstruction10t extends ImmutableInstruction implements Instruction10t {
public static final Format FORMAT = Format.Format12x;
public static final Format FORMAT = Format.Format10t;
public final int codeOffset;

View File

@ -39,7 +39,7 @@ import org.jf.dexlib2.util.Preconditions;
import javax.annotation.Nonnull;
public class ImmutableInstruction20t extends ImmutableInstruction implements Instruction20t {
public static final Format FORMAT = Format.Format12x;
public static final Format FORMAT = Format.Format20t;
public final int codeOffset;

View File

@ -50,7 +50,7 @@ public class ImmutableInstruction22b extends ImmutableInstruction implements Ins
int registerB,
int literal) {
super(opcode);
Preconditions.checkFormat(opcode, Format.Format35c);
Preconditions.checkFormat(opcode, FORMAT);
this.registerA = Preconditions.checkByteRegister(registerA);
this.registerB = Preconditions.checkByteRegister(registerB);
this.literal = Preconditions.checkByteLiteral(literal);

View File

@ -50,7 +50,7 @@ public class ImmutableInstruction22s extends ImmutableInstruction implements Ins
int registerB,
int literal) {
super(opcode);
Preconditions.checkFormat(opcode, Format.Format35c);
Preconditions.checkFormat(opcode, FORMAT);
this.registerA = Preconditions.checkNibbleRegister(registerA);
this.registerB = Preconditions.checkNibbleRegister(registerB);
this.literal = Preconditions.checkShortLiteral(literal);

View File

@ -50,7 +50,7 @@ public class ImmutableInstruction22t extends ImmutableInstruction implements Ins
int registerB,
int codeOffset) {
super(opcode);
Preconditions.checkFormat(opcode, Format.Format35c);
Preconditions.checkFormat(opcode, FORMAT);
this.registerA = Preconditions.checkNibbleRegister(registerA);
this.registerB = Preconditions.checkNibbleRegister(registerB);
this.codeOffset = Preconditions.checkShortCodeOffset(codeOffset);

View File

@ -48,7 +48,7 @@ public class ImmutableInstruction22x extends ImmutableInstruction implements Ins
int registerA,
int registerB) {
super(opcode);
Preconditions.checkFormat(opcode, Format.Format35c);
Preconditions.checkFormat(opcode, FORMAT);
this.registerA = Preconditions.checkByteRegister(registerA);
this.registerB = Preconditions.checkShortRegister(registerB);
}

View File

@ -50,7 +50,7 @@ public class ImmutableInstruction23x extends ImmutableInstruction implements Ins
int registerB,
int registerC) {
super(opcode);
Preconditions.checkFormat(opcode, Format.Format35c);
Preconditions.checkFormat(opcode, FORMAT);
this.registerA = Preconditions.checkByteRegister(registerA);
this.registerB = Preconditions.checkByteRegister(registerB);
this.registerC = Preconditions.checkByteRegister(registerC);

View File

@ -39,7 +39,7 @@ import org.jf.dexlib2.util.Preconditions;
import javax.annotation.Nonnull;
public class ImmutableInstruction30t extends ImmutableInstruction implements Instruction30t {
public static final Format FORMAT = Format.Format12x;
public static final Format FORMAT = Format.Format30t;
public final int codeOffset;

View File

@ -48,7 +48,7 @@ public class ImmutableInstruction32x extends ImmutableInstruction implements Ins
int registerA,
int registerB) {
super(opcode);
Preconditions.checkFormat(opcode, Format.Format35c);
Preconditions.checkFormat(opcode, FORMAT);
this.registerA = Preconditions.checkShortRegister(registerA);
this.registerB = Preconditions.checkShortRegister(registerB);
}

View File

@ -58,7 +58,7 @@ public class ImmutableInstruction35c extends ImmutableInstruction implements Ins
int registerG,
@Nonnull String reference) {
super(opcode);
Preconditions.checkFormat(opcode, Format.Format35c);
Preconditions.checkFormat(opcode, FORMAT);
this.registerCount = Preconditions.check35cRegisterCount(registerCount);
this.registerC = (registerCount>0) ? Preconditions.checkNibbleRegister(registerC) : 0;
this.registerD = (registerCount>1) ? Preconditions.checkNibbleRegister(registerD) : 0;