本文整理匯總了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;
}
}