ChristopherSchultz commented on issue #269: Use parameterized collection 
constructors where possible
URL: https://github.com/apache/tomcat/pull/269#issuecomment-611038366
 
 
   Many of these instances are to protect private collections from being 
modified. For example, in `ServletSecurityElement.getHttpMethodConstraints()`, 
a new collection is being returned to avoid having the internal collection 
modified. Would it be safe-enough to return e.g. 
`Collections.unmodifiableSet(methodConstraints.values())` from that method, or 
is that too dangerous, as the "unmodifiable" collection includes a reference to 
the actual, potentially modifiable collection?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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

Reply via email to