Fix some TCK issues. The behaviour is undefined in the spec, so go with the TCK requi...
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 22 Mar 2010 13:57:46 +0000 (13:57 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 22 Mar 2010 13:57:46 +0000 (13:57 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@926087 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/deploy/FilterDef.java
java/org/apache/catalina/deploy/ServletDef.java

index 95c92af..3b1d132 100644 (file)
@@ -175,6 +175,11 @@ public class FilterDef implements Serializable {
      */
     public void addInitParameter(String name, String value) {
 
+        if (parameters.containsKey(name)) {
+            // The spec does not define this but the TCK expects the first
+            // definition to take precedence
+            return;
+        }
         parameters.put(name, value);
 
     }
index 881b4ef..38b44c6 100644 (file)
@@ -157,6 +157,11 @@ public class ServletDef implements Serializable {
      */
     public void addInitParameter(String name, String value) {
 
+        if (parameters.containsKey(name)) {
+            // The spec does not define this but the TCK expects the first
+            // definition to take precedence
+            return;
+        }
         parameters.put(name, value);
 
     }