Author: markt
Date: Tue Jun  4 12:19:29 2013
New Revision: 1489405

URL: http://svn.apache.org/r1489405
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=55052
Fall back to un-prefixed property if a prefixed one is not present

Modified:
    tomcat/trunk/java/org/apache/juli/ClassLoaderLogManager.java

Modified: tomcat/trunk/java/org/apache/juli/ClassLoaderLogManager.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/juli/ClassLoaderLogManager.java?rev=1489405&r1=1489404&r2=1489405&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/juli/ClassLoaderLogManager.java (original)
+++ tomcat/trunk/java/org/apache/juli/ClassLoaderLogManager.java Tue Jun  4 
12:19:29 2013
@@ -244,12 +244,31 @@ public class ClassLoaderLogManager exten
      */
     @Override
     public String getProperty(String name) {
-        ClassLoader classLoader = Thread.currentThread()
-            .getContextClassLoader();
         String prefix = this.prefix.get();
+        String result = null;
+
+        // If a prefix is defined look for a prefixed property first
         if (prefix != null) {
-            name = prefix + name;
+            result = findProperty(prefix + name);
+        }
+
+        // If there is no prefix or no property match with the prefix try just
+        // the name
+        if (result == null) {
+            result = findProperty(name);
+        }
+
+        // Simple property replacement (mostly for folder names)
+        if (result != null) {
+            result = replace(result);
         }
+        return result;
+    }
+
+
+    private String findProperty(String name) {
+        ClassLoader classLoader = Thread.currentThread()
+                .getContextClassLoader();
         ClassLoaderLogInfo info = getClassLoaderInfo(classLoader);
         String result = info.props.getProperty(name);
         // If the property was not found, and the current classloader had no
@@ -271,14 +290,9 @@ public class ClassLoaderLogManager exten
                 result = super.getProperty(name);
             }
         }
-        // Simple property replacement (mostly for folder names)
-        if (result != null) {
-            result = replace(result);
-        }
         return result;
     }
 
-
     @Override
     public void readConfiguration()
         throws IOException, SecurityException {



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to