From a7777cb075dc6b6dc58d25562e772346d3209a8a Mon Sep 17 00:00:00 2001 From: Patrick Linskey Date: Thu, 30 Aug 2007 18:38:33 +0000 Subject: [PATCH] OPENJPA-346 git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@571269 13f79535-47bb-0310-9956-ffa450edef68 --- .../openjpa/enhance/PCEnhancerAgent.java | 24 +++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/openjpa-kernel-5/src/main/java/org/apache/openjpa/enhance/PCEnhancerAgent.java b/openjpa-kernel-5/src/main/java/org/apache/openjpa/enhance/PCEnhancerAgent.java index 52b6418d4..9af0c0c5d 100644 --- a/openjpa-kernel-5/src/main/java/org/apache/openjpa/enhance/PCEnhancerAgent.java +++ b/openjpa-kernel-5/src/main/java/org/apache/openjpa/enhance/PCEnhancerAgent.java @@ -60,14 +60,24 @@ public class PCEnhancerAgent { public static void premain(String args, Instrumentation inst) { Options opts = Configurations.parseProperties(args); - if (opts.getBooleanProperty( - "ClassLoadEnhancement", "classLoadEnhancement", true)) - registerClassLoadEnhancer(inst, opts); - - // Deprecated property setting - if (opts.getBooleanProperty( - "RuntimeEnhancement", "runtimeEnhancement", true)) + if (opts.containsKey("ClassLoadEnhancement") || + opts.containsKey("classLoadEnhancement")) { + if (opts.getBooleanProperty( + "ClassLoadEnhancement", "classLoadEnhancement", true)) + registerClassLoadEnhancer(inst, opts); + } + else if (opts.containsKey("RuntimeEnhancement") || + opts.containsKey("runtimeEnhancement")) { + // Deprecated property setting + if (opts.getBooleanProperty( + "RuntimeEnhancement", "runtimeEnhancement", true)) + registerClassLoadEnhancer(inst, opts); + } else { + // if neither is set, then we should be turning it on. We need this + // logic instead of just a getBooleanProperty() because of the + // backwards-compat logic flow. registerClassLoadEnhancer(inst, opts); + } if (opts.getBooleanProperty( "RuntimeRedefinition", "runtimeRedefinition", true)) {