boolean isStatic = x.getField().isStatic();
if (isStatic && instance != null) {
// this doesn't really belong here, but while we're here let's remove
// non-side-effect qualifiers to statics
if (!instance.hasSideEffects()) {
JFieldRef fieldRef = new JFieldRef(program, x.getSourceInfo(), null,
x.getField(), x.getEnclosingType());
ctx.replaceMe(fieldRef);
}
} else if (!isStatic && instance.getType() == typeNull) {
if (!instance.hasSideEffects()) {
instance = program.getLiteralNull();
}
JFieldRef fieldRef = new JFieldRef(program, x.getSourceInfo(),
instance, program.getNullField(), null);
ctx.replaceMe(fieldRef);
}
}