cklein05 commented on pull request #428: URL: https://github.com/apache/tomcat/pull/428#issuecomment-877827556
So, I guess, it's best to just remove any defensive copies from GenericPrincipal. I just added these due to the recommendations on the User's mailing list in order to make user attributes behave _immutable_. Since attributes are added by the Realms only, which obtain these values directly from either JDBC or JNDI, I believe, that there's no need to defensively copy these when they are added to the map. Although it would be cheap and simple, I do not expect any help from wrapping the attributes map in GenericPrincipal with `Collections.unmodifiableMap`, so I recommend not adding this right now. If you agree, I will remove methods `copyObject` and `copySerializableObject` from GenericPrincipal and adjust method `getAttribute` accordingly (as well as documentation for `TomcatPrincipal#getAttribute(String)`) and commit changes to this PR. Awaiting your responses. -- 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. To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org