Author: markt Date: Tue Jan 18 21:33:14 2011 New Revision: 1060586 URL: http://svn.apache.org/viewvc?rev=1060586&view=rev Log: Fix Findbugs and Eclipse warnings
Modified: tomcat/trunk/java/org/apache/catalina/core/ApplicationDispatcher.java tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java tomcat/trunk/java/org/apache/catalina/realm/LockOutRealm.java tomcat/trunk/java/org/apache/catalina/ssi/SSIServletExternalResolver.java tomcat/trunk/java/org/apache/jasper/runtime/JspFactoryImpl.java tomcat/trunk/java/org/apache/juli/ClassLoaderLogManager.java tomcat/trunk/java/org/apache/naming/resources/FileDirContext.java tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java tomcat/trunk/java/org/apache/tomcat/util/threads/DedicatedThreadExecutor.java tomcat/trunk/test/org/apache/catalina/connector/TestMaxConnections.java Modified: tomcat/trunk/java/org/apache/catalina/core/ApplicationDispatcher.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/ApplicationDispatcher.java?rev=1060586&r1=1060585&r2=1060586&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/core/ApplicationDispatcher.java (original) +++ tomcat/trunk/java/org/apache/catalina/core/ApplicationDispatcher.java Tue Jan 18 21:33:14 2011 @@ -130,7 +130,7 @@ final class ApplicationDispatcher * variables causes threading issues and state is too complex to pass and * return single ServletRequest or ServletResponse objects. */ - private class State { + private static class State { State(ServletRequest request, ServletResponse response, boolean including) { this.outerRequest = request; Modified: tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java?rev=1060586&r1=1060585&r2=1060586&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java (original) +++ tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java Tue Jan 18 21:33:14 2011 @@ -156,7 +156,7 @@ public class WebappClassLoader } - protected final class PrivilegedGetClassLoader + protected static final class PrivilegedGetClassLoader implements PrivilegedAction<ClassLoader> { public Class<?> clazz; Modified: tomcat/trunk/java/org/apache/catalina/realm/LockOutRealm.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/realm/LockOutRealm.java?rev=1060586&r1=1060585&r2=1060586&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/realm/LockOutRealm.java (original) +++ tomcat/trunk/java/org/apache/catalina/realm/LockOutRealm.java Tue Jan 18 21:33:14 2011 @@ -379,7 +379,7 @@ public class LockOutRealm extends Combin } - protected class LockRecord { + protected static class LockRecord { private AtomicInteger failures = new AtomicInteger(0); private long lastFailureTime = 0; Modified: tomcat/trunk/java/org/apache/catalina/ssi/SSIServletExternalResolver.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ssi/SSIServletExternalResolver.java?rev=1060586&r1=1060585&r2=1060586&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/ssi/SSIServletExternalResolver.java (original) +++ tomcat/trunk/java/org/apache/catalina/ssi/SSIServletExternalResolver.java Tue Jan 18 21:33:14 2011 @@ -74,6 +74,7 @@ public class SSIServletExternalResolver } + @Override public void log(String message, Throwable throwable) { //We can't assume that Servlet.log( message, null ) //is the same as Servlet.log( message ), since API @@ -86,6 +87,7 @@ public class SSIServletExternalResolver } + @Override public void addVariableNames(Collection<String> variableNames) { for (int i = 0; i < VARIABLE_NAMES.length; i++) { String variableName = VARIABLE_NAMES[i]; @@ -132,6 +134,7 @@ public class SSIServletExternalResolver } + @Override public void setVariableValue(String name, String value) { if (!isNameReserved(name)) { req.setAttribute(name, value); @@ -139,6 +142,7 @@ public class SSIServletExternalResolver } + @Override public String getVariableValue(String name) { String retVal = null; Object object = getReqAttributeIgnoreCase(name); @@ -331,6 +335,7 @@ public class SSIServletExternalResolver return retVal; } + @Override public Date getCurrentDate() { return new Date(); } @@ -480,6 +485,7 @@ public class SSIServletExternalResolver } + @Override public long getFileLastModified(String path, boolean virtual) throws IOException { long lastModified = 0; @@ -493,6 +499,7 @@ public class SSIServletExternalResolver } + @Override public long getFileSize(String path, boolean virtual) throws IOException { long fileSize = -1; try { @@ -508,6 +515,7 @@ public class SSIServletExternalResolver //We are making lots of unnecessary copies of the included data here. If //someone ever complains that this is slow, we should connect the included // stream to the print writer that SSICommand uses. + @Override public String getFileText(String originalPath, boolean virtual) throws IOException { try { @@ -552,7 +560,7 @@ public class SSIServletExternalResolver } } - protected class ServletContextAndPath { + protected static class ServletContextAndPath { protected ServletContext servletContext; protected String path; Modified: tomcat/trunk/java/org/apache/jasper/runtime/JspFactoryImpl.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/runtime/JspFactoryImpl.java?rev=1060586&r1=1060585&r2=1060586&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/jasper/runtime/JspFactoryImpl.java (original) +++ tomcat/trunk/java/org/apache/jasper/runtime/JspFactoryImpl.java Tue Jan 18 21:33:14 2011 @@ -126,7 +126,7 @@ public class JspFactoryImpl extends JspF } } - private class PrivilegedGetPageContext + private static class PrivilegedGetPageContext implements PrivilegedAction<PageContext> { private JspFactoryImpl factory; @@ -158,7 +158,7 @@ public class JspFactoryImpl extends JspF } } - private class PrivilegedReleasePageContext + private static class PrivilegedReleasePageContext implements PrivilegedAction<Void> { private JspFactoryImpl factory; Modified: tomcat/trunk/java/org/apache/juli/ClassLoaderLogManager.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/juli/ClassLoaderLogManager.java?rev=1060586&r1=1060585&r2=1060586&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/juli/ClassLoaderLogManager.java (original) +++ tomcat/trunk/java/org/apache/juli/ClassLoaderLogManager.java Tue Jan 18 21:33:14 2011 @@ -679,7 +679,7 @@ public class ClassLoaderLogManager exten * This class is needed to instantiate the root of each per classloader * hierarchy. */ - protected class RootLogger extends Logger { + protected static class RootLogger extends Logger { public RootLogger() { super("", null); } Modified: tomcat/trunk/java/org/apache/naming/resources/FileDirContext.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/resources/FileDirContext.java?rev=1060586&r1=1060585&r2=1060586&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/naming/resources/FileDirContext.java (original) +++ tomcat/trunk/java/org/apache/naming/resources/FileDirContext.java Tue Jan 18 21:33:14 2011 @@ -894,7 +894,7 @@ public class FileDirContext extends Base * This specialized resource implementation avoids opening the InputStream * to the file right away (which would put a lock on the file). */ - protected class FileResource extends Resource { + protected static class FileResource extends Resource { // -------------------------------------------------------- Constructor @@ -914,12 +914,6 @@ public class FileDirContext extends Base protected File file; - /** - * File length. - */ - protected long length = -1L; - - // --------------------------------------------------- Resource Methods @@ -951,7 +945,7 @@ public class FileDirContext extends Base * reading (to speed up simple checks, like checking the last modified * date). */ - protected class FileResourceAttributes extends ResourceAttributes { + protected static class FileResourceAttributes extends ResourceAttributes { private static final long serialVersionUID = 1L; Modified: tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java?rev=1060586&r1=1060585&r2=1060586&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java Tue Jan 18 21:33:14 2011 @@ -194,7 +194,7 @@ public class NioBlockingSelector { } - protected class BlockPoller extends Thread { + protected static class BlockPoller extends Thread { protected volatile boolean run = true; protected Selector selector = null; protected ConcurrentLinkedQueue<Runnable> events = new ConcurrentLinkedQueue<Runnable>(); @@ -202,6 +202,7 @@ public class NioBlockingSelector { protected AtomicInteger wakeupCounter = new AtomicInteger(0); public void cancelKey(final SelectionKey key) { Runnable r = new Runnable() { + @Override public void run() { key.cancel(); } @@ -225,6 +226,7 @@ public class NioBlockingSelector { public void add(final KeyAttachment key, final int ops, final KeyReference ref) { Runnable r = new Runnable() { + @Override public void run() { if ( key == null ) return; NioChannel nch = key.getChannel(); @@ -254,6 +256,7 @@ public class NioBlockingSelector { public void remove(final KeyAttachment key, final int ops) { Runnable r = new Runnable() { + @Override public void run() { if ( key == null ) return; NioChannel nch = key.getChannel(); @@ -380,7 +383,7 @@ public class NioBlockingSelector { } } - public class KeyReference { + public static class KeyReference { SelectionKey key = null; @Override Modified: tomcat/trunk/java/org/apache/tomcat/util/threads/DedicatedThreadExecutor.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/threads/DedicatedThreadExecutor.java?rev=1060586&r1=1060585&r2=1060586&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/util/threads/DedicatedThreadExecutor.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/threads/DedicatedThreadExecutor.java Tue Jan 18 21:33:14 2011 @@ -119,7 +119,7 @@ public class DedicatedThreadExecutor { // This can lead to false alarms about potential memory leaks because the // thread may have a web application class loader for its context class // loader. - private class SingleThreadFactory implements ThreadFactory { + private static class SingleThreadFactory implements ThreadFactory { private volatile Thread singleThread; @Override Modified: tomcat/trunk/test/org/apache/catalina/connector/TestMaxConnections.java URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/connector/TestMaxConnections.java?rev=1060586&r1=1060585&r2=1060586&view=diff ============================================================================== --- tomcat/trunk/test/org/apache/catalina/connector/TestMaxConnections.java (original) +++ tomcat/trunk/test/org/apache/catalina/connector/TestMaxConnections.java Tue Jan 18 21:33:14 2011 @@ -59,7 +59,7 @@ public class TestMaxConnections extends } - private class ConnectThread extends Thread { + private static class ConnectThread extends Thread { public boolean passed = true; public boolean connectfailed = false; @Override @@ -91,7 +91,7 @@ public class TestMaxConnections extends tomcat.start(); } - private class TestClient extends SimpleHttpClient { + private static class TestClient extends SimpleHttpClient { private void doHttp10Request() throws Exception { --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org