}
return true;
}
private JMethodCall createClinitCall(JMethodCall x) {
JDeclaredType targetType = x.getTarget().getEnclosingType().getClinitTarget();
if (!currentMethod.getEnclosingType().checkClinitTo(targetType)) {
// Access from this class to the target class won't trigger a clinit
return null;
}
if (program.isStaticImpl(x.getTarget()) &&
!program.typeOracle.isJavaScriptObject(x.getTarget().getEnclosingType())) {
// No clinit needed; target is really a non-jso instance method.
return null;
}
if (JProgram.isClinit(x.getTarget())) {
// This is a clinit call, doesn't need another clinit
return null;
}
JMethod clinit = targetType.getClinitMethod();
// If the clinit is a non-native, empty body we can optimize it out here
if (!clinit.isNative() && (((JMethodBody) clinit.getBody())).getStatements().size() == 0) {
return null;
}