Author: markt Date: Tue Apr 28 11:03:22 2009 New Revision: 769331 URL: http://svn.apache.org/viewvc?rev=769331&view=rev Log: Fix 46822. Remove unnecessary object creation from StandardContext. Patch provided by Anthony Whitford.
Modified: tomcat/tc6.0.x/trunk/ (props changed) tomcat/tc6.0.x/trunk/STATUS.txt tomcat/tc6.0.x/trunk/java/org/apache/catalina/core/StandardContext.java tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml Propchange: tomcat/tc6.0.x/trunk/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Tue Apr 28 11:03:22 2009 @@ -1 +1 @@ -/tomcat/trunk:601180,606992,612607,630314,640888,652744,653247,673796,673820,683982,684001,684081,684234,684269-684270,685177,687503,687645,689402,690781,691392,691805,692748,693378,694992,695053,695311,696780,696782,698012,698227,698236,698613,699427,699634,701355,709294,709811,709816,710063,710066,710125,710205,711126,711600,712461,712467,718360,719119,719124,719602,719626,719628,720046,720069,721040,723404,723738,726052,727303,728032,728768,728947,729057,729567,729569,729571,729681,729809,729815,729934,730250,730590,731651,732859,732863,734734,740675,740684,742677,742697,742714,744160,744238,746321,746384,747834,747863,748344,750258,750291,750921,751286-751287,751295,757774,758596,768335 +/tomcat/trunk:601180,606992,612607,630314,640888,652744,653247,673796,673820,683982,684001,684081,684234,684269-684270,685177,687503,687645,689402,690781,691392,691805,692748,693378,694992,695053,695311,696780,696782,698012,698227,698236,698613,699427,699634,701355,709294,709811,709816,710063,710066,710125,710205,711126,711600,712461,712467,718360,719119,719124,719602,719626,719628,720046,720069,721040,723404,723738,726052,727303,728032,728768,728947,729057,729567,729569,729571,729681,729809,729815,729934,730250,730590,731651,732859,732863,734734,740675,740684,742677,742697,742714,744160,744238,746321,746384,747834,747863,748344,750258,750291,750921,751286-751287,751295,757774,758596,758616,768335 Modified: tomcat/tc6.0.x/trunk/STATUS.txt URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=769331&r1=769330&r2=769331&view=diff ============================================================================== --- tomcat/tc6.0.x/trunk/STATUS.txt (original) +++ tomcat/tc6.0.x/trunk/STATUS.txt Tue Apr 28 11:03:22 2009 @@ -104,20 +104,6 @@ +1: markt, remm -1: -* Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=46822 - http://svn.apache.org/viewvc?rev=758616&view=rev - Remove unnecessary object creation in StandardContext - +1: markt, rjung, remm - -1: - rjung: firePropertyChange() creates a PropertyChangeEvent, which only has - object type arguments in the constructor. Brief inspection of the Sun JDK - shows, that the firePropertyChange() method with primitive type arguments - first converts them to objects and then creates the PropertyChangeEvent(). - So in general there will be no object creation safed, although in some - cases we use e.g. "new Boolean" instead of Boolean.valueOf(), so there might be - some savings. - remm: yes, it's not going to do anything useful ;) - * Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=46915 When resolving ResourceBundle properties, don't claim to have resolved the property unless we really have resolved it. Modified: tomcat/tc6.0.x/trunk/java/org/apache/catalina/core/StandardContext.java URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/core/StandardContext.java?rev=769331&r1=769330&r2=769331&view=diff ============================================================================== --- tomcat/tc6.0.x/trunk/java/org/apache/catalina/core/StandardContext.java (original) +++ tomcat/tc6.0.x/trunk/java/org/apache/catalina/core/StandardContext.java Tue Apr 28 11:03:22 2009 @@ -827,8 +827,8 @@ boolean oldDelegate = this.delegate; this.delegate = delegate; - support.firePropertyChange("delegate", new Boolean(oldDelegate), - new Boolean(this.delegate)); + support.firePropertyChange("delegate", oldDelegate, + this.delegate); } @@ -942,8 +942,8 @@ boolean oldAntiJARLocking = this.antiJARLocking; this.antiJARLocking = antiJARLocking; support.firePropertyChange("antiJARLocking", - new Boolean(oldAntiJARLocking), - new Boolean(this.antiJARLocking)); + oldAntiJARLocking, + this.antiJARLocking); } @@ -958,8 +958,8 @@ boolean oldAntiResourceLocking = this.antiResourceLocking; this.antiResourceLocking = antiResourceLocking; support.firePropertyChange("antiResourceLocking", - new Boolean(oldAntiResourceLocking), - new Boolean(this.antiResourceLocking)); + oldAntiResourceLocking, + this.antiResourceLocking); } @@ -984,8 +984,8 @@ boolean oldAvailable = this.available; this.available = available; support.firePropertyChange("available", - new Boolean(oldAvailable), - new Boolean(this.available)); + oldAvailable, + this.available); } @@ -1070,8 +1070,8 @@ boolean oldConfigured = this.configured; this.configured = configured; support.firePropertyChange("configured", - new Boolean(oldConfigured), - new Boolean(this.configured)); + oldConfigured, + this.configured); } @@ -1096,8 +1096,8 @@ boolean oldCookies = this.cookies; this.cookies = cookies; support.firePropertyChange("cookies", - new Boolean(oldCookies), - new Boolean(this.cookies)); + oldCookies, + this.cookies); } @@ -1122,8 +1122,8 @@ boolean oldUseHttpOnly = this.useHttpOnly; this.useHttpOnly = useHttpOnly; support.firePropertyChange("useHttpOnly", - new Boolean(oldUseHttpOnly), - new Boolean(this.useHttpOnly)); + oldUseHttpOnly, + this.useHttpOnly); } @@ -1149,8 +1149,8 @@ boolean oldCrossContext = this.crossContext; this.crossContext = crossContext; support.firePropertyChange("crossContext", - new Boolean(oldCrossContext), - new Boolean(this.crossContext)); + oldCrossContext, + this.crossContext); } @@ -1282,8 +1282,8 @@ boolean oldDistributable = this.distributable; this.distributable = distributable; support.firePropertyChange("distributable", - new Boolean(oldDistributable), - new Boolean(this.distributable)); + oldDistributable, + this.distributable); // Bugzilla 32866 if(getManager() != null) { @@ -1395,8 +1395,8 @@ public void setIgnoreAnnotations(boolean ignoreAnnotations) { boolean oldIgnoreAnnotations = this.ignoreAnnotations; this.ignoreAnnotations = ignoreAnnotations; - support.firePropertyChange("ignoreAnnotations", Boolean.valueOf(oldIgnoreAnnotations), - Boolean.valueOf(this.ignoreAnnotations)); + support.firePropertyChange("ignoreAnnotations", oldIgnoreAnnotations, + this.ignoreAnnotations); } @@ -1630,8 +1630,8 @@ boolean oldPrivileged = this.privileged; this.privileged = privileged; support.firePropertyChange("privileged", - new Boolean(oldPrivileged), - new Boolean(this.privileged)); + oldPrivileged, + this.privileged); } @@ -1646,8 +1646,8 @@ boolean oldReloadable = this.reloadable; this.reloadable = reloadable; support.firePropertyChange("reloadable", - new Boolean(oldReloadable), - new Boolean(this.reloadable)); + oldReloadable, + this.reloadable); } @@ -1662,8 +1662,8 @@ boolean oldOverride = this.override; this.override = override; support.firePropertyChange("override", - new Boolean(oldOverride), - new Boolean(this.override)); + oldOverride, + this.override); } @@ -1688,8 +1688,8 @@ boolean oldReplaceWelcomeFiles = this.replaceWelcomeFiles; this.replaceWelcomeFiles = replaceWelcomeFiles; support.firePropertyChange("replaceWelcomeFiles", - new Boolean(oldReplaceWelcomeFiles), - new Boolean(this.replaceWelcomeFiles)); + oldReplaceWelcomeFiles, + this.replaceWelcomeFiles); } @@ -1736,8 +1736,8 @@ */ this.sessionTimeout = (timeout == 0) ? -1 : timeout; support.firePropertyChange("sessionTimeout", - new Integer(oldSessionTimeout), - new Integer(this.sessionTimeout)); + oldSessionTimeout, + this.sessionTimeout); } @@ -1764,8 +1764,8 @@ boolean oldSwallowOutput = this.swallowOutput; this.swallowOutput = swallowOutput; support.firePropertyChange("swallowOutput", - new Boolean(oldSwallowOutput), - new Boolean(this.swallowOutput)); + oldSwallowOutput, + this.swallowOutput); } @@ -1793,8 +1793,8 @@ long oldUnloadDelay = this.unloadDelay; this.unloadDelay = unloadDelay; support.firePropertyChange("unloadDelay", - new Long(oldUnloadDelay), - new Long(this.unloadDelay)); + Long.valueOf(oldUnloadDelay), + Long.valueOf(this.unloadDelay)); } @@ -2172,7 +2172,7 @@ if (errorPage.getErrorCode() == 200) { this.okErrorPage = errorPage; } - statusPages.put(new Integer(errorPage.getErrorCode()), + statusPages.put(Integer.valueOf(errorPage.getErrorCode()), errorPage); } } @@ -3317,7 +3317,7 @@ if (errorPage.getErrorCode() == 200) { this.okErrorPage = null; } - statusPages.remove(new Integer(errorPage.getErrorCode())); + statusPages.remove(Integer.valueOf(errorPage.getErrorCode())); } } fireContainerEvent("removeErrorPage", errorPage); @@ -4092,7 +4092,7 @@ int loadOnStartup = wrapper.getLoadOnStartup(); if (loadOnStartup < 0) continue; - Integer key = new Integer(loadOnStartup); + Integer key = Integer.valueOf(loadOnStartup); ArrayList list = (ArrayList) map.get(key); if (list == null) { list = new ArrayList(); Modified: tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml?rev=769331&r1=769330&r2=769331&view=diff ============================================================================== --- tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml (original) +++ tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml Tue Apr 28 11:03:22 2009 @@ -43,6 +43,10 @@ Fix a typo in the OPTIONS response from the default servlet. (markt) </fix> <fix> + <bug>46822</bug>: Remove unnecessary object creation from + StandardContext. Patch provided by Anthony Whitford. (markt) + </fix> + <fix> <bug>46866</bug>: Better initialisation of Random objects. (markt) </fix> <fix> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org