From ab3a4f5554b470e0d3c0f73f933748f82c85de58 Mon Sep 17 00:00:00 2001 From: markt Date: Fri, 7 Jan 2011 10:31:59 +0000 Subject: [PATCH] Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=50554 Various FindBugs / Eclipse warnings Silence the false positives git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1056244 13f79535-47bb-0310-9956-ffa450edef68 --- java/org/apache/naming/java/javaURLContextFactory.java | 6 +++++- res/findbugs/filter-false-positives.xml | 4 ++++ webapps/docs/changelog.xml | 3 +++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/java/org/apache/naming/java/javaURLContextFactory.java b/java/org/apache/naming/java/javaURLContextFactory.java index c804b9940..be18a1cde 100644 --- a/java/org/apache/naming/java/javaURLContextFactory.java +++ b/java/org/apache/naming/java/javaURLContextFactory.java @@ -80,6 +80,8 @@ public class javaURLContextFactory /** * Crete a new Context's instance. */ + @SuppressWarnings("unchecked") + @Override public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable environment) throws NamingException { @@ -94,6 +96,8 @@ public class javaURLContextFactory /** * Get a new (writable) initial context. */ + @SuppressWarnings("unchecked") + @Override public Context getInitialContext(Hashtable environment) throws NamingException { if (ContextBindings.isThreadBound() || @@ -105,7 +109,7 @@ public class javaURLContextFactory // If the thread is not bound, return a shared writable context if (initialContext == null) { - synchronized(getClass()) { + synchronized(javaURLContextFactory.class) { if (initialContext == null) { initialContext = new NamingContext( (Hashtable)environment, MAIN); diff --git a/res/findbugs/filter-false-positives.xml b/res/findbugs/filter-false-positives.xml index 940c9f60c..141f5a1e3 100644 --- a/res/findbugs/filter-false-positives.xml +++ b/res/findbugs/filter-false-positives.xml @@ -5,6 +5,10 @@ + + + + diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index ac5be355b..8fdaaff20 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -193,6 +193,9 @@ ensure that a subsequent request for that directory does not result in a 404 response. (markt) + + 50554: Code clean up. (markt) + -- 2.11.0