Author: markt Date: Fri Jan 14 19:07:17 2011 New Revision: 1059117 URL: http://svn.apache.org/viewvc?rev=1059117&view=rev Log: Fix FindBugs and unused code warnings
Modified: tomcat/trunk/java/org/apache/naming/resources/ResourceAttributes.java tomcat/trunk/res/findbugs/filter-false-positives.xml Modified: tomcat/trunk/java/org/apache/naming/resources/ResourceAttributes.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/resources/ResourceAttributes.java?rev=1059117&r1=1059116&r2=1059117&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/naming/resources/ResourceAttributes.java (original) +++ tomcat/trunk/java/org/apache/naming/resources/ResourceAttributes.java Fri Jan 14 19:07:17 2011 @@ -88,24 +88,12 @@ public class ResourceAttributes implemen /** - * Source. - */ - public static final String SOURCE = "source"; - - - /** * MIME type of the content. */ public static final String CONTENT_TYPE = "getcontenttype"; /** - * Content language. - */ - public static final String CONTENT_LANGUAGE = "getcontentlanguage"; - - - /** * Content length. */ public static final String CONTENT_LENGTH = "getcontentlength"; @@ -333,7 +321,7 @@ public class ResourceAttributes implemen public void setContentLength(long contentLength) { this.contentLength = contentLength; if (attributes != null) - attributes.put(CONTENT_LENGTH, new Long(contentLength)); + attributes.put(CONTENT_LENGTH, Long.valueOf(contentLength)); } @@ -808,11 +796,11 @@ public class ResourceAttributes implemen } else if (attrID.equals(CONTENT_LENGTH)) { long contentLength = getContentLength(); if (contentLength < 0) return null; - return new BasicAttribute(CONTENT_LENGTH, new Long(contentLength)); + return new BasicAttribute(CONTENT_LENGTH, Long.valueOf(contentLength)); } else if (attrID.equals(ALTERNATE_CONTENT_LENGTH)) { long contentLength = getContentLength(); if (contentLength < 0) return null; - return new BasicAttribute(ALTERNATE_CONTENT_LENGTH, new Long(contentLength)); + return new BasicAttribute(ALTERNATE_CONTENT_LENGTH, Long.valueOf(contentLength)); } else if (attrID.equals(ETAG)) { String etag = getETag(); if (etag == null) return null; @@ -904,7 +892,7 @@ public class ResourceAttributes implemen } long contentLength = getContentLength(); if (contentLength >= 0) { - Long contentLengthLong = new Long(contentLength); + Long contentLengthLong = Long.valueOf(contentLength); attributes.addElement(new BasicAttribute(CONTENT_LENGTH, contentLengthLong)); attributes.addElement(new BasicAttribute(ALTERNATE_CONTENT_LENGTH, contentLengthLong)); } Modified: tomcat/trunk/res/findbugs/filter-false-positives.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/res/findbugs/filter-false-positives.xml?rev=1059117&r1=1059116&r2=1059117&view=diff ============================================================================== --- tomcat/trunk/res/findbugs/filter-false-positives.xml (original) +++ tomcat/trunk/res/findbugs/filter-false-positives.xml Fri Jan 14 19:07:17 2011 @@ -34,6 +34,11 @@ <Bug code="Nm" /> </Match> <Match> + <!-- Class has to implement clone since its superclass does but fakes it --> + <Class name="org.apache.naming.resources.ResourceAttributes" /> + <Bug code="CN" /> + </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" /> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org