From: markt Date: Fri, 14 Jan 2011 19:07:17 +0000 (+0000) Subject: Fix FindBugs and unused code warnings X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=790022d254f90b7c6404cb3eeffd8e1dbde0b9c5;p=tomcat7.0 Fix FindBugs and unused code warnings git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1059117 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/naming/resources/ResourceAttributes.java b/java/org/apache/naming/resources/ResourceAttributes.java index d40feefbf..fa58e6f89 100644 --- a/java/org/apache/naming/resources/ResourceAttributes.java +++ b/java/org/apache/naming/resources/ResourceAttributes.java @@ -88,24 +88,12 @@ public class ResourceAttributes implements Attributes { /** - * 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 implements Attributes { 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 implements Attributes { } 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 implements Attributes { } 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)); } diff --git a/res/findbugs/filter-false-positives.xml b/res/findbugs/filter-false-positives.xml index 752c68ba5..27dd7c986 100644 --- a/res/findbugs/filter-false-positives.xml +++ b/res/findbugs/filter-false-positives.xml @@ -34,6 +34,11 @@ + + + + +