ConstPool constPool = getConstPool(); int pos = currentPos; int index = iterator.u16bitAt(pos + 1); CtClass[] params = new CtClass[] { cp.get(javaLangObject) }; CtClass retType = getType(); withinStatic()); int retVar = jc.recordReturnType(retType, true); jc.recordProceed(new ProceedForCast(index, retType)); checkResultValue(retType, statement); storeStack(params, true, paramVar, bytecode); jc.recordLocalVariables(ca, pos); bytecode.addLoad(retVar, retType); replace0(pos, bytecode, 3);
/** * Returns the <code>CtClass</code> object representing * the type specified by the cast. */ public CtClass getType() throws NotFoundException { ConstPool cp = getConstPool(); int pos = currentPos; int index = iterator.u16bitAt(pos + 1); String name = cp.getClassInfo(index); return thisClass.getClassPool().getCtClass(name); }
expr = new Cast(pos, iterator, clazz, minfo); edit((Cast)expr);
@Override public void edit(final Cast cast) { try { if (cast.getType().getName().equals(targetClass)) { cast.replace("if ($1 != null && $1 instanceof " + targetClass + ") {" + // " $_ = (" + targetClass + ") $1;" + // "} else {" + // " $_ = null;" + // "}"); } } catch (Exception e) { maybeThrow(new IllegalArgumentException( "Cannot handle cast to " + targetClass, e)); } } });
/** * Returns the <code>CtClass</code> object representing * the type specified by the cast. */ public CtClass getType() throws NotFoundException { ConstPool cp = getConstPool(); int pos = currentPos; int index = iterator.u16bitAt(pos + 1); String name = cp.getClassInfo(index); return thisClass.getClassPool().getCtClass(name); }
expr = new Cast(pos, iterator, clazz, minfo); edit((Cast)expr);
ConstPool constPool = getConstPool(); int pos = currentPos; int index = iterator.u16bitAt(pos + 1); CtClass[] params = new CtClass[] { cp.get(javaLangObject) }; CtClass retType = getType(); withinStatic()); int retVar = jc.recordReturnType(retType, true); jc.recordProceed(new ProceedForCast(index, retType)); checkResultValue(retType, statement); storeStack(params, true, paramVar, bytecode); jc.recordLocalVariables(ca, pos); bytecode.addLoad(retVar, retType); replace0(pos, bytecode, 3);
/** * Returns the <code>CtClass</code> object representing * the type specified by the cast. */ public CtClass getType() throws NotFoundException { ConstPool cp = getConstPool(); int pos = currentPos; int index = iterator.u16bitAt(pos + 1); String name = cp.getClassInfo(index); return thisClass.getClassPool().getCtClass(name); }
expr = new Cast(pos, iterator, clazz, minfo); edit((Cast)expr);
ConstPool constPool = getConstPool(); int pos = currentPos; int index = iterator.u16bitAt(pos + 1); CtClass[] params = new CtClass[] { cp.get(javaLangObject) }; CtClass retType = getType(); withinStatic()); int retVar = jc.recordReturnType(retType, true); jc.recordProceed(new ProceedForCast(index, retType)); checkResultValue(retType, statement); storeStack(params, true, paramVar, bytecode); jc.recordLocalVariables(ca, pos); bytecode.addLoad(retVar, retType); replace0(pos, bytecode, 3);
/** * Returns the <code>CtClass</code> object representing * the type specified by the cast. */ public CtClass getType() throws NotFoundException { ConstPool cp = getConstPool(); int pos = currentPos; int index = iterator.u16bitAt(pos + 1); String name = cp.getClassInfo(index); return thisClass.getClassPool().getCtClass(name); }
expr = new Cast(pos, iterator, clazz, minfo); edit((Cast)expr);
ConstPool constPool = getConstPool(); int pos = currentPos; int index = iterator.u16bitAt(pos + 1); CtClass[] params = new CtClass[] { cp.get(javaLangObject) }; CtClass retType = getType(); withinStatic()); int retVar = jc.recordReturnType(retType, true); jc.recordProceed(new ProceedForCast(index, retType)); checkResultValue(retType, statement); storeStack(params, true, paramVar, bytecode); jc.recordLocalVariables(ca, pos); bytecode.addLoad(retVar, retType); replace0(pos, bytecode, 3);
/** * Returns the <code>CtClass</code> object representing * the type specified by the cast. */ public CtClass getType() throws NotFoundException { ConstPool cp = getConstPool(); int pos = currentPos; int index = iterator.u16bitAt(pos + 1); String name = cp.getClassInfo(index); return Descriptor.toCtClass(name, thisClass.getClassPool()); }
expr = new Cast(pos, iterator, clazz, minfo); edit((Cast)expr);
ConstPool constPool = getConstPool(); int pos = currentPos; int index = iterator.u16bitAt(pos + 1); CtClass[] params = new CtClass[] { cp.get(javaLangObject) }; CtClass retType = getType(); withinStatic()); int retVar = jc.recordReturnType(retType, true); jc.recordProceed(new ProceedForCast(index, retType)); checkResultValue(retType, statement); storeStack(params, true, paramVar, bytecode); jc.recordLocalVariables(ca, pos); bytecode.addLoad(retVar, retType); replace0(pos, bytecode, 3);
/** * Returns the <code>CtClass</code> object representing * the type specified by the cast. */ public CtClass getType() throws NotFoundException { ConstPool cp = getConstPool(); int pos = currentPos; int index = iterator.u16bitAt(pos + 1); String name = cp.getClassInfo(index); return thisClass.getClassPool().getCtClass(name); }
expr = new Cast(pos, iterator, clazz, minfo); edit((Cast)expr);
ConstPool constPool = getConstPool(); int pos = currentPos; int index = iterator.u16bitAt(pos + 1); CtClass[] params = new CtClass[] { cp.get(javaLangObject) }; CtClass retType = getType(); withinStatic()); int retVar = jc.recordReturnType(retType, true); jc.recordProceed(new ProceedForCast(index, retType)); checkResultValue(retType, statement); storeStack(params, true, paramVar, bytecode); jc.recordLocalVariables(ca, pos); bytecode.addLoad(retVar, retType); replace0(pos, bytecode, 3);
/** * Returns the <code>CtClass</code> object representing * the type specified by the cast. */ public CtClass getType() throws NotFoundException { ConstPool cp = getConstPool(); int pos = currentPos; int index = iterator.u16bitAt(pos + 1); String name = cp.getClassInfo(index); return thisClass.getClassPool().getCtClass(name); }