You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2014/03/14 10:40:15 UTC

svn commit: r1577465 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/tomcat/util/descriptor/DigesterFactory.java java/org/apache/tomcat/util/descriptor/LocalStrings.properties

Author: markt
Date: Fri Mar 14 09:40:15 2014
New Revision: 1577465

URL: http://svn.apache.org/r1577465
Log:
Review by kkolinko
Avoid adding nulls to the map
Log a warning for problems in addSelf() as well as add()

Modified:
    tomcat/tc7.0.x/trunk/   (props changed)
    tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/descriptor/DigesterFactory.java
    tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/descriptor/LocalStrings.properties

Propchange: tomcat/tc7.0.x/trunk/
------------------------------------------------------------------------------
  Merged /tomcat/trunk:r1577463

Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/descriptor/DigesterFactory.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/descriptor/DigesterFactory.java?rev=1577465&r1=1577464&r2=1577465&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/descriptor/DigesterFactory.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/descriptor/DigesterFactory.java Fri Mar 14 09:40:15 2014
@@ -116,15 +116,15 @@ public class DigesterFactory {
     }
 
     private static void addSelf(Map<String, String> ids, String id) {
-        String systemId = locationFor(id);
-        ids.put(id, systemId);
-        ids.put(systemId, systemId);
+        String location = locationFor(id);
+        if (location != null) {
+            ids.put(id, location);
+            ids.put(location, location);
+        }
     }
 
     private static void add(Map<String,String> ids, String id, String location) {
-        if (location == null) {
-            log.warn(sm.getString("digesterFactory.missingSchema", id));
-        } else {
+        if (location != null) {
             ids.put(id, location);
         }
     }
@@ -135,6 +135,7 @@ public class DigesterFactory {
             location = CLASS_JSP_CONTEXT.getResource("resources/" + name);
         }
         if (location == null) {
+            log.warn(sm.getString("digesterFactory.missingSchema", name));
             return null;
         }
         return location.toExternalForm();

Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/descriptor/LocalStrings.properties
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/descriptor/LocalStrings.properties?rev=1577465&r1=1577464&r2=1577465&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/descriptor/LocalStrings.properties (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/descriptor/LocalStrings.properties Fri Mar 14 09:40:15 2014
@@ -13,7 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-digesterFactory.missingSchema=The XML schema [{0}] could not be found. This is likely to break XML validation if enabled.
+digesterFactory.missingSchema=The XML schema [{0}] could not be found. This is very likely to break XML validation if XML validation is enabled.
 
 localResolver.unresolvedEntity=Could not resolve XML resource [{0}] with public ID [{1}], system ID [{2}] and base URI [{3}] to a known, local entity.
 



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