You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2009/03/09 06:56:04 UTC

DO NOT REPLY [Bug 46822] New: Avoid redundant instantiations in StandardContext

https://issues.apache.org/bugzilla/show_bug.cgi?id=46822

           Summary: Avoid redundant instantiations in StandardContext
           Product: Tomcat 6
           Version: unspecified
          Platform: PC
        OS/Version: Windows Vista
            Status: NEW
          Severity: normal
          Priority: P3
         Component: Catalina
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: anthony@whitford.com


Created an attachment (id=23358)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=23358)
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.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 46822] Avoid redundant instantiations in StandardContext

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46822


Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




--- Comment #2 from Mark Thomas <ma...@apache.org>  2009-04-28 04:00:43 PST ---
This has been fixed in 6.0.x and will be included in 6.0.20 onwards. Thanks
again for the patch.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 46822] Avoid redundant instantiations in StandardContext

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46822





--- Comment #1 from Mark Thomas <ma...@apache.org>  2009-03-26 06:01:49 PST ---
Thanks for the patch. This has been applied to trunk and proposed for 6.0.x.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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