edited = true; ConstPool cp = getConstPool(); CodeAttribute ca = iterator.get(); Javac jv = new Javac(thisClass); CtClass type = getType(); int var = jv.recordVariable(type, EXCEPTION_NAME); jv.recordReturnType(type, false);
/** * Returns the type handled by the catch clause. * If this is a <code>finally</code> block, <code>null</code> is returned. */ public CtClass getType() throws NotFoundException { int type = etable.catchType(index); if (type == 0) return null; else { ConstPool cp = getConstPool(); String name = cp.getClassInfo(type); return thisClass.getClassPool().getCtClass(name); } }
@Override public void edit(final Handler handler) throws CannotCompileException { try { if (handler.getType().getName().equals(exceptionClassName)) { handler.insertBefore(src); markEdited(); } } catch (final Exception e) { e.printStackTrace(); } } }.instrument(method);
@Override public void edit(Handler handler) throws CannotCompileException { StringBuilder code = new StringBuilder(); try { code.append("if($1 instanceof play.mvc.results.Result || $1 instanceof play.Invoker.Suspend) throw $1;"); handler.insertBefore(code.toString()); } catch (NullPointerException e) { // TODO: finally clause ? // There are no $1 in finally statements in javassist } } });
/** * Returns the type handled by the catch clause. * If this is a <code>finally</code> block, <code>null</code> is returned. */ public CtClass getType() throws NotFoundException { int type = etable.catchType(index); if (type == 0) return null; ConstPool cp = getConstPool(); String name = cp.getClassInfo(type); return thisClass.getClassPool().getCtClass(name); }
@Override public void edit(final Handler handler) throws CannotCompileException { try { if (handler.getType().getName().equals(exceptionClassName)) { handler.insertBefore(src); markEdited(); } } catch (final Exception e) { e.printStackTrace(); } } }.instrument(method);
ConstPool cp = getConstPool(); CodeAttribute ca = iterator.get(); Javac jv = new Javac(thisClass); CtClass type = getType(); int var = jv.recordVariable(type, EXCEPTION_NAME); jv.recordReturnType(type, false);
/** * Returns the type handled by the catch clause. */ public CtClass getType() throws NotFoundException { ConstPool cp = getConstPool(); String name = cp.getClassInfo(etable.catchType(index)); return Descriptor.toCtClass(name, thisClass.getClassPool()); }
edited = true; ConstPool cp = getConstPool(); CodeAttribute ca = iterator.get(); Javac jv = new Javac(thisClass); CtClass type = getType(); int var = jv.recordVariable(type, EXCEPTION_NAME); jv.recordReturnType(type, false);
/** * Returns the type handled by the catch clause. * If this is a <code>finally</code> block, <code>null</code> is returned. */ public CtClass getType() throws NotFoundException { int type = etable.catchType(index); if (type == 0) return null; else { ConstPool cp = getConstPool(); String name = cp.getClassInfo(type); return thisClass.getClassPool().getCtClass(name); } }
edited = true; ConstPool cp = getConstPool(); CodeAttribute ca = iterator.get(); Javac jv = new Javac(thisClass); CtClass type = getType(); int var = jv.recordVariable(type, EXCEPTION_NAME); jv.recordReturnType(type, false);
/** * Returns the type handled by the catch clause. * If this is a <code>finally</code> block, <code>null</code> is returned. */ public CtClass getType() throws NotFoundException { int type = etable.catchType(index); if (type == 0) return null; else { ConstPool cp = getConstPool(); String name = cp.getClassInfo(type); return thisClass.getClassPool().getCtClass(name); } }
edited = true; ConstPool cp = getConstPool(); CodeAttribute ca = iterator.get(); Javac jv = new Javac(thisClass); CtClass type = getType(); int var = jv.recordVariable(type, EXCEPTION_NAME); jv.recordReturnType(type, false);
/** * Returns the type handled by the catch clause. * If this is a <code>finally</code> block, <code>null</code> is returned. */ public CtClass getType() throws NotFoundException { int type = etable.catchType(index); if (type == 0) return null; else { ConstPool cp = getConstPool(); String name = cp.getClassInfo(type); return thisClass.getClassPool().getCtClass(name); } }