本文整理匯總了Java中scouter.javassist.bytecode.MethodInfo.nameInit方法的典型用法代碼示例。如果您正苦於以下問題:Java MethodInfo.nameInit方法的具體用法?Java MethodInfo.nameInit怎麽用?Java MethodInfo.nameInit使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類scouter.javassist.bytecode.MethodInfo
的用法示例。
在下文中一共展示了MethodInfo.nameInit方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: atCallExpr
import scouter.javassist.bytecode.MethodInfo; //導入方法依賴的package包/類
public void atCallExpr(CallExpr expr) throws CompileError {
String mname = null;
CtClass targetClass = null;
ASTree method = expr.oprand1();
ASTList args = (ASTList)expr.oprand2();
if (method instanceof Member) {
mname = ((Member)method).get();
targetClass = thisClass;
}
else if (method instanceof Keyword) { // constructor
mname = MethodInfo.nameInit; // <init>
if (((Keyword)method).get() == SUPER)
targetClass = MemberResolver.getSuperclass(thisClass);
else
targetClass = thisClass;
}
else if (method instanceof Expr) {
Expr e = (Expr)method;
mname = ((Symbol)e.oprand2()).get();
int op = e.getOperator();
if (op == MEMBER) // static method
targetClass
= resolver.lookupClass(((Symbol)e.oprand1()).get(),
false);
else if (op == '.') {
ASTree target = e.oprand1();
String classFollowedByDotSuper = isDotSuper(target);
if (classFollowedByDotSuper != null)
targetClass = MemberResolver.getSuperInterface(thisClass,
classFollowedByDotSuper);
else {
try {
target.accept(this);
}
catch (NoFieldException nfe) {
if (nfe.getExpr() != target)
throw nfe;
// it should be a static method.
exprType = CLASS;
arrayDim = 0;
className = nfe.getField(); // JVM-internal
e.setOperator(MEMBER);
e.setOprand1(new Symbol(MemberResolver.jvmToJavaName(
className)));
}
if (arrayDim > 0)
targetClass = resolver.lookupClass(javaLangObject, true);
else if (exprType == CLASS /* && arrayDim == 0 */)
targetClass = resolver.lookupClassByJvmName(className);
else
badMethod();
}
}
else
badMethod();
}
else
fatal();
MemberResolver.Method minfo
= atMethodCallCore(targetClass, mname, args);
expr.setMethod(minfo);
}