|Summary:||Avoid redundant instantiations in StandardContext|
|Product:||Tomcat 6||Reporter:||Anthony Whitford <anthony>|
|Component:||Catalina||Assignee:||Tomcat Developers Mailing List <dev>|
|Attachments:||Patch file to replace new Booleans with primitive version|
Description Anthony Whitford 2009-03-08 22:56:01 UTC
Created attachment 23358 [details] Patch file to replace new Booleans with primitive version While reviewing the source code, I noticed that java\org\apache\catalina\core\StandardContext.java code is creating Boolean objects unnecessarily. For example: support.firePropertyChange("antiJARLocking", new Boolean(oldAntiJARLocking), new Boolean(this.antiJARLocking)); is instantiating Boolean objects when there is already a version of firePropertyChange that accepts boolean primitives. So, the above can be rewritten to avoid instantiating new objects like: support.firePropertyChange("antiJARLocking", oldAntiJARLocking, this.antiJARLocking); This pattern was repeated for numerous properties. I took the liberty of creating a patch.
Comment 1 Mark Thomas 2009-03-26 06:01:49 UTC
Thanks for the patch. This has been applied to trunk and proposed for 6.0.x.
Comment 2 Mark Thomas 2009-04-28 04:00:43 UTC
This has been fixed in 6.0.x and will be included in 6.0.20 onwards. Thanks again for the patch.