From 5b0cf2599f15aa8057dd15771fdec6b6fda15a2d Mon Sep 17 00:00:00 2001 From: Jeremy Bauer Date: Mon, 13 May 2013 02:41:06 +0000 Subject: [PATCH] Refrain from logging if verifying log factory plugin. git-svn-id: https://svn.apache.org/repos/asf/openjpa/branches/1.0.x@1481688 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/openjpa/lib/conf/ConfigurationImpl.java | 1 - .../main/java/org/apache/openjpa/lib/conf/PluginValue.java | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ConfigurationImpl.java b/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ConfigurationImpl.java index bbf651e8b..3fb79fac5 100644 --- a/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ConfigurationImpl.java +++ b/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ConfigurationImpl.java @@ -217,7 +217,6 @@ public class ConfigurationImpl } public void setLog(String log) { - assertNotReadOnly(); logFactoryPlugin.setString(log); } diff --git a/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/PluginValue.java b/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/PluginValue.java index 362072abd..e15740f51 100644 --- a/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/PluginValue.java +++ b/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/PluginValue.java @@ -20,6 +20,7 @@ package org.apache.openjpa.lib.conf; import org.apache.commons.lang.StringUtils; import org.apache.openjpa.lib.log.Log; +import org.apache.openjpa.lib.log.LogFactory; import org.apache.openjpa.lib.util.Localizer; import org.apache.openjpa.lib.util.ParseException; @@ -104,7 +105,8 @@ public class PluginValue extends ObjectValue { // ensure plugin value is compatible with plugin type if (obj != null && !type.isAssignableFrom(obj.getClass())) { - Log log = (conf == null) ? null : conf.getConfigurationLog(); + Log log = (conf == null || type.equals(LogFactory.class)) + ? null : conf.getConfigurationLog(); String msg = getIncompatiblePluginMessage(obj, type); if (log != null && log.isErrorEnabled()) { log.error(msg);