本文整理汇总了Java中edu.umd.cs.findbugs.bcel.OpcodeStackDetector类的典型用法代码示例。如果您正苦于以下问题:Java OpcodeStackDetector类的具体用法?Java OpcodeStackDetector怎么用?Java OpcodeStackDetector使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
OpcodeStackDetector类属于edu.umd.cs.findbugs.bcel包,在下文中一共展示了OpcodeStackDetector类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: resetForMethodEntry
import edu.umd.cs.findbugs.bcel.OpcodeStackDetector; //导入依赖的package包/类
public int resetForMethodEntry(final DismantleBytecode visitor) {
this.v = visitor;
initialize();
int result = resetForMethodEntry0(v);
Code code = v.getMethod().getCode();
if (code == null)
return result;
if (useIterativeAnalysis) {
JumpInfo jump = null;
if (visitor instanceof OpcodeStackDetector.WithCustomJumpInfo) {
jump = ((OpcodeStackDetector.WithCustomJumpInfo) visitor).customJumpInfo();
} else if ((visitor instanceof OpcodeStackDetector) && !((OpcodeStackDetector)visitor).isUsingCustomUserValue()) {
jump = getJumpInfo();
}
if (jump != null) {
learnFrom(jump);
}
}
return result;
}
示例2: fromCalledMethod
import edu.umd.cs.findbugs.bcel.OpcodeStackDetector; //导入依赖的package包/类
/**
* Factory method to create a MethodAnnotation from a method called by the
* instruction the given visitor is currently visiting.
*
* @param visitor
* the visitor
* @return the MethodAnnotation representing the called method
*/
public static MethodAnnotation fromCalledMethod(DismantleBytecode visitor) {
String className = visitor.getDottedClassConstantOperand();
String methodName = visitor.getNameConstantOperand();
String methodSig = visitor.getSigConstantOperand();
if (visitor instanceof OpcodeStackDetector && visitor.getOpcode() != Constants.INVOKESTATIC) {
int params = PreorderVisitor.getNumberArguments(methodSig);
OpcodeStackDetector oVisitor = (OpcodeStackDetector) visitor;
if (!oVisitor.getStack().isTop() && oVisitor.getStack().getStackDepth() > params) {
OpcodeStack.Item item = oVisitor.getStack().getStackItem(params);
String cName = ClassName.fromFieldSignature(item.getSignature());
if (cName != null)
className = cName;
}
}
return fromCalledMethod(className, methodName, methodSig, visitor.getOpcode() == Constants.INVOKESTATIC);
}
示例3: resetForMethodEntry
import edu.umd.cs.findbugs.bcel.OpcodeStackDetector; //导入依赖的package包/类
public int resetForMethodEntry(final DismantleBytecode visitor) {
this.v = visitor;
initialize();
int result = resetForMethodEntry0(v);
Code code = v.getMethod().getCode();
if (code == null)
return result;
JumpInfo jump = null;
if (useIterativeAnalysis) {
if (visitor instanceof OpcodeStackDetector.WithCustomJumpInfo) {
jump = ((OpcodeStackDetector.WithCustomJumpInfo) visitor).customJumpInfo();
} else if ((visitor instanceof OpcodeStackDetector) && !((OpcodeStackDetector)visitor).isUsingCustomUserValue()) {
jump = getJumpInfo();
} else {
jump = getJumpInfoFromStackMap();
}
} else {
jump = getJumpInfoFromStackMap();
}
learnFrom(jump);
return result;
}
示例4: matches
import edu.umd.cs.findbugs.bcel.OpcodeStackDetector; //导入依赖的package包/类
public boolean matches(OpcodeStackDetector opcodeStackDetector) {
if(classesNames.size() != 0 && !classesNames.contains(opcodeStackDetector.getClassConstantOperand().replace('/','.'))) {
return false;
}
if(methodNames.size() != 0 && !methodNames.contains(opcodeStackDetector.getNameConstantOperand())) {
return false;
}
if(argSignatures.size() != 0 && !argSignatures.contains(opcodeStackDetector.getSigConstantOperand())) {
return false;
}
return true;
}