Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=49883
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Sun, 5 Sep 2010 20:43:38 +0000 (20:43 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Sun, 5 Sep 2010 20:43:38 +0000 (20:43 +0000)
Return a name for use in log messages rather than throwing an UnsupportedOperationException

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@992891 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/realm/CombinedRealm.java
webapps/docs/changelog.xml

index 07426f8..95dec00 100644 (file)
@@ -48,6 +48,10 @@ public class CombinedRealm extends RealmBase {
      */
     protected List<Realm> realms = new LinkedList<Realm>();
 
+    /**
+     * Descriptive information about this Realm implementation.
+     */
+    protected static final String name = "CombinedRealm";
 
     /**
      * Add a realm to the list of realms that will be used to authenticate
@@ -263,13 +267,7 @@ public class CombinedRealm extends RealmBase {
 
     @Override
     protected String getName() {
-        // This method should never be called
-        // Stack trace will show where this was called from
-        UnsupportedOperationException uoe =
-            new UnsupportedOperationException(
-                    sm.getString("combinedRealm.getName"));
-        log.error(sm.getString("combinedRealm.unexpectedMethod"), uoe);
-        throw uoe;
+        return name;
     }
 
     @Override
index b906b88..fe3d64b 100644 (file)
         <bug>49876</bug>: Fix the generics warnings in the copied Apache Jakarta
         BCEL code. Based on a patch by Gábor. (markt) 
       </fix>
+      <fix>
+        <bug>49883</bug>: Ensure that the CombinedRealm returns a name for use
+        in log messages rather than throwing an
+        <code>UnsupportedOperationException</code>. (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Coyote">