if (classStr.startsWith("java.") || classStr.startsWith("javax.")) {
return;
}
try {
Class<?> cls = Class.forName(classStr);
AppEngineInternal anno = getAppEngineInternalAnnotation(cls);
if (anno != null) {
String errorMsg = String.format("Class %s loaded from %s has a dependency on class %s "
+ "loaded from %s, which is not part of App Engine's supported API.", callingClassStr,
callingClassCodeSource, cls.getName(), cls.getProtectionDomain().getCodeSource());
if (!anno.message().isEmpty()) {
errorMsg += "\n" + anno.message();
}
if (violationIsError) {
throw new NoClassDefFoundError(errorMsg);
} else {
logger.warning(errorMsg + "\nYou are strongly discouraged "