mirror of https://github.com/apache/openjpa.git
Minor logging correction; flow control correction. 'svn merge -c 571599 ../../trunk'
git-svn-id: https://svn.apache.org/repos/asf/openjpa/branches/1.0.x@571608 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
f1c4c68d90
commit
8265bac2b2
|
@ -55,14 +55,15 @@ public class ClassRedefiner {
|
|||
/**
|
||||
* For each element in <code>classes</code>, this method will redefine
|
||||
* all the element's methods such that field accesses are intercepted
|
||||
* in-line.
|
||||
* in-line. If {@link #canRedefineClasses()} returns <code>false</code>,
|
||||
* this method is a no-op.
|
||||
*/
|
||||
public static void redefineClasses(OpenJPAConfiguration conf,
|
||||
final Map<Class,byte[]> classes) {
|
||||
Log log = conf.getLog(OpenJPAConfiguration.LOG_ENHANCE);
|
||||
if (classes == null || classes.size() == 0)
|
||||
if (classes == null || classes.size() == 0 || !canRedefineClasses())
|
||||
return;
|
||||
|
||||
Log log = conf.getLog(OpenJPAConfiguration.LOG_ENHANCE);
|
||||
Instrumentation inst = null;
|
||||
ClassFileTransformer t = null;
|
||||
try {
|
||||
|
|
|
@ -104,10 +104,10 @@ public class ManagedClassSubclasser {
|
|||
|
||||
boolean redefine = ClassRedefiner.canRedefineClasses();
|
||||
if (redefine)
|
||||
log.info(_loc.get("enhance-and-subclass-no-redef-start",
|
||||
log.info(_loc.get("enhance-and-subclass-and-redef-start",
|
||||
classes));
|
||||
else
|
||||
log.info(_loc.get("enhance-and-subclass-and-redef-start",
|
||||
log.info(_loc.get("enhance-and-subclass-no-redef-start",
|
||||
classes));
|
||||
|
||||
final Map<Class, byte[]> map = new HashMap<Class, byte[]>();
|
||||
|
@ -139,12 +139,14 @@ public class ManagedClassSubclasser {
|
|||
unspecified = collectRelatedUnspecifiedTypes(enhancer.getMetaData(),
|
||||
classes, unspecified);
|
||||
|
||||
enhancer.run();
|
||||
try {
|
||||
enhancer.record();
|
||||
} catch (IOException e) {
|
||||
// our impl of BytecodeWriter doesn't throw IOException
|
||||
throw new InternalException(e);
|
||||
int runResult = enhancer.run();
|
||||
if (runResult == PCEnhancer.ENHANCE_PC) {
|
||||
try {
|
||||
enhancer.record();
|
||||
} catch (IOException e) {
|
||||
// our impl of BytecodeWriter doesn't throw IOException
|
||||
throw new InternalException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue