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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to