// resultExpression might be null, which behaves correctly here.
if (!(resultExpression instanceof JFieldRef)) {
return true;
}
JFieldRef fieldRefResult = (JFieldRef) resultExpression;
JField fieldResult = fieldRefResult.getField();
if (!fieldResult.isStatic()) {
// A nonstatic field reference won't trigger the clinit we need.
return true;
}
if (fieldResult.getEnclosingType() != targetEnclosingType) {
// We have a static field reference, but it's to the wrong class (not
// the class whose clinit we must trigger).
return true;
}
// The correct cross-class static field reference will trigger the clinit.