}
catch (SecurityException e) {
// ignore
}
catch (NoSuchMethodException e) {
collector.reportIssue(new Issue("LAZY_NO_DEFAULT_CONSTRUCTOR",Issue.NORMAL_PRIORITY, "lazy='true' set for '" + clazz.getEntityName() +"', but class has no default constructor." ));
return;
}
} else if(cglibEnabled || javassistEnabled){
Class[] interfaces = mappedClass.getInterfaces();
boolean cglib = false;
boolean javaassist = false;
for (int i = 0; i < interfaces.length; i++) {
Class intface = interfaces[i];
if(intface.getName().equals( "net.sf.cglib.transform.impl.InterceptFieldEnabled" )) {
cglib = true;
} else if(intface.getName().equals( "org.hibernate.bytecode.javassist.FieldHandled" )) {
javaassist = true;
}
}
if(cglibEnabled && !cglib) {
collector.reportIssue( new Issue("LAZY_NOT_INSTRUMENTED", Issue.HIGH_PRIORITY, "'" + clazz.getEntityName() + "' has lazy='false', but its class '" + mappedClass.getName() + "' has not been instrumented with cglib") );
return;
} else if (javassistEnabled && !javaassist) {
collector.reportIssue( new Issue("LAZY_NOT_INSTRUMENTED", Issue.HIGH_PRIORITY, "'" + clazz.getEntityName() + "' has lazy='false', but its class '" + mappedClass.getName() + "' has not been instrumented with javaassist") );
return;
} else {
// unknown bytecodeprovider...can't really check for that.
}