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: anth...@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-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to