Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=50554
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 7 Jan 2011 10:31:59 +0000 (10:31 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 7 Jan 2011 10:31:59 +0000 (10:31 +0000)
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
res/findbugs/filter-false-positives.xml
webapps/docs/changelog.xml

index c804b99..be18a1c 100644 (file)
@@ -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<String,Object>)environment, MAIN);
index 940c9f6..141f5a1 100644 (file)
@@ -5,6 +5,10 @@
     <Method name="checkResources" />
     <Bug code="SWL" />
   </Match>
+  <Match>
+    <Class name="org.apache.naming.java.javaURLContextFactory" />
+    <Bug code="Nm" />
+  </Match>
   <!--  Generated code -->
   <Match>
     <Class name="org.apache.el.parser.ELParserTokenManager" />
index ac5be35..8fdaaff 100644 (file)
         ensure that a subsequent request for that directory does not result in a
         404 response. (markt)
       </fix>
+      <fix>
+        <bug>50554</bug>: Code clean up. (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Coyote">