il.append(InstructionFactory.createReturn(Type.INT)); mg.addExceptionHandler(ih1_start, ih1_end, ih1_catch, new ObjectType(EndExceptionClass.getName())); mg.addExceptionHandler(ih_reb, ih2_end, ih2_catch, new ObjectType(EndExceptionClass.getName()));
method.addExceptionHandler(ih_rollback, ih_tryEnd, catchHandler, new ObjectType("java.lang.Throwable")); method.addExceptionHandler(ihe1, ihe2, ihe3, new ObjectType("java.lang.Throwable")); il.append(InstructionFactory.createLoad(Type.OBJECT, variableIndex)); injectCommonExceptionCatchBlock(il, method, variableIndex); method.addExceptionHandler(ih_commit, ih_return, catchHandler, new ObjectType("java.lang.Throwable"));
invokeMethod.addExceptionHandler(beginTryBlock, endTryBlock, exceptionHandlerCode, new ObjectType("java.lang.Throwable"));
invokeMethod.addExceptionHandler(beginTryBlock, endTryBlock, exceptionHandlerCode, new ObjectType("java.lang.Throwable"));
/** * Creates a method class$(String) which is used * during SomeClass.class instruction * * @param generatedClassName the instance class name */ protected void createHelperMethodForDotClassCalls(String generatedClassName) { InstructionList il = new InstructionList(); MethodGen method = new MethodGen(Constants.ACC_STATIC, new ObjectType("java.lang.Class"), new Type[]{Type.STRING}, new String[]{"arg0"}, "class$", generatedClassName, il, constantsPool); InstructionHandle ih0 = il.append(InstructionFactory.createLoad(Type.OBJECT, 0)); il.append(factory.createInvoke("java.lang.Class", "forName", new ObjectType("java.lang.Class"), new Type[]{Type.STRING}, Constants.INVOKESTATIC)); InstructionHandle ih4 = il.append(InstructionFactory.createReturn(Type.OBJECT)); InstructionHandle ih5 = il.append(InstructionFactory.createStore(Type.OBJECT, 1)); il.append(factory.createNew("java.lang.NoClassDefFoundError")); il.append(InstructionConstants.DUP); il.append(InstructionFactory.createLoad(Type.OBJECT, 1)); il.append(factory.createInvoke("java.lang.Throwable", "getMessage", Type.STRING, Type.NO_ARGS, Constants.INVOKEVIRTUAL)); il.append(factory.createInvoke("java.lang.NoClassDefFoundError", "<init>", Type.VOID, new Type[]{Type.STRING}, Constants.INVOKESPECIAL)); il.append(InstructionConstants.ATHROW); method.addExceptionHandler(ih0, ih4, ih5, new ObjectType("java.lang.ClassNotFoundException")); method.setMaxStack(); method.setMaxLocals(); classGen.addMethod(method.getMethod()); il.dispose(); }
handle_runtime_exception = false; mg.addExceptionHandler(tryStart, tryEnd, rethrowLocation, (ObjectType) translate(ex)); mg.addExceptionHandler(tryStart, tryEnd, rethrowLocation, new ObjectType("java.lang.RuntimeException")); mg.addExceptionHandler(tryStart, tryEnd, handlerStart, new ObjectType("java.lang.Throwable"));
mg.addExceptionHandler(try_start, try_end, handler, new ObjectType("java.io.IOException"));
addExceptionHandler(il.findHandle(ce.getStartPC()), end, il.findHandle(ce .getHandlerPC()), c_type);
addExceptionHandler(il.findHandle(ce.getStartPC()), end, il.findHandle(ce.getHandlerPC()), c_type);
var_ex.setStart(handler); var_ex.setEnd(il.append(InstructionConst.RETURN)); mg.addExceptionHandler(try_start, try_end, handler, new ObjectType( "java.io.IOException"));
var_ex.setStart(handler); var_ex.setEnd(il.append(InstructionConst.RETURN)); mg.addExceptionHandler(try_start, try_end, handler, new ObjectType( "java.io.IOException"));