本文整理汇总了Java中edu.umd.cs.findbugs.bcel.generic.NullnessConversationInstruction类的典型用法代码示例。如果您正苦于以下问题:Java NullnessConversationInstruction类的具体用法?Java NullnessConversationInstruction怎么用?Java NullnessConversationInstruction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NullnessConversationInstruction类属于edu.umd.cs.findbugs.bcel.generic包,在下文中一共展示了NullnessConversationInstruction类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: hasManyPreceedingNullTests
import edu.umd.cs.findbugs.bcel.generic.NullnessConversationInstruction; //导入依赖的package包/类
private boolean hasManyPreceedingNullTests(int pc) {
int ifNullTests = 0;
BitSet seen = new BitSet();
try {
for (Iterator<Location> i = classContext.getCFG(method).locationIterator(); i.hasNext();) {
Location loc = i.next();
int pc2 = loc.getHandle().getPosition();
if (pc2 >= pc || pc2 < pc - 30)
continue;
Instruction ins = loc.getHandle().getInstruction();
if ((ins instanceof IFNONNULL || ins instanceof IFNULL || ins instanceof NullnessConversationInstruction)
&& !seen.get(pc2)) {
ifNullTests++;
seen.set(pc2);
}
}
boolean result = ifNullTests > 2;
// System.out.println("Preceeding null tests " + ifNullTests + " " +
// ifNonnullTests + " " + result);
return result;
} catch (CFGBuilderException e) {
return false;
}
}