You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by GitBox <gi...@apache.org> on 2020/04/07 15:41:18 UTC

[GitHub] [tomcat] larsgrefer opened a new pull request #269: Use parameterized collection constructors where possible

larsgrefer opened a new pull request #269: Use parameterized collection constructors where possible
URL: https://github.com/apache/tomcat/pull/269
 
 
   This allows collections like ArrayList and HashSet to initialize their backing arrays
   with the correct size.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [tomcat] ChristopherSchultz commented on issue #269: Use parameterized collection constructors where possible

Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org


With regards,
Apache Git Services

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