@Override public void doBuild(InstructionBuilder builder) { builder.throwException(IllegalArgumentException.class, "Switch value not matched in case statement."); } });
@Override public void doBuild(InstructionBuilder builder) { builder.throwException(IllegalArgumentException.class, "Switch value not matched in case statement."); } });
public void doBuild(InstructionBuilder builder) { builder.throwException(RuntimeException.class, message); } });
private void indexOutOfRange(InstructionBuilder builder) { builder.throwException(IllegalArgumentException.class, "Parameter index out of range."); }
private void indexOutOfRange(InstructionBuilder builder) { builder.throwException(IllegalArgumentException.class, "Parameter index out of range."); }
@Override public void doBuild(InstructionBuilder builder) { String message = String.format("Method %s has no match in filter interface %s.", ms, filterInterface.getName()); logger.error(message); builder.throwException(RuntimeException.class, message); } });
@Override public void doBuild(InstructionBuilder builder) { String message = String.format("Method %s has no match in filter interface %s.", ms, filterInterface.getName()); logger.error(message); builder.throwException(RuntimeException.class, message); } });
private void addReturnValueSetter() { InstructionBuilder builder = newMethod("setReturnValue", MethodInvocation.class, Object.class); if (isVoid) { builder.throwException(IllegalArgumentException.class, String .format("Method %s of class %s is void, setting a return value is not allowed.", description, plasticClass.className)); } else { builder.loadThis().loadArgument(0); builder.castOrUnbox(description.returnType); builder.putField(invocationClassName, RETURN_VALUE, description.returnType); builder.loadThis().invoke(AbstractMethodInvocation.class, void.class, "clearCheckedException"); builder.loadThis().returnResult(); } }
private void addReturnValueSetter() { InstructionBuilder builder = newMethod("setReturnValue", MethodInvocation.class, Object.class); if (isVoid) { builder.throwException(IllegalArgumentException.class, String .format("Method %s of class %s is void, setting a return value is not allowed.", description, plasticClass.className)); } else { builder.loadThis().loadArgument(0); builder.castOrUnbox(description.returnType); builder.putField(invocationClassName, RETURN_VALUE, description.returnType); builder.loadThis().invoke(AbstractMethodInvocation.class, void.class, "clearCheckedException"); builder.loadThis().returnResult(); } }