Author: markt Date: Sat Jan 15 13:42:01 2011 New Revision: 1059322 URL: http://svn.apache.org/viewvc?rev=1059322&view=rev Log: Remove unused code Fix FindBugs and Eclipse warnings Correct typos
Modified: tomcat/trunk/java/org/apache/tomcat/util/buf/MessageBytes.java tomcat/trunk/java/org/apache/tomcat/util/digester/Digester.java tomcat/trunk/res/findbugs/filter-false-positives.xml tomcat/trunk/webapps/docs/changelog.xml tomcat/trunk/webapps/docs/config/context.xml Modified: tomcat/trunk/java/org/apache/tomcat/util/buf/MessageBytes.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/buf/MessageBytes.java?rev=1059322&r1=1059321&r2=1059322&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/util/buf/MessageBytes.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/buf/MessageBytes.java Sat Jan 15 13:42:01 2011 @@ -154,19 +154,6 @@ public final class MessageBytes implemen hasLongValue=false; } - /** Remove the cached string value. Use it after a conversion on the - * byte[] or after the encoding is changed - * XXX Is this needed ? - */ - public void resetStringValue() { - if( type != T_STR ) { - // If this was created as a byte[] or char[], we remove - // the old string value - hasStrValue=false; - strValue=null; - } - } - /** * Set the content to be a string */ @@ -294,7 +281,7 @@ public final class MessageBytes implemen public boolean equals(String s) { switch (type) { case T_STR: - if( strValue==null && s!=null) return false; + if (strValue == null) return s == null; return strValue.equals( s ); case T_CHARS: return charC.equals( s ); @@ -313,7 +300,7 @@ public final class MessageBytes implemen public boolean equalsIgnoreCase(String s) { switch (type) { case T_STR: - if( strValue==null && s!=null) return false; + if (strValue == null) return s == null; return strValue.equalsIgnoreCase( s ); case T_CHARS: return charC.equalsIgnoreCase( s ); @@ -324,6 +311,14 @@ public final class MessageBytes implemen } } + @Override + public boolean equals(Object obj) { + if (obj instanceof MessageBytes) { + return equals((MessageBytes) obj); + } + return false; + } + public boolean equals(MessageBytes mb) { switch (type) { case T_STR: Modified: tomcat/trunk/java/org/apache/tomcat/util/digester/Digester.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/digester/Digester.java?rev=1059322&r1=1059321&r2=1059322&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/util/digester/Digester.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/digester/Digester.java Sat Jan 15 13:42:01 2011 @@ -78,6 +78,7 @@ public class Digester extends DefaultHan // ---------------------------------------------------------- Static Fields private static class SystemPropertySource implements IntrospectionUtils.PropertySource { + @Override public String getProperty( String key ) { return System.getProperty(key); } Modified: tomcat/trunk/res/findbugs/filter-false-positives.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/res/findbugs/filter-false-positives.xml?rev=1059322&r1=1059321&r2=1059322&view=diff ============================================================================== --- tomcat/trunk/res/findbugs/filter-false-positives.xml (original) +++ tomcat/trunk/res/findbugs/filter-false-positives.xml Sat Jan 15 13:42:01 2011 @@ -39,6 +39,18 @@ <Bug code="CN" /> </Match> <Match> + <!-- Returning null here is fine --> + <Class name="org.apache.tomcat.util.buf.MessageBytes"/> + <Method name="toString"/> + <Bug code="NP" /> + </Match> + <Match> + <!-- Test really is for the same object rather than equality --> + <Class name="org.apache.tomcat.util.digester.Digester"/> + <Method name="updateBodyText"/> + <Bug code="ES" /> + </Match> + <Match> <!-- Yes the simple name is the same as the super class. Accept it. --> <Class name="org.apache.tomcat.util.threads.ThreadPoolExecutor" /> <Bug code="Nm" /> Modified: tomcat/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1059322&r1=1059321&r2=1059322&view=diff ============================================================================== --- tomcat/trunk/webapps/docs/changelog.xml (original) +++ tomcat/trunk/webapps/docs/changelog.xml Sat Jan 15 13:42:01 2011 @@ -91,7 +91,7 @@ Correct a handful of Javadoc warnings. (markt) </fix> <add> - Provide additional detail about how web application version order it + Provide additional detail about how web application version order is determined when using parallel deployment. (markt) </add> </changelog> @@ -106,6 +106,9 @@ dependencies to ensure that the correct Tomcat version appears in the manifest. (markt) </fix> + <fix> + Code clean-up to remove unused code and reduce IDE warnings. (markt) + </fix> </changelog> </subsection> </section> Modified: tomcat/trunk/webapps/docs/config/context.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/config/context.xml?rev=1059322&r1=1059321&r2=1059322&view=diff ============================================================================== --- tomcat/trunk/webapps/docs/config/context.xml (original) +++ tomcat/trunk/webapps/docs/config/context.xml Sat Jan 15 13:42:01 2011 @@ -108,7 +108,7 @@ </table> <p>The version component is treated as a <code>String</code> both for - performance reasons and to allow flexability in versioning schemes. String + performance reasons and to allow flexibility in versioning schemes. String comparissions are used to determine version order. Therefore <code>foo##11.war</code> will be treated as an earlier version than <code>foo##2.war</code>. If using a purely numerical versioning scheme it is --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org