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 2012/01/02 22:33:03 UTC

svn commit: r1226551 - /tomcat/trunk/java/javax/servlet/ServletSecurityElement.java

Author: markt
Date: Mon Jan  2 21:33:03 2012
New Revision: 1226551

URL: http://svn.apache.org/viewvc?rev=1226551&view=rev
Log:
https://issues.apache.org/bugzilla/show_bug.cgi?id=52405
Servlet 3.0 Rev A updates
Item 20 of 20
Ensure underlying collections are immutable

Modified:
    tomcat/trunk/java/javax/servlet/ServletSecurityElement.java

Modified: tomcat/trunk/java/javax/servlet/ServletSecurityElement.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/ServletSecurityElement.java?rev=1226551&r1=1226550&r2=1226551&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/ServletSecurityElement.java (original)
+++ tomcat/trunk/java/javax/servlet/ServletSecurityElement.java Mon Jan  2 21:33:03 2012
@@ -19,6 +19,7 @@ package javax.servlet;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 
@@ -107,11 +108,16 @@ public class ServletSecurityElement exte
     }
 
     public Collection<HttpMethodConstraintElement> getHttpMethodConstraints() {
-        return methodConstraints.values();
+        Collection<HttpMethodConstraintElement> result =
+                new HashSet<HttpMethodConstraintElement>();
+        result.addAll(methodConstraints.values());
+        return result;
     }
 
     public Collection<String> getMethodNames() {
-        return methodConstraints.keySet();
+        Collection<String> result = new HashSet<String>();
+        result.addAll(methodConstraints.keySet());
+        return result;
     }
 
     private void addHttpMethodConstraints(



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