LineNumberTable lineNumbers = method.getLineNumberTable();
for (Iterator<Location> i = cfg.locationIterator(); i.hasNext();) {
Location location = i.next();
InstructionHandle handle = location.getHandle();
Instruction ins = handle.getInstruction();
if (!(ins instanceof ALOAD)) {
continue;
}
IsNullValueFrame frame = nullValueDataflow.getFactAtLocation(location);
if (!frame.isValid()) {
// This basic block is probably dead
continue;
}
// System.out.println(handle.getPosition() + "\t" +
// ins.getName() + "\t" + frame);
ALOAD load = (ALOAD) ins;
int index = load.getIndex();
IsNullValue v = frame.getValue(index);
if (!v.isDefinitelyNull()) {
int sourceLine = lineNumbers.getSourceLine(handle.getPosition());
if (sourceLine > 0) {
linesWithLoadsOfNotDefinitelyNullValues.set(sourceLine);
}
}
}
}
IdentityHashMap<InstructionHandle, Object> sometimesGood = new IdentityHashMap<InstructionHandle, Object>();
for (Iterator<Location> i = cfg.locationIterator(); i.hasNext();) {
Location location = i.next();
InstructionHandle handle = location.getHandle();
Instruction ins = handle.getInstruction();
if (!(ins instanceof ALOAD)) {
continue;
}
IsNullValueFrame frame = nullValueDataflow.getFactAtLocation(location);
if (!frame.isValid()) {
// This basic block is probably dead
continue;
}
// System.out.println(handle.getPosition() + "\t" + ins.getName() +
// "\t" + frame);
ALOAD load = (ALOAD) ins;
int index = load.getIndex();
IsNullValue v = frame.getValue(index);
if (!v.isDefinitelyNull()) {
sometimesGood.put(handle, null);
}
}
// System.out.println(nullValueDataflow);
for (Iterator<Location> i = cfg.locationIterator(); i.hasNext();) {
Location location = i.next();
InstructionHandle handle = location.getHandle();
Instruction ins = handle.getInstruction();
if (!(ins instanceof ALOAD)) {
continue;
}
if (sometimesGood.containsKey(handle)) {
continue;
}
IsNullValueFrame frame = nullValueDataflow.getFactAtLocation(location);
if (!frame.isValid()) {
// This basic block is probably dead
continue;
}
// System.out.println(handle.getPosition() + "\t" + ins.getName() +
// "\t" + frame);
ALOAD load = (ALOAD) ins;
int index = load.getIndex();
IsNullValue v = frame.getValue(index);
if (v.isDefinitelyNull()) {
InstructionHandle nextHandle = handle.getNext();
Instruction next = nextHandle.getInstruction();
int position = location
.getHandle().getPosition();
int catchSizeANY = Util.getSizeOfSurroundingTryBlock(method, "", position);
if (catchSizeANY < Integer.MAX_VALUE && isNullTestedClose( classContext, load, nextHandle, next)) {
continue;