private static boolean checkOperand(final OperandType operandType, final FieldReference field) { VerifyArgument.notNull(field, "field"); switch (operandType) { case FieldReference: return true; default: return false; } }
private InstructionPrinter(final ITextOutput output, final MethodDefinition method, final DecompilerSettings settings, final int[] lineNumbers) { _settings = settings; _output = VerifyArgument.notNull(output, "output"); _body = VerifyArgument.notNull(method, "method").getBody(); _lineNumbers = lineNumbers; }
@Override public final void addListener(final ITypeListener listener) { VerifyArgument.notNull(listener, "listener"); if (_listeners == EMPTY_LISTENERS) { _listeners = new ArrayList<>(); } _listeners.add(listener); }
public Block(final Iterable<Node> body) { this(); for (final Node node : VerifyArgument.notNull(body, "body")) { _body.add(node); } }
public static Instruction create(final OpCode opCode, final SwitchInfo switchInfo) { VerifyArgument.notNull(opCode, "opCode"); VerifyArgument.notNull(switchInfo, "switchInfo"); if (opCode.getOperandType() != OperandType.Switch) { throw new IllegalArgumentException(String.format("Invalid operand for OpCode %s.", opCode)); } return new Instruction(opCode, switchInfo); }
public static boolean matchLoadStoreAny( final Node node, final Iterable<Variable> expectedVariables, final StrongBox<Variable> targetVariable) { for (final Variable variable : VerifyArgument.notNull(expectedVariables, "expectedVariables")) { if (matchLoadStore(node, variable, targetVariable)) { return true; } } return false; }
@SafeVarargs public final <T extends AstNode> void insertChildrenAfter(final AstNode nextSibling, final Role<T> role, final T... children) { VerifyArgument.notNull(children, "children"); for (final T child : children) { insertChildAfter(nextSibling, child, role); } }
public static Instruction create(final OpCode opCode) { VerifyArgument.notNull(opCode, "opCode"); if (opCode.getOperandType() != OperandType.None) { throw new IllegalArgumentException(String.format("Invalid operand for OpCode %s.", opCode)); } return new Instruction(opCode); }
public static Instruction create(final OpCode opCode, final double value) { VerifyArgument.notNull(opCode, "opCode"); if (opCode.getOperandType() != OperandType.WideConstant) { throw new IllegalArgumentException(String.format("Invalid operand for OpCode %s.", opCode)); } return new Instruction(opCode, value); }
public final TypeDeclaration createType(final TypeDefinition type) { VerifyArgument.notNull(type, "type"); final Reference<TypeDeclaration> existingDeclaration = _typeDeclarations.get(type.getInternalName()); final TypeDeclaration d; if (existingDeclaration != null && (d = existingDeclaration.get()) != null) { return d; } return createTypeNoCache(type); }
public static Instruction create(final OpCode opCode, final int value) { VerifyArgument.notNull(opCode, "opCode"); if (!checkOperand(opCode.getOperandType(), value)) { throw new IllegalArgumentException(String.format("Invalid operand for OpCode %s.", opCode)); } return new Instruction(opCode, value); }
public static Instruction create(final OpCode opCode, final float value) { VerifyArgument.notNull(opCode, "opCode"); if (opCode.getOperandType() != OperandType.Constant && opCode.getOperandType() != OperandType.WideConstant) { throw new IllegalArgumentException(String.format("Invalid operand for OpCode %s.", opCode)); } return new Instruction(opCode, value); }
public static Instruction create(final OpCode opCode, final long value) { VerifyArgument.notNull(opCode, "opCode"); if (opCode.getOperandType() != OperandType.I8 && opCode.getOperandType() != OperandType.WideConstant) { throw new IllegalArgumentException(String.format("Invalid operand for OpCode %s.", opCode)); } return new Instruction(opCode, value); }
public NullReferenceExpression(final TextLocation startLocation) { super(MYSTERY_OFFSET); _startLocation = VerifyArgument.notNull(startLocation, "startLocation"); _endLocation = new TextLocation(startLocation.line(), startLocation.column() + NULL_TEXT.length()); }
public static Instruction create(final OpCode opCode, final TypeReference type, final int operand) { VerifyArgument.notNull(opCode, "opCode"); if (!checkOperand(opCode.getOperandType(), type) || !checkOperand(opCode.getOperandType(), operand)) { throw new IllegalArgumentException(String.format("Invalid operand for OpCode %s.", opCode)); } return new Instruction(opCode, type, operand); }