/** * Add an exception handler to this code block. * * @param tryStart the first instruction of the try {} block * @param tryEnd the last instruction of the try {} block * @param handlerStart the first instruction of the catch {} block * @param catchType the type of exception being caught */ public ExceptionHandler addExceptionHandler(Instruction tryStart, Instruction tryEnd, Instruction handlerStart, Class catchType) { String catchName = null; if (catchType != null) catchName = catchType.getName(); return addExceptionHandler(tryStart, tryEnd, handlerStart, catchName); }
/** * Add an exception handler to this code block. * * @param tryStart the first instruction of the try {} block * @param tryEnd the last instruction of the try {} block * @param handlerStart the first instruction of the catch {} block * @param catchType the type of exception being caught */ public ExceptionHandler addExceptionHandler(Instruction tryStart, Instruction tryEnd, Instruction handlerStart, Class catchType) { String catchName = null; if (catchType != null) catchName = catchType.getName(); return addExceptionHandler(tryStart, tryEnd, handlerStart, catchName); }
/** * Set the exception handlers for this code block. This method is useful * for importing all handlers from another code block. Set to null or * empty array if none. */ public void setExceptionHandlers(ExceptionHandler[] handlers) { clearExceptionHandlers(); if (handlers != null) for (int i = 0; i < handlers.length; i++) addExceptionHandler(handlers[i]); }
/** * Set the exception handlers for this code block. This method is useful * for importing all handlers from another code block. Set to null or * empty array if none. */ public void setExceptionHandlers(ExceptionHandler[] handlers) { clearExceptionHandlers(); if (handlers != null) for (int i = 0; i < handlers.length; i++) addExceptionHandler(handlers[i]); }
/** * Import the given exception handler from another code block. */ public ExceptionHandler addExceptionHandler(ExceptionHandler handler) { ExceptionHandler newHandler = addExceptionHandler(); newHandler.read(handler); return newHandler; }
/** * Import the given exception handler from another code block. */ public ExceptionHandler addExceptionHandler(ExceptionHandler handler) { ExceptionHandler newHandler = addExceptionHandler(); newHandler.read(handler); return newHandler; }
/** * Add an exception handler to this code block. * * @param tryStart the first instruction of the try {} block * @param tryEnd the last instruction of the try {} block * @param handlerStart the first instruction of the catch {} block * @param catchType the type of exception being caught */ public ExceptionHandler addExceptionHandler(Instruction tryStart, Instruction tryEnd, Instruction handlerStart, BCClass catchType) { String catchName = null; if (catchType != null) catchName = catchType.getName(); return addExceptionHandler(tryStart, tryEnd, handlerStart, catchName); }
/** * Add an exception handler to this code block. * * @param tryStart the first instruction of the try {} block * @param tryEnd the last instruction of the try {} block * @param handlerStart the first instruction of the catch {} block * @param catchType the type of exception being caught */ public ExceptionHandler addExceptionHandler(Instruction tryStart, Instruction tryEnd, Instruction handlerStart, BCClass catchType) { String catchName = null; if (catchType != null) catchName = catchType.getName(); return addExceptionHandler(tryStart, tryEnd, handlerStart, catchName); }
/** * Add an exception handler to this code block. * * @param tryStart the first instruction of the try {} block * @param tryEnd the last instruction of the try {} block * @param handlerStart the first instruction of the catch {} block * @param catchType the type of exception being caught */ public ExceptionHandler addExceptionHandler(Instruction tryStart, Instruction tryEnd, Instruction handlerStart, String catchType) { ExceptionHandler handler = addExceptionHandler(); handler.setTryStart(tryStart); handler.setTryEnd(tryEnd); handler.setHandlerStart(handlerStart); handler.setCatch(catchType); return handler; }
/** * Add an exception handler to this code block. * * @param tryStart the first instruction of the try {} block * @param tryEnd the last instruction of the try {} block * @param handlerStart the first instruction of the catch {} block * @param catchType the type of exception being caught */ public ExceptionHandler addExceptionHandler(Instruction tryStart, Instruction tryEnd, Instruction handlerStart, String catchType) { ExceptionHandler handler = addExceptionHandler(); handler.setTryStart(tryStart); handler.setTryEnd(tryEnd); handler.setHandlerStart(handlerStart); handler.setCatch(catchType); return handler; }
void read(DataInput in, int length) throws IOException { _maxStack = in.readUnsignedShort(); _maxLocals = in.readUnsignedShort(); readCode(in, in.readInt()); _handlers.clear(); int exceptionCount = in.readUnsignedShort(); ExceptionHandler excep; for (int i = 0; i < exceptionCount; i++) { excep = addExceptionHandler(); excep.read(in); excep.updateTargets(); } readAttributes(in); // setup local variable markers LocalVariableTable locals = getLocalVariableTable(false); if (locals != null) locals.updateTargets(); // setup local variable markers LocalVariableTypeTable localTypes = getLocalVariableTypeTable(false); if (localTypes != null) localTypes.updateTargets(); // setup line number markers LineNumberTable lines = getLineNumberTable(false); if (lines != null) lines.updateTargets(); }
void read(DataInput in, int length) throws IOException { _maxStack = in.readUnsignedShort(); _maxLocals = in.readUnsignedShort(); readCode(in, in.readInt()); _handlers.clear(); int exceptionCount = in.readUnsignedShort(); ExceptionHandler excep; for (int i = 0; i < exceptionCount; i++) { excep = addExceptionHandler(); excep.read(in); excep.updateTargets(); } readAttributes(in); // setup local variable markers LocalVariableTable locals = getLocalVariableTable(false); if (locals != null) locals.updateTargets(); // setup local variable markers LocalVariableTypeTable localTypes = getLocalVariableTypeTable(false); if (localTypes != null) localTypes.updateTargets(); // setup line number markers LineNumberTable lines = getLineNumberTable(false); if (lines != null) lines.updateTargets(); }
ExceptionHandler handler = code.addExceptionHandler();
ExceptionHandler handler = code.addExceptionHandler();
ExceptionHandler handler = code.addExceptionHandler();
ExceptionHandler handler = code.addExceptionHandler();
ExceptionHandler handler = code.addExceptionHandler();
ExceptionHandler handler; for (int i = 0; i < origHandlers.length; i++) { handler = addExceptionHandler(); handler.read(origHandlers[i]); handler.updateTargets();
void.class, _params); code.athrow(); code.addExceptionHandler(tryStart, tryEnd, handlerStart, ClassNotFoundException.class); return method;
void.class, _params); code.athrow(); code.addExceptionHandler(tryStart, tryEnd, handlerStart, ClassNotFoundException.class); return method;