mirror of https://github.com/apache/openjpa.git
OPENJPA-1881. Creating a new "completion" trace message for the enhancement processing.
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1033480 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
324ca8e894
commit
5040a436e7
|
@ -113,14 +113,14 @@ public class PCClassFileTransformer
|
|||
if (className == null) {
|
||||
return null;
|
||||
}
|
||||
// prevent re-entrant calls, which can occur if the enhanceing
|
||||
// prevent re-entrant calls, which can occur if the enhancing
|
||||
// loader is used to also load OpenJPA libraries; this is to prevent
|
||||
// recursive enhancement attempts for internal openjpa libraries
|
||||
if (_transforming)
|
||||
return null;
|
||||
|
||||
_transforming = true;
|
||||
|
||||
|
||||
return transform0(className, redef, bytes);
|
||||
}
|
||||
|
||||
|
@ -131,7 +131,8 @@ public class PCClassFileTransformer
|
|||
*/
|
||||
private byte[] transform0(String className, Class redef, byte[] bytes)
|
||||
throws IllegalClassFormatException {
|
||||
|
||||
|
||||
byte[] returnBytes = null;
|
||||
try {
|
||||
Boolean enhance = needsEnhance(className, redef, bytes);
|
||||
if (enhance != null && _log.isTraceEnabled())
|
||||
|
@ -149,7 +150,8 @@ public class PCClassFileTransformer
|
|||
|
||||
if (enhancer.run() == PCEnhancer.ENHANCE_NONE)
|
||||
return null;
|
||||
return enhancer.getPCBytecode().toByteArray();
|
||||
returnBytes = enhancer.getPCBytecode().toByteArray();
|
||||
return returnBytes;
|
||||
} catch (Throwable t) {
|
||||
_log.warn(_loc.get("cft-exception-thrown", className), t);
|
||||
if (t instanceof RuntimeException)
|
||||
|
@ -159,6 +161,9 @@ public class PCClassFileTransformer
|
|||
throw new GeneralException(t);
|
||||
} finally {
|
||||
_transforming = false;
|
||||
if (returnBytes != null && _log.isTraceEnabled())
|
||||
_log.trace(_loc.get("runtime-enhance-complete", className,
|
||||
bytes.length, returnBytes.length));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@ bad-field: Missing field for property "{1}" in type "{0}".
|
|||
reflect-security: Unable to access "{0}" via reflection. Make sure OpenJPA \
|
||||
has the "suppressAccessChecks" permission.
|
||||
needs-runtime-enhance: "{0}" requires runtime enhancement: {1}
|
||||
runtime-enhance-complete: Enhancement for "{0}" completed. Class size: [{1}/{2}]
|
||||
runtime-enhance-pcclasses: You have enabled runtime enhancement, but have not \
|
||||
specified the set of persistent classes. OpenJPA must look for metadata \
|
||||
for every loaded class, which might increase class load times significantly.
|
||||
|
|
Loading…
Reference in New Issue