public class ForceClose extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Thread.setDefaultUncaughtExceptionHandler(new ExceptionHandler(this)); setContentView(R.layout.main); } }
/** * Marks the current code location as the exception handler and adds the handler to the exception handler table; */ public void exceptionHandlerStart(ExceptionHandler handler) { if (handler.getEnd() == 0) { throw new InvalidBytecodeException( "handler end location must be initialised via exceptionHandlerEnd before calling exceptionHandlerAdd"); } handler.setHandler(currentOffset); exceptionTable.add(handler); mergeStackFrames(new StackFrame(new StackState(handler.getExceptionType(), constPool), handler.getFrame() .getLocalVariableState(), StackFrameType.FULL_FRAME)); }
stream.writeShort(exception.getStart()); stream.writeShort(exception.getEnd()); stream.writeShort(exception.getHandler()); stream.writeShort(exception.getExceptionIndex());
/** * Mark the end of an exception handler block. The last instruction that was written will be the last instruction covered by * the handler */ public void exceptionBlockEnd(ExceptionHandler handler) { handler.setEnd(currentOffset); }
/** * Marks the current code location as the exception handler and adds the handler to the exception handler table; */ public void exceptionHandlerStart(ExceptionHandler handler) { if (handler.getEnd() == 0) { throw new InvalidBytecodeException( "handler end location must be initialised via exceptionHandlerEnd before calling exceptionHandlerAdd"); } handler.setHandler(currentOffset); exceptionTable.add(handler); mergeStackFrames(new StackFrame(new StackState(handler.getExceptionType(), constPool), handler.getFrame() .getLocalVariableState(), StackFrameType.FULL_FRAME)); }
stream.writeShort(exception.getStart()); stream.writeShort(exception.getEnd()); stream.writeShort(exception.getHandler()); stream.writeShort(exception.getExceptionIndex());
/** * Mark the end of an exception handler block. The last instruction that was written will be the last instruction covered by * the handler */ public void exceptionBlockEnd(ExceptionHandler handler) { handler.setEnd(currentOffset); }
/** * Marks the current code location as the exception handler and adds the handler to the exception handler table; */ public void exceptionHandlerStart(ExceptionHandler handler) { if (handler.getEnd() == 0) { throw new InvalidBytecodeException( "handler end location must be initialised via exceptionHandlerEnd before calling exceptionHandlerAdd"); } handler.setHandler(currentOffset); exceptionTable.add(handler); mergeStackFrames(new StackFrame(new StackState(handler.getExceptionType(), constPool), handler.getFrame() .getLocalVariableState(), StackFrameType.FULL_FRAME)); }
stream.writeShort(exception.getStart()); stream.writeShort(exception.getEnd()); stream.writeShort(exception.getHandler()); stream.writeShort(exception.getExceptionIndex());
Thread.setDefaultUncaughtExceptionHandler(new ExceptionHandler(this));
/** * Mark the end of an exception handler block. The last instruction that was written will be the last instruction covered by * the handler */ public void exceptionBlockEnd(ExceptionHandler handler) { handler.setEnd(currentOffset); }
/** * Marks the current code location as the exception handler and adds the handler to the exception handler table; */ public void exceptionHandlerStart(ExceptionHandler handler) { if (handler.getEnd() == 0) { throw new InvalidBytecodeException( "handler end location must be initialised via exceptionHandlerEnd before calling exceptionHandlerAdd"); } handler.setHandler(currentOffset); exceptionTable.add(handler); mergeStackFrames(new StackFrame(new StackState(handler.getExceptionType(), constPool), handler.getFrame() .getLocalVariableState(), StackFrameType.FULL_FRAME)); }
stream.writeShort(exception.getStart()); stream.writeShort(exception.getEnd()); stream.writeShort(exception.getHandler()); stream.writeShort(exception.getExceptionIndex());
pipeline.addLast(outboundHandler2) // bottom .addLast(outboundHandler1) .addLast(inboundHandler2) .addLast(inboundHandler1) .addLast(new ExceptionHandler()); // top
/** * Mark the end of an exception handler block. The last instruction that was written will be the last instruction covered by * the handler */ public void exceptionBlockEnd(ExceptionHandler handler) { handler.setEnd(currentOffset); }
/** * Marks the current code location as the exception handler and adds the handler to the exception handler table; */ public void exceptionHandlerStart(ExceptionHandler handler) { if (handler.getEnd() == 0) { throw new InvalidBytecodeException( "handler end location must be initialised via exceptionHandlerEnd before calling exceptionHandlerAdd"); } handler.setHandler(currentOffset); exceptionTable.add(handler); mergeStackFrames(new StackFrame(new StackState(handler.getExceptionType(), constPool), handler.getFrame() .getLocalVariableState(), StackFrameType.FULL_FRAME)); }
stream.writeShort(exception.getStart()); stream.writeShort(exception.getEnd()); stream.writeShort(exception.getHandler()); stream.writeShort(exception.getExceptionIndex());
GWT.setUncaughtExceptionHandler(new ExceptionHandler());
/** * Mark the end of an exception handler block. The last instruction that was written will be the last instruction covered by * the handler */ public void exceptionBlockEnd(ExceptionHandler handler) { handler.setEnd(currentOffset); }
bindInterceptor(Matchers.any(), Matchers.annotatedWith(HandleExceptionSet.class), new ExceptionHandler());