You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2009/12/04 14:51:53 UTC

svn commit: r887197 - /tomcat/trunk/java/org/apache/naming/resources/DirContextURLConnection.java

Author: markt
Date: Fri Dec  4 13:51:52 2009
New Revision: 887197

URL: http://svn.apache.org/viewvc?rev=887197&view=rev
Log:
Fix the Eclipse warnings

Modified:
    tomcat/trunk/java/org/apache/naming/resources/DirContextURLConnection.java

Modified: tomcat/trunk/java/org/apache/naming/resources/DirContextURLConnection.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/resources/DirContextURLConnection.java?rev=887197&r1=887196&r2=887197&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/naming/resources/DirContextURLConnection.java (original)
+++ tomcat/trunk/java/org/apache/naming/resources/DirContextURLConnection.java Fri Dec  4 13:51:52 2009
@@ -149,9 +149,8 @@
                     if (contextName != null) {
                         if (!path.startsWith(contextName + "/")) {
                             return;
-                        } else {
-                            path = path.substring(contextName.length());
                         }
+                        path = path.substring(contextName.length());
                     }
                 }
                 object = context.lookup(path);
@@ -209,6 +208,7 @@
             try {
                 connect();
             } catch (IOException e) {
+                // Ignore
             }
         }
 
@@ -222,6 +222,7 @@
                 Date lmDate = (Date) lastModified.get();
                 return lmDate.getTime();
             } catch (Exception e) {
+                // Ignore
             }
         }
 
@@ -252,6 +253,7 @@
           try {
               connect();
           } catch (IOException e) {
+              //Ignore
           }
       }
 
@@ -296,6 +298,7 @@
             try {
                 connect();
             } catch (IOException e) {
+                // Ignore
             }
         }
         
@@ -352,11 +355,11 @@
     public Object getContent(Class[] classes)
         throws IOException {
         
-        Object object = getContent();
+        Object obj = getContent();
         
         for (int i = 0; i < classes.length; i++) {
-            if (classes[i].isInstance(object))
-                return object;
+            if (classes[i].isInstance(obj))
+                return obj;
         }
         
         return null;
@@ -376,12 +379,13 @@
         
         if (resource == null) {
             throw new FileNotFoundException();
-        } else {
-            // Reopen resource
-            try {
-                resource = (Resource) context.lookup(getURL().getFile());
-            } catch (NamingException e) {
-            }
+        }
+
+        // Reopen resource
+        try {
+            resource = (Resource) context.lookup(getURL().getFile());
+        } catch (NamingException e) {
+            // Ignore
         }
         
         return (resource.streamContent());



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org