Author: markt
Date: Fri Mar 14 09:37:26 2014
New Revision: 1577463
URL: http://svn.apache.org/r1577463
Log:
Review by kkolinko
Avoid adding nulls to the map
Log a warning for problems in addSelf() as well as add()
Modified:
tomcat/trunk/java/org/apache/tomcat/util/descriptor/DigesterFactory.java
tomcat/trunk/java/org/apache/tomcat/util/descriptor/LocalStrings.properties
Modified:
tomcat/trunk/java/org/apache/tomcat/util/descriptor/DigesterFactory.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/descriptor/DigesterFactory.java?rev=1577463&r1=1577462&r2=1577463&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/descriptor/DigesterFactory.java
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/descriptor/DigesterFactory.java
Fri Mar 14 09:37:26 2014
@@ -125,15 +125,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);
}
}
@@ -144,6 +144,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/trunk/java/org/apache/tomcat/util/descriptor/LocalStrings.properties
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/descriptor/LocalStrings.properties?rev=1577463&r1=1577462&r2=1577463&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/descriptor/LocalStrings.properties
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/descriptor/LocalStrings.properties
Fri Mar 14 09:37:26 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: [email protected]
For additional commands, e-mail: [email protected]