/** * overrides the visitor to collect finally block info. * * @param obj * the code object to scan for finally blocks */ @Override public void visitCode(Code obj) { fbInfo.clear(); loadedReg = -1; CodeException[] exc = obj.getExceptionTable(); if (exc != null) { for (CodeException ce : exc) { if ((ce.getCatchType() == 0) && (ce.getStartPC() == ce.getHandlerPC())) { fbInfo.add(new FinallyBlockInfo(ce.getStartPC())); } } } if (!fbInfo.isEmpty()) { try { super.visitCode(obj); } catch (StopOpcodeParsingException e) { // no more finally blocks to check } } }
/** * overrides the visitor to collect finally block info. * * @param obj * the code object to scan for finally blocks */ @Override public void visitCode(Code obj) { fbInfo.clear(); loadedReg = -1; CodeException[] exc = obj.getExceptionTable(); if (exc != null) { for (CodeException ce : exc) { if ((ce.getCatchType() == 0) && (ce.getStartPC() == ce.getHandlerPC())) { fbInfo.add(new FinallyBlockInfo(ce.getStartPC())); } } } if (!fbInfo.isEmpty()) { try { super.visitCode(obj); } catch (StopOpcodeParsingException e) { // no more finally blocks to check } } }