From: markt Date: Fri, 4 Dec 2009 13:51:52 +0000 (+0000) Subject: Fix the Eclipse warnings X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=d8edbda0333db8f5c1236a7cebb430cf6bdb5b89;p=tomcat7.0 Fix the Eclipse warnings git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@887197 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/naming/resources/DirContextURLConnection.java b/java/org/apache/naming/resources/DirContextURLConnection.java index fdea58913..c76978e60 100644 --- a/java/org/apache/naming/resources/DirContextURLConnection.java +++ b/java/org/apache/naming/resources/DirContextURLConnection.java @@ -149,9 +149,8 @@ public class DirContextURLConnection 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 @@ public class DirContextURLConnection try { connect(); } catch (IOException e) { + // Ignore } } @@ -222,6 +222,7 @@ public class DirContextURLConnection Date lmDate = (Date) lastModified.get(); return lmDate.getTime(); } catch (Exception e) { + // Ignore } } @@ -252,6 +253,7 @@ public class DirContextURLConnection try { connect(); } catch (IOException e) { + //Ignore } } @@ -296,6 +298,7 @@ public class DirContextURLConnection try { connect(); } catch (IOException e) { + // Ignore } } @@ -352,11 +355,11 @@ public class DirContextURLConnection 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 @@ public class DirContextURLConnection 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());