本文整理汇总了Java中edu.umd.cs.findbugs.ba.XFactory.createReferencedXMethod方法的典型用法代码示例。如果您正苦于以下问题:Java XFactory.createReferencedXMethod方法的具体用法?Java XFactory.createReferencedXMethod怎么用?Java XFactory.createReferencedXMethod使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类edu.umd.cs.findbugs.ba.XFactory
的用法示例。
在下文中一共展示了XFactory.createReferencedXMethod方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: pushByInvoke
import edu.umd.cs.findbugs.ba.XFactory; //导入方法依赖的package包/类
private void pushByInvoke(DismantleBytecode dbc, boolean popThis) {
String signature = dbc.getSigConstantOperand();
if (dbc.getNameConstantOperand().equals("<init>") && signature.endsWith(")V") && popThis) {
pop(PreorderVisitor.getNumberArguments(signature));
Item constructed = pop();
if (getStackDepth() > 0) {
Item next = getStackItem(0);
if (constructed.equals(next)) {
next.source = XFactory.createReferencedXMethod(dbc);
next.pc = dbc.getPC();
}
}
return;
}
pop(PreorderVisitor.getNumberArguments(signature) + (popThis ? 1 : 0));
pushBySignature(Type.getReturnType(signature).getSignature(), dbc);
}
示例2: pushByInvoke
import edu.umd.cs.findbugs.ba.XFactory; //导入方法依赖的package包/类
private void pushByInvoke(DismantleBytecode dbc, boolean popThis) {
String signature = dbc.getSigConstantOperand();
if (dbc.getNameConstantOperand().equals("<init>") && signature.endsWith(")V") && popThis) {
pop(PreorderVisitor.getNumberArguments(signature));
Item constructed = pop();
if (getStackDepth() > 0) {
Item next = getStackItem(0);
if (constructed.equals(next)) {
next = new Item(next);
next.source = XFactory.createReferencedXMethod(dbc);
next.pc = dbc.getPC();
replace(0, next);
}
}
return;
}
pop(PreorderVisitor.getNumberArguments(signature) + (popThis ? 1 : 0));
pushBySignature(Type.getReturnType(signature).getSignature(), dbc);
}
示例3: sawOpcode
import edu.umd.cs.findbugs.ba.XFactory; //导入方法依赖的package包/类
@Override
public void sawOpcode(int seen) {
if (DEBUG)
System.out.printf("%3d %10s %3s %s%n", getPC(), OPCODE_NAMES[seen], state, stack);
switch (seen) {
case Constants.IF_ICMPEQ:
case Constants.IF_ICMPNE:
OpcodeStack.Item left = stack.getStackItem(1);
OpcodeStack.Item right = stack.getStackItem(0);
if (badUseOfCompareResult(left, right))
bugAccumulator.accumulateBug(new BugInstance(this, "RV_CHECK_COMPARETO_FOR_SPECIFIC_RETURN_VALUE", NORMAL_PRIORITY)
.addClassAndMethod(this).addMethod(left.getReturnValueOf()).describe(MethodAnnotation.METHOD_CALLED).addValueSource(right, this), this);
else if (badUseOfCompareResult(right, left))
bugAccumulator.accumulateBug(new BugInstance(this, "RV_CHECK_COMPARETO_FOR_SPECIFIC_RETURN_VALUE", NORMAL_PRIORITY)
.addClassAndMethod(this).addMethod(right.getReturnValueOf()).describe(MethodAnnotation.METHOD_CALLED).addValueSource(left, this), this);
}
checkForInitWithoutCopyOnStack: if (seen == INVOKESPECIAL && getNameConstantOperand().equals("<init>")) {
int arguments = PreorderVisitor.getNumberArguments(getSigConstantOperand());
OpcodeStack.Item invokedOn = stack.getStackItem(arguments);
if (invokedOn.isNewlyAllocated() && (!getMethodName().equals("<init>") || invokedOn.getRegisterNumber() != 0)) {
for (int i = arguments + 1; i < stack.getStackDepth(); i++) {
OpcodeStack.Item item = stack.getStackItem(i);
if (item.isNewlyAllocated() && item.getSignature().equals(invokedOn.getSignature()))
break checkForInitWithoutCopyOnStack;
}
callSeen = XFactory.createReferencedXMethod(this);
callPC = getPC();
sawMethodCallWithIgnoredReturnValue();
state = SCAN;
previousOpcodeWasNEW = false;
return;
}
}
if (state == SAW_INVOKE && isPop(seen))
sawMethodCallWithIgnoredReturnValue();
else if (INVOKE_OPCODE_SET.get(seen)) {
callPC = getPC();
callSeen = XFactory.createReferencedXMethod(this);
state = SAW_INVOKE;
if (DEBUG)
System.out.println(" invoking " + callSeen);
} else
state = SCAN;
if (seen == NEW) {
previousOpcodeWasNEW = true;
} else {
if (seen == INVOKESPECIAL && previousOpcodeWasNEW) {
CheckReturnValueAnnotation annotation = checkReturnAnnotationDatabase.getResolvedAnnotation(callSeen, false);
if (annotation != null && annotation != CheckReturnValueAnnotation.CHECK_RETURN_VALUE_IGNORE) {
int priority = annotation.getPriority();
if (!checkReturnAnnotationDatabase.annotationIsDirect(callSeen)
&& !callSeen.getSignature().endsWith(callSeen.getClassName().replace('.', '/') + ";"))
priority++;
bugAccumulator.accumulateBug(new BugInstance(this, annotation.getPattern(), priority).addClassAndMethod(this)
.addCalledMethod(this), this);
}
}
previousOpcodeWasNEW = false;
}
}