From 790022d254f90b7c6404cb3eeffd8e1dbde0b9c5 Mon Sep 17 00:00:00 2001 From: markt Date: Fri, 14 Jan 2011 19:07:17 +0000 Subject: [PATCH] Fix FindBugs and unused code warnings git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1059117 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/naming/resources/ResourceAttributes.java | 20 ++++---------------- res/findbugs/filter-false-positives.xml | 5 +++++ 2 files changed, 9 insertions(+), 16 deletions(-) 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 @@ + + + + + -- 2.11.0