From 227fb5abecbce33375255f1b34c1ee5180afd422 Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Mon, 26 Oct 2009 07:48:39 +0000 Subject: [PATCH] numerous code cleanups git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@1014 7e9141cc-0065-0410-87d8-b60c137991c4 --- .../eclipse/jetty/embedded/HelloServlet.java | 1 + .../eclipse/jetty/embedded/LikeJettyXml.java | 3 -- .../eclipse/jetty/embedded/ManyHandlers.java | 1 + .../jetty/embedded/MinimalServlets.java | 1 + .../eclipse/jetty/ajp/Ajp13Connection.java | 3 ++ .../org/eclipse/jetty/ajp/Ajp13Generator.java | 6 ++++ .../org/eclipse/jetty/ajp/Ajp13Parser.java | 6 ++-- .../org/eclipse/jetty/ajp/Ajp13Request.java | 6 ++++ .../jetty/ajp/Ajp13SocketConnector.java | 8 ++++++ .../annotations/AbstractConfiguration.java | 2 +- .../annotations/RunAsAnnotationHandler.java | 3 -- .../org/eclipse/jetty/annotations/Util.java | 1 - .../TestAnnotationInheritance.java | 14 ---------- .../resources/TestResourceAnnotations.java | 4 +-- .../jetty/logging/MavenTestingUtils.java | 3 +- .../jetty/logging/impl/TestAppender.java | 2 -- .../org/eclipse/jetty/client/Address.java | 2 ++ .../eclipse/jetty/client/CachedExchange.java | 2 ++ .../org/eclipse/jetty/client/HttpClient.java | 5 ++++ .../eclipse/jetty/client/HttpConnection.java | 2 +- .../eclipse/jetty/client/HttpDestination.java | 6 ++-- .../eclipse/jetty/client/HttpExchange.java | 6 +++- .../eclipse/jetty/client/SelectConnector.java | 4 +++ .../client/security/SecurityListener.java | 5 ++++ .../jetty/client/webdav/MkcolExchange.java | 1 + .../jetty/client/webdav/PropfindExchange.java | 1 + .../jetty/client/webdav/WebdavListener.java | 3 ++ .../webdav/WebdavSupportedExchange.java | 2 ++ .../AbstractHttpExchangeCancelTest.java | 2 ++ .../client/AsyncSslHttpExchangeTest.java | 1 + .../client/AsyncSslSecurityListenerTest.java | 1 + .../BlockingHttpExchangeCancelTest.java | 1 + .../java/org/eclipse/jetty/client/Curl.java | 1 - .../org/eclipse/jetty/client/ExpireTest.java | 1 + ...ernalKeyStoreAsyncSslHttpExchangeTest.java | 1 + .../jetty/client/HttpExchangeTest.java | 14 +++++++++- .../NonBlockingHttpExchangeCancelTest.java | 1 + .../jetty/client/SecurityListenerTest.java | 10 ++++++- .../jetty/client/SslHttpExchangeTest.java | 2 ++ .../jetty/client/SslSecurityListenerTest.java | 4 ++- .../jetty/client/WebdavListenerTest.java | 2 ++ .../continuation/ContinuationFilter.java | 4 +-- .../continuation/ContinuationSupport.java | 5 ++-- .../jetty/continuation/FauxContinuation.java | 1 + .../continuation/Jetty6Continuation.java | 1 + .../eclipse/jetty/deploy/ContextDeployer.java | 9 ++++++ .../eclipse/jetty/deploy/WebAppDeployer.java | 2 ++ .../eclipse/jetty/http/EncodedHttpURI.java | 15 ++++++++++ .../org/eclipse/jetty/http/HttpBuffers.java | 3 ++ .../org/eclipse/jetty/http/HttpException.java | 1 + .../org/eclipse/jetty/http/HttpFields.java | 1 - .../org/eclipse/jetty/http/HttpGenerator.java | 7 +++++ .../org/eclipse/jetty/http/HttpParser.java | 1 + .../java/org/eclipse/jetty/http/HttpURI.java | 1 + .../java/org/eclipse/jetty/http/PathMap.java | 4 +++ .../jetty/http/security/Constraint.java | 2 ++ .../jetty/http/security/Credential.java | 3 +- .../eclipse/jetty/http/security/Password.java | 4 +++ .../jetty/http/security/UnixCrypt.java | 11 ++++---- .../http/ssl/SslSelectChannelEndPoint.java | 6 ++++ .../jetty/http/HttpGeneratorClientTest.java | 25 +++++++++++------ .../eclipse/jetty/http/HttpGeneratorTest.java | 25 +++++++++++------ .../org/eclipse/jetty/io/AbstractBuffer.java | 3 ++ .../org/eclipse/jetty/io/BufferCache.java | 1 + .../org/eclipse/jetty/io/ByteArrayBuffer.java | 11 ++++++++ .../eclipse/jetty/io/ThreadLocalBuffers.java | 2 +- .../jetty/io/UncheckedPrintWriter.java | 28 ++++++++++++++++++- .../main/java/org/eclipse/jetty/io/View.java | 11 ++++++++ .../eclipse/jetty/io/WriterOutputStream.java | 5 ++++ .../eclipse/jetty/io/bio/SocketEndPoint.java | 9 ++++++ .../eclipse/jetty/io/bio/StringEndPoint.java | 1 - .../eclipse/jetty/io/nio/DirectNIOBuffer.java | 4 +++ .../jetty/io/nio/RandomAccessFileBuffer.java | 3 ++ .../jetty/io/nio/SelectChannelEndPoint.java | 9 +++++- .../eclipse/jetty/io/nio/SelectorManager.java | 6 ++-- .../org/eclipse/jetty/io/BufferCacheTest.java | 2 ++ .../java/org/eclipse/jetty/io/BufferTest.java | 2 ++ .../jetty/io/ThreadLocalBuffersTest.java | 5 ++-- .../security/jaspi/JaspiAuthenticator.java | 6 ++-- .../jaspi/JaspiAuthenticatorFactory.java | 2 +- .../plus/annotation/InjectionCollection.java | 5 ---- .../security/DefaultIdentityService.java | 1 - .../jetty/security/DefaultUserIdentity.java | 1 + .../jetty/security/SecurityHandler.java | 1 - .../authentication/BasicAuthenticator.java | 2 +- .../ClientCertAuthenticator.java | 2 +- .../authentication/DigestAuthenticator.java | 2 +- .../authentication/FormAuthenticator.java | 3 +- .../authentication/LoginCallbackImpl.java | 1 - .../jetty/security/Constrain2tTest.java | 2 ++ .../jetty/security/ConstraintTest.java | 2 ++ .../jetty/server/AbstractConnector.java | 10 +++++++ .../jetty/server/AsyncContinuation.java | 7 +++-- .../eclipse/jetty/server/Authentication.java | 15 ++++++---- .../eclipse/jetty/server/CookieCutter.java | 2 -- .../org/eclipse/jetty/server/Dispatcher.java | 2 ++ .../eclipse/jetty/server/HttpConnection.java | 28 +++++++++++++------ .../org/eclipse/jetty/server/HttpInput.java | 2 ++ .../org/eclipse/jetty/server/HttpOutput.java | 6 ++++ .../org/eclipse/jetty/server/HttpWriter.java | 4 +++ .../eclipse/jetty/server/LocalConnector.java | 1 + .../eclipse/jetty/server/NCSARequestLog.java | 2 ++ .../org/eclipse/jetty/server/Request.java | 2 ++ .../eclipse/jetty/server/ResourceCache.java | 5 +++- .../org/eclipse/jetty/server/Response.java | 8 ++++-- .../java/org/eclipse/jetty/server/Server.java | 11 ++++---- .../eclipse/jetty/server/SessionManager.java | 2 ++ .../eclipse/jetty/server/UserIdentity.java | 1 + .../jetty/server/bio/SocketConnector.java | 7 ++++- .../jetty/server/handler/AbstractHandler.java | 3 ++ .../handler/AbstractHandlerContainer.java | 1 + .../jetty/server/handler/ContextHandler.java | 9 ++++-- .../handler/ContextHandlerCollection.java | 4 ++- .../jetty/server/handler/DebugHandler.java | 3 ++ .../jetty/server/handler/DefaultHandler.java | 1 - .../jetty/server/handler/ErrorHandler.java | 2 -- .../server/handler/HandlerCollection.java | 4 +++ .../jetty/server/handler/HandlerList.java | 2 +- .../jetty/server/handler/HandlerWrapper.java | 3 +- .../jetty/server/handler/HotSwapHandler.java | 6 ++-- .../server/handler/MovedContextHandler.java | 1 - .../server/handler/RequestLogHandler.java | 5 +++- .../jetty/server/handler/ResourceHandler.java | 1 + .../jetty/server/handler/ScopedHandler.java | 1 + .../server/handler/StatisticsHandler.java | 3 ++ .../server/nio/AbstractNIOConnector.java | 8 ++++-- .../server/nio/BlockingChannelConnector.java | 2 ++ .../server/nio/InheritedChannelConnector.java | 1 + .../server/nio/SelectChannelConnector.java | 14 ++++++++++ .../session/AbstractSessionIdManager.java | 1 + .../session/AbstractSessionManager.java | 13 ++++++++- .../server/session/HashSessionIdManager.java | 2 ++ .../server/session/HashSessionManager.java | 16 +++++++++++ .../server/session/JDBCSessionIdManager.java | 3 ++ .../server/session/JDBCSessionManager.java | 27 +++++++++++++++--- .../jetty/server/session/SessionHandler.java | 5 +++- .../server/ssl/SslSelectChannelConnector.java | 7 +++++ .../jetty/server/ssl/SslSocketConnector.java | 8 +++++- .../jetty/server/AsyncContextTest.java | 7 +++++ .../eclipse/jetty/server/AsyncStressTest.java | 8 ++++-- .../eclipse/jetty/server/AsyncUploadTest.java | 1 + .../server/BusySelectChannelServerTest.java | 5 ++++ .../jetty/server/HttpConnectionTest.java | 4 +-- .../eclipse/jetty/server/HttpWriterTest.java | 4 +-- .../org/eclipse/jetty/server/RFC2616Test.java | 1 + .../org/eclipse/jetty/server/RequestTest.java | 2 ++ .../jetty/server/ResourceCacheTest.java | 2 ++ .../eclipse/jetty/server/ResponseTest.java | 2 ++ .../org/eclipse/jetty/server/StressTest.java | 11 ++++---- .../eclipse/jetty/server/UnreadInputTest.java | 11 ++++++-- .../handler/ContextHandlerCollectionTest.java | 1 - .../server/handler/ContextHandlerTest.java | 1 - .../server/handler/ScopedHandlerTest.java | 7 +++-- .../server/handler/StatisticsHandlerTest.java | 5 ++++ .../jetty/server/ssl/SSLEngineTest.java | 2 ++ .../jetty/server/ssl/SslUploadTest.java | 6 ++-- .../org/eclipse/jetty/servlet/Holder.java | 1 - .../jetty/servlet/StatisticsServlet.java | 1 + .../jetty/servlet/DefaultServletTest.java | 1 + .../eclipse/jetty/servlet/InvokerTest.java | 2 ++ .../jetty/servlet/StatisticsServletTest.java | 7 ++--- .../jetty/servlets/CrossOriginFilter.java | 1 + .../jetty/servlets/IncludableGzipFilter.java | 1 + .../org/eclipse/jetty/servlets/QoSFilter.java | 1 - .../org/eclipse/jetty/util/ArrayQueue.java | 4 +++ .../org/eclipse/jetty/util/AttributesMap.java | 1 + .../jetty/util/BlockingArrayQueue.java | 8 ++++++ .../jetty/util/ByteArrayISO8859Writer.java | 6 ++++ .../main/java/org/eclipse/jetty/util/IO.java | 14 +++++++++- .../java/org/eclipse/jetty/util/LazyList.java | 2 +- .../eclipse/jetty/util/MultiException.java | 4 +++ .../java/org/eclipse/jetty/util/MultiMap.java | 2 ++ .../jetty/util/MultiPartOutputStream.java | 1 + .../eclipse/jetty/util/MultiPartWriter.java | 1 + .../jetty/util/QuotedStringTokenizer.java | 6 ++++ .../jetty/util/RolloverFileOutputStream.java | 4 +++ .../org/eclipse/jetty/util/SingletonList.java | 5 ++++ .../org/eclipse/jetty/util/StringMap.java | 10 +++++++ .../org/eclipse/jetty/util/UrlEncoded.java | 3 +- .../eclipse/jetty/util/Utf8StringBuffer.java | 1 + .../eclipse/jetty/util/Utf8StringBuilder.java | 1 + .../org/eclipse/jetty/util/ajax/JSON.java | 12 +++++--- .../jetty/util/ajax/JSONPojoConvertor.java | 4 +-- .../jetty/util/component/Container.java | 3 ++ .../org/eclipse/jetty/util/log/Slf4jLog.java | 1 + .../jetty/util/resource/BadResource.java | 11 ++++++++ .../jetty/util/resource/FileResource.java | 15 ++++++++++ .../jetty/util/resource/JarFileResource.java | 10 +++++++ .../jetty/util/resource/JarResource.java | 6 ++++ .../eclipse/jetty/util/resource/Resource.java | 1 + .../util/resource/ResourceCollection.java | 13 +++++++++ .../jetty/util/resource/URLResource.java | 18 ++++++++++++ .../util/thread/OldQueuedThreadPool.java | 3 ++ .../jetty/util/thread/QueuedThreadPool.java | 1 + .../eclipse/jetty/util/thread/Timeout.java | 1 + .../jetty/util/BlockingArrayQueueTest.java | 3 ++ .../org/eclipse/jetty/util/StringMapTest.java | 2 ++ .../eclipse/jetty/util/StringUtilTest.java | 2 ++ .../jetty/util/TestIntrospectionUtil.java | 1 + .../ajax/JSONPojoConvertorFactoryTest.java | 8 ++++-- .../util/ajax/JSONPojoConvertorTest.java | 4 +++ .../util/component/LifeCycleListenerTest.java | 2 ++ .../jetty/util/resource/ResourceTest.java | 2 ++ .../jetty/util/thread/TimeoutTest.java | 6 +++- ...CentralizedWebAppLoggingConfiguration.java | 1 + .../webapp/logging/MavenTestingUtils.java | 1 + .../verifier/rules/JarSignatureRule.java | 1 + .../verifier/AbstractTestWebappVerifier.java | 1 + .../verifier/rules/JarSignatureRuleTest.java | 1 - .../rules/JavaSupportLevelRuleTest.java | 4 +-- .../verifier/rules/NoNativeRuleTest.java | 4 +-- .../rules/NoSourceControlRuleTest.java | 4 +-- .../rules/ServletSupportLevelRuleTest.java | 4 +-- .../jetty/webapp/FragmentConfiguration.java | 1 - .../org/eclipse/jetty/webapp/JarScanner.java | 2 -- .../jetty/webapp/TagLibConfiguration.java | 1 + .../jetty/webapp/WebAppClassLoader.java | 3 -- .../jetty/webapp/WebXmlConfiguration.java | 1 - .../java/org/eclipse/jetty/xml/XmlParser.java | 1 + .../continuation/test/ContinuationBase.java | 8 ++++-- .../jetty/continuation/ContinuationTest.java | 2 ++ .../org/eclipse/jetty/testing/HttpTester.java | 6 ++++ .../eclipse/jetty/testing/ServletTest.java | 7 +++++ .../src/main/java/com/acme/ChatServlet.java | 2 ++ .../src/main/java/com/acme/CookieDump.java | 12 ++------ .../main/java/com/acme/DispatchServlet.java | 11 +++----- .../src/main/java/com/acme/Dump.java | 4 +++ .../main/java/com/acme/RewriteServlet.java | 11 ++------ .../main/java/com/acme/SecureModeServlet.java | 11 ++++---- .../src/main/java/com/acme/SessionDump.java | 4 +++ .../src/main/java/com/acme/TestListener.java | 5 +--- .../java/org/eclipse/jetty/DemoServer.java | 2 -- .../rawhttp/HttpResponseTesterTest.java | 6 ++-- .../test/support/rawhttp/HttpTesting.java | 1 - 234 files changed, 854 insertions(+), 243 deletions(-) diff --git a/example-jetty-embedded/src/main/java/org/eclipse/jetty/embedded/HelloServlet.java b/example-jetty-embedded/src/main/java/org/eclipse/jetty/embedded/HelloServlet.java index fc98328be87..76b201e82ed 100644 --- a/example-jetty-embedded/src/main/java/org/eclipse/jetty/embedded/HelloServlet.java +++ b/example-jetty-embedded/src/main/java/org/eclipse/jetty/embedded/HelloServlet.java @@ -35,6 +35,7 @@ public class HelloServlet extends HttpServlet greeting = hi; } + @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html"); diff --git a/example-jetty-embedded/src/main/java/org/eclipse/jetty/embedded/LikeJettyXml.java b/example-jetty-embedded/src/main/java/org/eclipse/jetty/embedded/LikeJettyXml.java index 0aaf5976159..f625cab7f7d 100644 --- a/example-jetty-embedded/src/main/java/org/eclipse/jetty/embedded/LikeJettyXml.java +++ b/example-jetty-embedded/src/main/java/org/eclipse/jetty/embedded/LikeJettyXml.java @@ -15,9 +15,6 @@ package org.eclipse.jetty.embedded; import java.lang.management.ManagementFactory; -import javax.management.MBeanConstructorInfo; -import javax.management.MBeanServer; - import org.eclipse.jetty.deploy.ContextDeployer; import org.eclipse.jetty.deploy.WebAppDeployer; import org.eclipse.jetty.jmx.MBeanContainer; diff --git a/example-jetty-embedded/src/main/java/org/eclipse/jetty/embedded/ManyHandlers.java b/example-jetty-embedded/src/main/java/org/eclipse/jetty/embedded/ManyHandlers.java index 48400d3dc78..45e512f8b62 100644 --- a/example-jetty-embedded/src/main/java/org/eclipse/jetty/embedded/ManyHandlers.java +++ b/example-jetty-embedded/src/main/java/org/eclipse/jetty/embedded/ManyHandlers.java @@ -71,6 +71,7 @@ public class ManyHandlers Handler param = new ParamHandler(); HandlerWrapper wrapper = new HandlerWrapper() { + @Override public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { diff --git a/example-jetty-embedded/src/main/java/org/eclipse/jetty/embedded/MinimalServlets.java b/example-jetty-embedded/src/main/java/org/eclipse/jetty/embedded/MinimalServlets.java index e7636095054..7d299e0683c 100644 --- a/example-jetty-embedded/src/main/java/org/eclipse/jetty/embedded/MinimalServlets.java +++ b/example-jetty-embedded/src/main/java/org/eclipse/jetty/embedded/MinimalServlets.java @@ -46,6 +46,7 @@ public class MinimalServlets public static class HelloServlet extends HttpServlet { + @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html"); diff --git a/jetty-ajp/src/main/java/org/eclipse/jetty/ajp/Ajp13Connection.java b/jetty-ajp/src/main/java/org/eclipse/jetty/ajp/Ajp13Connection.java index 3023e500944..8f81643f980 100644 --- a/jetty-ajp/src/main/java/org/eclipse/jetty/ajp/Ajp13Connection.java +++ b/jetty-ajp/src/main/java/org/eclipse/jetty/ajp/Ajp13Connection.java @@ -52,16 +52,19 @@ public class Ajp13Connection extends HttpConnection ((Ajp13Request)_request).setConnection(this); } + @Override public boolean isConfidential(Request request) { return ((Ajp13Request) request).isSslSecure(); } + @Override public boolean isIntegral(Request request) { return ((Ajp13Request) request).isSslSecure(); } + @Override public ServletInputStream getInputStream() { if (_in == null) diff --git a/jetty-ajp/src/main/java/org/eclipse/jetty/ajp/Ajp13Generator.java b/jetty-ajp/src/main/java/org/eclipse/jetty/ajp/Ajp13Generator.java index 96bb380c1be..dba4a8d003c 100644 --- a/jetty-ajp/src/main/java/org/eclipse/jetty/ajp/Ajp13Generator.java +++ b/jetty-ajp/src/main/java/org/eclipse/jetty/ajp/Ajp13Generator.java @@ -114,6 +114,7 @@ public class Ajp13Generator extends AbstractGenerator } /* ------------------------------------------------------------ */ + @Override public void reset(boolean returnBuffers) { super.reset(returnBuffers); @@ -290,6 +291,7 @@ public class Ajp13Generator extends AbstractGenerator * @return the available space in the buffer. * @throws IOException */ + @Override public int prepareUncheckedAddContent() throws IOException { if (_noContent) @@ -327,6 +329,7 @@ public class Ajp13Generator extends AbstractGenerator } /* ------------------------------------------------------------ */ + @Override public void completeHeader(HttpFields fields, boolean allContentAdded) throws IOException { if (_state != STATE_HEADER) @@ -438,6 +441,7 @@ public class Ajp13Generator extends AbstractGenerator * * @throws IOException */ + @Override public void complete() throws IOException { if (_state == STATE_END) @@ -455,6 +459,7 @@ public class Ajp13Generator extends AbstractGenerator } /* ------------------------------------------------------------ */ + @Override public long flushBuffer() throws IOException { try @@ -699,6 +704,7 @@ public class Ajp13Generator extends AbstractGenerator } /* ------------------------------------------------------------ */ + @Override public boolean isComplete() { return !_expectMore && _state == STATE_END; diff --git a/jetty-ajp/src/main/java/org/eclipse/jetty/ajp/Ajp13Parser.java b/jetty-ajp/src/main/java/org/eclipse/jetty/ajp/Ajp13Parser.java index 182ea032df5..e5c80f20055 100644 --- a/jetty-ajp/src/main/java/org/eclipse/jetty/ajp/Ajp13Parser.java +++ b/jetty-ajp/src/main/java/org/eclipse/jetty/ajp/Ajp13Parser.java @@ -300,7 +300,7 @@ public class Ajp13Parser implements Parser _handler.startForwardRequest(); break; case Ajp13Packet.CPING_REQUEST_ORDINAL: - ((Ajp13Generator) _generator).sendCPong(); + (_generator).sendCPong(); if(_header != null) { @@ -577,7 +577,7 @@ public class Ajp13Parser implements Parser remaining=_buffer.length(); } - chunk=Ajp13RequestPacket.get(_buffer,(int)remaining); + chunk=Ajp13RequestPacket.get(_buffer,remaining); _contentPosition+=chunk.length(); _chunkPosition+=chunk.length(); _contentView.update(chunk); @@ -796,6 +796,7 @@ public class Ajp13Parser implements Parser } /* ------------------------------------------------------------ */ + @Override public int read() throws IOException { int c = -1; @@ -808,6 +809,7 @@ public class Ajp13Parser implements Parser /* * @see java.io.InputStream#read(byte[], int, int) */ + @Override public int read(byte[] b, int off, int len) throws IOException { int l = -1; diff --git a/jetty-ajp/src/main/java/org/eclipse/jetty/ajp/Ajp13Request.java b/jetty-ajp/src/main/java/org/eclipse/jetty/ajp/Ajp13Request.java index d1ae515f6f6..bde26f7a2a3 100644 --- a/jetty-ajp/src/main/java/org/eclipse/jetty/ajp/Ajp13Request.java +++ b/jetty-ajp/src/main/java/org/eclipse/jetty/ajp/Ajp13Request.java @@ -47,6 +47,7 @@ public class Ajp13Request extends Request } /* ------------------------------------------------------------ */ + @Override public String getRemoteUser() { if(_remoteUser != null) @@ -55,6 +56,7 @@ public class Ajp13Request extends Request } /* ------------------------------------------------------------ */ + @Override public String getRemoteAddr() { if (_remoteAddr != null) @@ -67,12 +69,14 @@ public class Ajp13Request extends Request /* ------------------------------------------------------------ */ + @Override public void setRemoteAddr(String remoteAddr) { _remoteAddr = remoteAddr; } /* ------------------------------------------------------------ */ + @Override public String getRemoteHost() { if (_remoteHost != null) @@ -83,6 +87,7 @@ public class Ajp13Request extends Request } /* ------------------------------------------------------------ */ + @Override public void setRemoteHost(String remoteHost) { _remoteHost = remoteHost; @@ -101,6 +106,7 @@ public class Ajp13Request extends Request } /* ------------------------------------------------------------ */ + @Override protected void recycle() { super.recycle(); diff --git a/jetty-ajp/src/main/java/org/eclipse/jetty/ajp/Ajp13SocketConnector.java b/jetty-ajp/src/main/java/org/eclipse/jetty/ajp/Ajp13SocketConnector.java index eee96e5a49d..9e94bdad38f 100644 --- a/jetty-ajp/src/main/java/org/eclipse/jetty/ajp/Ajp13SocketConnector.java +++ b/jetty-ajp/src/main/java/org/eclipse/jetty/ajp/Ajp13SocketConnector.java @@ -41,6 +41,7 @@ public class Ajp13SocketConnector extends SocketConnector super.setMaxIdleTime(900000); } + @Override protected void doStart() throws Exception { super.doStart(); @@ -53,6 +54,7 @@ public class Ajp13SocketConnector extends SocketConnector /* (non-Javadoc) * @see org.eclipse.jetty.server.bio.SocketConnector#customize(org.eclipse.io.EndPoint, org.eclipse.jetty.server.Request) */ + @Override public void customize(EndPoint endpoint, Request request) throws IOException { super.customize(endpoint,request); @@ -61,6 +63,7 @@ public class Ajp13SocketConnector extends SocketConnector } /* ------------------------------------------------------------ */ + @Override protected HttpConnection newHttpConnection(EndPoint endpoint) { return new Ajp13Connection(this,endpoint,getServer()); @@ -68,6 +71,7 @@ public class Ajp13SocketConnector extends SocketConnector /* ------------------------------------------------------------ */ // Secured on a packet by packet bases not by connection + @Override public boolean isConfidential(Request request) { return ((Ajp13Request) request).isSslSecure(); @@ -75,24 +79,28 @@ public class Ajp13SocketConnector extends SocketConnector /* ------------------------------------------------------------ */ // Secured on a packet by packet bases not by connection + @Override public boolean isIntegral(Request request) { return ((Ajp13Request) request).isSslSecure(); } /* ------------------------------------------------------------ */ + @Override public void setHeaderBufferSize(int headerBufferSize) { Log.debug(Log.IGNORED); } /* ------------------------------------------------------------ */ + @Override public void setRequestBufferSize(int requestBufferSize) { Log.debug(Log.IGNORED); } /* ------------------------------------------------------------ */ + @Override public void setResponseBufferSize(int responseBufferSize) { Log.debug(Log.IGNORED); diff --git a/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/AbstractConfiguration.java b/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/AbstractConfiguration.java index 6103cff8045..8f275e9bc0c 100644 --- a/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/AbstractConfiguration.java +++ b/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/AbstractConfiguration.java @@ -22,9 +22,9 @@ import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.resource.Resource; import org.eclipse.jetty.webapp.Configuration; import org.eclipse.jetty.webapp.WebAppContext; +import org.eclipse.jetty.webapp.WebInfConfiguration; import org.eclipse.jetty.webapp.WebXmlProcessor; import org.eclipse.jetty.webapp.WebXmlProcessor.Descriptor; -import org.eclipse.jetty.webapp.WebInfConfiguration; public abstract class AbstractConfiguration implements Configuration diff --git a/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/RunAsAnnotationHandler.java b/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/RunAsAnnotationHandler.java index 64502e98ada..4bd72384ec2 100644 --- a/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/RunAsAnnotationHandler.java +++ b/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/RunAsAnnotationHandler.java @@ -15,12 +15,9 @@ package org.eclipse.jetty.annotations; import java.util.List; -import javax.annotation.security.RunAs; - import org.eclipse.jetty.annotations.AnnotationParser.AnnotationHandler; import org.eclipse.jetty.annotations.AnnotationParser.Value; import org.eclipse.jetty.plus.annotation.RunAsCollection; -import org.eclipse.jetty.util.Loader; import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.webapp.WebAppContext; diff --git a/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/Util.java b/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/Util.java index c3bfbbb3657..34ebe8d52e4 100644 --- a/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/Util.java +++ b/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/Util.java @@ -14,7 +14,6 @@ package org.eclipse.jetty.annotations; import java.lang.reflect.Array; -import java.util.List; import org.eclipse.jetty.util.Loader; import org.eclipse.jetty.util.TypeUtil; diff --git a/jetty-annotations/src/test/java/org/eclipse/jetty/annotations/TestAnnotationInheritance.java b/jetty-annotations/src/test/java/org/eclipse/jetty/annotations/TestAnnotationInheritance.java index 8c6f8e65825..3326e1bcce0 100644 --- a/jetty-annotations/src/test/java/org/eclipse/jetty/annotations/TestAnnotationInheritance.java +++ b/jetty-annotations/src/test/java/org/eclipse/jetty/annotations/TestAnnotationInheritance.java @@ -13,15 +13,10 @@ package org.eclipse.jetty.annotations; -import java.lang.reflect.Field; -import java.lang.reflect.Method; import java.util.ArrayList; -import java.util.Iterator; import java.util.List; import java.util.Map; -import javax.annotation.Resource; -import javax.annotation.Resources; import javax.naming.Context; import javax.naming.InitialContext; @@ -29,16 +24,7 @@ import junit.framework.TestCase; import org.eclipse.jetty.annotations.AnnotationParser.AnnotationHandler; import org.eclipse.jetty.annotations.AnnotationParser.Value; -import org.eclipse.jetty.annotations.resources.ResourceA; -import org.eclipse.jetty.annotations.resources.ResourceB; -import org.eclipse.jetty.plus.annotation.Injection; -import org.eclipse.jetty.plus.annotation.InjectionCollection; -import org.eclipse.jetty.plus.annotation.LifeCycleCallbackCollection; -import org.eclipse.jetty.plus.annotation.RunAsCollection; -import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.util.Loader; import org.eclipse.jetty.util.MultiMap; -import org.eclipse.jetty.webapp.WebAppContext; /** * TestAnnotationInheritance diff --git a/jetty-annotations/src/test/java/org/eclipse/jetty/annotations/resources/TestResourceAnnotations.java b/jetty-annotations/src/test/java/org/eclipse/jetty/annotations/resources/TestResourceAnnotations.java index 956aebeb7d8..5f951489dbc 100644 --- a/jetty-annotations/src/test/java/org/eclipse/jetty/annotations/resources/TestResourceAnnotations.java +++ b/jetty-annotations/src/test/java/org/eclipse/jetty/annotations/resources/TestResourceAnnotations.java @@ -8,6 +8,8 @@ import java.util.List; import javax.naming.Context; import javax.naming.InitialContext; +import junit.framework.TestCase; + import org.eclipse.jetty.annotations.AnnotationParser; import org.eclipse.jetty.annotations.ClassNameResolver; import org.eclipse.jetty.annotations.ResourceAnnotationHandler; @@ -17,8 +19,6 @@ import org.eclipse.jetty.plus.annotation.InjectionCollection; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.webapp.WebAppContext; -import junit.framework.TestCase; - public class TestResourceAnnotations extends TestCase { diff --git a/jetty-centralized-logging/src/test/java/org/eclipse/jetty/logging/MavenTestingUtils.java b/jetty-centralized-logging/src/test/java/org/eclipse/jetty/logging/MavenTestingUtils.java index 27410553bc4..e3abc6d6149 100644 --- a/jetty-centralized-logging/src/test/java/org/eclipse/jetty/logging/MavenTestingUtils.java +++ b/jetty-centralized-logging/src/test/java/org/eclipse/jetty/logging/MavenTestingUtils.java @@ -18,10 +18,11 @@ package org.eclipse.jetty.logging; import java.io.File; import java.io.FileReader; import java.io.IOException; -import org.eclipse.jetty.logging.impl.io.LogIO; import junit.framework.TestCase; +import org.eclipse.jetty.logging.impl.io.LogIO; + /** * Common utility methods for working with JUnit tests cases in a maven friendly way. */ diff --git a/jetty-centralized-logging/src/test/java/org/eclipse/jetty/logging/impl/TestAppender.java b/jetty-centralized-logging/src/test/java/org/eclipse/jetty/logging/impl/TestAppender.java index f322f8489a5..33ca040a710 100644 --- a/jetty-centralized-logging/src/test/java/org/eclipse/jetty/logging/impl/TestAppender.java +++ b/jetty-centralized-logging/src/test/java/org/eclipse/jetty/logging/impl/TestAppender.java @@ -23,8 +23,6 @@ import java.util.Map; import java.util.Set; import java.util.TreeSet; -import org.eclipse.jetty.logging.impl.Appender; -import org.eclipse.jetty.logging.impl.Severity; import org.slf4j.MDC; /** diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/Address.java b/jetty-client/src/main/java/org/eclipse/jetty/client/Address.java index a5576318b59..f6a84649bb7 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/Address.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/Address.java @@ -47,6 +47,7 @@ public class Address this.port = port; } + @Override public boolean equals(Object obj) { if (this == obj) return true; @@ -56,6 +57,7 @@ public class Address return port == that.port; } + @Override public int hashCode() { int result = host.hashCode(); diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/CachedExchange.java b/jetty-client/src/main/java/org/eclipse/jetty/client/CachedExchange.java index 1d78b59ca2d..de1e9933dd7 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/CachedExchange.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/CachedExchange.java @@ -49,12 +49,14 @@ public class CachedExchange extends HttpExchange return _responseFields; } + @Override protected void onResponseStatus(Buffer version, int status, Buffer reason) throws IOException { _responseStatus = status; super.onResponseStatus(version, status, reason); } + @Override protected void onResponseHeader(Buffer name, Buffer value) throws IOException { if (_responseFields != null) diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpClient.java b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpClient.java index 2ecef12fe09..5647c1b7446 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpClient.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpClient.java @@ -386,6 +386,7 @@ public class HttpClient extends HttpBuffers implements Attributes /** * @see org.eclipse.jetty.http.HttpBuffers#newResponseHeader(int) */ + @Override protected Buffer newResponseHeader(int size) { if (_connectorType == CONNECTOR_SOCKET) @@ -394,6 +395,7 @@ public class HttpClient extends HttpBuffers implements Attributes } /* ------------------------------------------------------------------------------- */ + @Override protected boolean isRequestHeader(Buffer buffer) { if (_connectorType == CONNECTOR_SOCKET) @@ -402,6 +404,7 @@ public class HttpClient extends HttpBuffers implements Attributes } /* ------------------------------------------------------------------------------- */ + @Override protected boolean isResponseHeader(Buffer buffer) { if (_connectorType == CONNECTOR_SOCKET) @@ -423,6 +426,7 @@ public class HttpClient extends HttpBuffers implements Attributes } /* ------------------------------------------------------------ */ + @Override protected void doStart() throws Exception { super.doStart(); @@ -486,6 +490,7 @@ public class HttpClient extends HttpBuffers implements Attributes } /* ------------------------------------------------------------ */ + @Override protected void doStop() throws Exception { _connector.stop(); diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpConnection.java b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpConnection.java index b8dd9d6db87..efc479eaa93 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpConnection.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpConnection.java @@ -49,7 +49,6 @@ public class HttpConnection implements Connection private boolean _http11 = true; private Buffer _connectionHeader; private Buffer _requestContentChunk; - private long _last; private boolean _requestComplete; private boolean _reserved; // The current exchange waiting for a response @@ -527,6 +526,7 @@ public class HttpConnection implements Connection } } + @Override public String toString() { return "HttpConnection@" + hashCode() + "//" + _destination.getAddress().getHost() + ":" + _destination.getAddress().getPort(); diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpDestination.java b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpDestination.java index faaab2d3a32..bef8467c91b 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpDestination.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpDestination.java @@ -171,7 +171,8 @@ public class HttpDestination { try { - Thread.currentThread().sleep(200); + Thread.currentThread(); + Thread.sleep(200); timeout-=200; } catch (InterruptedException e) @@ -475,7 +476,7 @@ public class HttpDestination { Authorization auth = (Authorization)_authorizations.match(ex.getURI()); if (auth != null) - ((Authorization)auth).setCredentials(ex); + (auth).setCredentials(ex); } HttpConnection connection = getIdleConnection(); @@ -498,6 +499,7 @@ public class HttpDestination } } + @Override public synchronized String toString() { return "HttpDestination@" + hashCode() + "//" + _address.getHost() + ":" + _address.getPort() + "(" + _connections.size() + "," + _idle.size() + "," + _queue.size() + ")"; diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpExchange.java b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpExchange.java index c317aa6d421..044fe411c60 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpExchange.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpExchange.java @@ -25,8 +25,8 @@ import org.eclipse.jetty.http.HttpSchemes; import org.eclipse.jetty.http.HttpURI; import org.eclipse.jetty.http.HttpVersions; import org.eclipse.jetty.io.Buffer; -import org.eclipse.jetty.io.BufferCache.CachedBuffer; import org.eclipse.jetty.io.ByteArrayBuffer; +import org.eclipse.jetty.io.BufferCache.CachedBuffer; import org.eclipse.jetty.util.log.Log; @@ -110,6 +110,7 @@ public class HttpExchange * @throws InterruptedException if the waiting thread is interrupted * @deprecated Use {@link #waitForDone()} instead */ + @Deprecated public void waitForStatus(int status) throws InterruptedException { throw new UnsupportedOperationException(); @@ -644,6 +645,7 @@ public class HttpExchange return result; } + @Override public String toString() { return getClass().getSimpleName() + "@" + hashCode() + "=" + _method + "//" + _address + _uri + "#" + getStatus(); @@ -891,6 +893,7 @@ public class HttpExchange /** * @deprecated use {@link org.eclipse.jetty.client.CachedExchange} instead */ + @Deprecated public static class CachedExchange extends org.eclipse.jetty.client.CachedExchange { public CachedExchange(boolean cacheFields) @@ -902,6 +905,7 @@ public class HttpExchange /** * @deprecated use {@link org.eclipse.jetty.client.ContentExchange} instead */ + @Deprecated public static class ContentExchange extends org.eclipse.jetty.client.ContentExchange { } diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/SelectConnector.java b/jetty-client/src/main/java/org/eclipse/jetty/client/SelectConnector.java index 3ca3c8f53bd..f7dd6da180c 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/SelectConnector.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/SelectConnector.java @@ -16,6 +16,7 @@ package org.eclipse.jetty.client; import java.io.IOException; import java.nio.channels.SelectionKey; import java.nio.channels.SocketChannel; + import javax.net.ssl.SSLContext; import javax.net.ssl.SSLEngine; import javax.net.ssl.SSLSession; @@ -70,6 +71,7 @@ class SelectConnector extends AbstractLifeCycle implements HttpClient.Connector, } /* ------------------------------------------------------------ */ + @Override protected void doStart() throws Exception { super.doStart(); @@ -119,6 +121,7 @@ class SelectConnector extends AbstractLifeCycle implements HttpClient.Connector, } /* ------------------------------------------------------------ */ + @Override protected void doStop() throws Exception { _selectorManager.stop(); @@ -237,6 +240,7 @@ class SelectConnector extends AbstractLifeCycle implements HttpClient.Connector, /* (non-Javadoc) * @see org.eclipse.io.nio.SelectorManager#connectionFailed(java.nio.channels.SocketChannel, java.lang.Throwable, java.lang.Object) */ + @Override protected void connectionFailed(SocketChannel channel, Throwable ex, Object attachment) { if (attachment instanceof HttpDestination) diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/security/SecurityListener.java b/jetty-client/src/main/java/org/eclipse/jetty/client/security/SecurityListener.java index 9e06a07d49c..d7e828ce1e8 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/security/SecurityListener.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/security/SecurityListener.java @@ -112,6 +112,7 @@ public class SecurityListener extends HttpEventListenerWrapper } + @Override public void onResponseStatus( Buffer version, int status, Buffer reason ) throws IOException { @@ -134,6 +135,7 @@ public class SecurityListener extends HttpEventListenerWrapper } + @Override public void onResponseHeader( Buffer name, Buffer value ) throws IOException { @@ -185,6 +187,7 @@ public class SecurityListener extends HttpEventListenerWrapper } + @Override public void onRequestComplete() throws IOException { _requestComplete = true; @@ -217,6 +220,7 @@ public class SecurityListener extends HttpEventListenerWrapper } + @Override public void onResponseComplete() throws IOException { _responseComplete = true; @@ -248,6 +252,7 @@ public class SecurityListener extends HttpEventListenerWrapper } } + @Override public void onRetry() { _attempts++; diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/webdav/MkcolExchange.java b/jetty-client/src/main/java/org/eclipse/jetty/client/webdav/MkcolExchange.java index c71007686ba..ae7c5264ab2 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/webdav/MkcolExchange.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/webdav/MkcolExchange.java @@ -31,6 +31,7 @@ public class MkcolExchange extends CachedExchange } /* ------------------------------------------------------------ */ + @Override protected void onResponseStatus(Buffer version, int status, Buffer reason) throws IOException { if ( status == HttpStatus.CREATED_201 ) diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/webdav/PropfindExchange.java b/jetty-client/src/main/java/org/eclipse/jetty/client/webdav/PropfindExchange.java index cd286c3e7ee..050b0b86291 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/webdav/PropfindExchange.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/webdav/PropfindExchange.java @@ -26,6 +26,7 @@ public class PropfindExchange extends HttpExchange boolean _propertyExists = false; /* ------------------------------------------------------------ */ + @Override protected void onResponseStatus(Buffer version, int status, Buffer reason) throws IOException { if ( status == HttpStatus.OK_200 ) diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/webdav/WebdavListener.java b/jetty-client/src/main/java/org/eclipse/jetty/client/webdav/WebdavListener.java index 5f94c0dceed..6a929e7a26d 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/webdav/WebdavListener.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/webdav/WebdavListener.java @@ -57,6 +57,7 @@ public class WebdavListener extends HttpEventListenerWrapper } } + @Override public void onResponseStatus(Buffer version, int status, Buffer reason) throws IOException { if ( !_webdavEnabled ) @@ -99,6 +100,7 @@ public class WebdavListener extends HttpEventListenerWrapper super.onResponseStatus(version, status, reason); } + @Override public void onResponseComplete() throws IOException { _responseComplete = true; @@ -147,6 +149,7 @@ public class WebdavListener extends HttpEventListenerWrapper + @Override public void onRequestComplete () throws IOException { _requestComplete = true; diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/webdav/WebdavSupportedExchange.java b/jetty-client/src/main/java/org/eclipse/jetty/client/webdav/WebdavSupportedExchange.java index b75e1d41542..43d0e534b09 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/webdav/WebdavSupportedExchange.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/webdav/WebdavSupportedExchange.java @@ -25,6 +25,7 @@ public class WebdavSupportedExchange extends HttpExchange private boolean _webdavSupported = false; private boolean _isComplete = false; + @Override protected void onResponseHeader(Buffer name, Buffer value) throws IOException { if (Log.isDebugEnabled()) @@ -51,6 +52,7 @@ public class WebdavSupportedExchange extends HttpExchange } } + @Override protected void onResponseComplete() throws IOException { _isComplete = true; diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/AbstractHttpExchangeCancelTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/AbstractHttpExchangeCancelTest.java index acaf958043a..c85992acde4 100644 --- a/jetty-client/src/test/java/org/eclipse/jetty/client/AbstractHttpExchangeCancelTest.java +++ b/jetty-client/src/test/java/org/eclipse/jetty/client/AbstractHttpExchangeCancelTest.java @@ -15,12 +15,14 @@ package org.eclipse.jetty.client; import java.io.IOException; + import javax.servlet.ServletException; import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import junit.framework.TestCase; + import org.eclipse.jetty.io.Buffer; import org.eclipse.jetty.server.Connector; import org.eclipse.jetty.server.Request; diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/AsyncSslHttpExchangeTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/AsyncSslHttpExchangeTest.java index 9739448d363..cc9edfc5977 100644 --- a/jetty-client/src/test/java/org/eclipse/jetty/client/AsyncSslHttpExchangeTest.java +++ b/jetty-client/src/test/java/org/eclipse/jetty/client/AsyncSslHttpExchangeTest.java @@ -16,6 +16,7 @@ package org.eclipse.jetty.client; public class AsyncSslHttpExchangeTest extends SslHttpExchangeTest { + @Override protected void setUp() throws Exception { _scheme="https://"; diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/AsyncSslSecurityListenerTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/AsyncSslSecurityListenerTest.java index 721cc88878e..2a7b1176da8 100644 --- a/jetty-client/src/test/java/org/eclipse/jetty/client/AsyncSslSecurityListenerTest.java +++ b/jetty-client/src/test/java/org/eclipse/jetty/client/AsyncSslSecurityListenerTest.java @@ -16,6 +16,7 @@ package org.eclipse.jetty.client; public class AsyncSslSecurityListenerTest extends SslSecurityListenerTest { + @Override protected void setUp() throws Exception { _type = HttpClient.CONNECTOR_SELECT_CHANNEL; diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/BlockingHttpExchangeCancelTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/BlockingHttpExchangeCancelTest.java index 59eefc1b0ee..d05b39ea7af 100644 --- a/jetty-client/src/test/java/org/eclipse/jetty/client/BlockingHttpExchangeCancelTest.java +++ b/jetty-client/src/test/java/org/eclipse/jetty/client/BlockingHttpExchangeCancelTest.java @@ -37,6 +37,7 @@ public class BlockingHttpExchangeCancelTest extends AbstractHttpExchangeCancelTe super.tearDown(); } + @Override protected HttpClient getHttpClient() { return httpClient; diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/Curl.java b/jetty-client/src/test/java/org/eclipse/jetty/client/Curl.java index 79441a7d6c4..1e7c1da3913 100644 --- a/jetty-client/src/test/java/org/eclipse/jetty/client/Curl.java +++ b/jetty-client/src/test/java/org/eclipse/jetty/client/Curl.java @@ -2,7 +2,6 @@ package org.eclipse.jetty.client; import java.io.IOException; import java.util.concurrent.CountDownLatch; -import java.util.concurrent.CyclicBarrier; import java.util.concurrent.atomic.AtomicBoolean; import org.eclipse.jetty.http.HttpMethods; diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/ExpireTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/ExpireTest.java index 636984bb1d6..71692727d86 100644 --- a/jetty-client/src/test/java/org/eclipse/jetty/client/ExpireTest.java +++ b/jetty-client/src/test/java/org/eclipse/jetty/client/ExpireTest.java @@ -119,6 +119,7 @@ public class ExpireTest extends TestCase expireCount.incrementAndGet(); final ContentExchange ex = new ContentExchange() { + @Override protected void onExpire() { expireCount.decrementAndGet(); diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/ExternalKeyStoreAsyncSslHttpExchangeTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/ExternalKeyStoreAsyncSslHttpExchangeTest.java index 97f712f33a6..02d79867c16 100644 --- a/jetty-client/src/test/java/org/eclipse/jetty/client/ExternalKeyStoreAsyncSslHttpExchangeTest.java +++ b/jetty-client/src/test/java/org/eclipse/jetty/client/ExternalKeyStoreAsyncSslHttpExchangeTest.java @@ -18,6 +18,7 @@ import java.io.File; public class ExternalKeyStoreAsyncSslHttpExchangeTest extends SslHttpExchangeTest { + @Override protected void setUp() throws Exception { _scheme="https://"; diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/HttpExchangeTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/HttpExchangeTest.java index 8c116505332..d42d048b99e 100644 --- a/jetty-client/src/test/java/org/eclipse/jetty/client/HttpExchangeTest.java +++ b/jetty-client/src/test/java/org/eclipse/jetty/client/HttpExchangeTest.java @@ -34,7 +34,6 @@ import org.eclipse.jetty.io.Buffer; import org.eclipse.jetty.io.ByteArrayBuffer; import org.eclipse.jetty.io.EofException; import org.eclipse.jetty.server.Connector; -import org.eclipse.jetty.server.HttpConnection; import org.eclipse.jetty.server.Request; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.handler.AbstractHandler; @@ -57,6 +56,7 @@ public class HttpExchangeTest extends TestCase protected Connector _connector; protected AtomicInteger _count = new AtomicInteger(); + @Override protected void setUp() throws Exception { startServer(); @@ -66,6 +66,7 @@ public class HttpExchangeTest extends TestCase _httpClient.start(); } + @Override protected void tearDown() throws Exception { _httpClient.stop(); @@ -115,40 +116,47 @@ public class HttpExchangeTest extends TestCase { String result="pending"; int len=0; + @Override protected void onRequestCommitted() { result="committed"; // System.err.println(n+" Request committed: "+close); } + @Override protected void onRequestComplete() throws IOException { result="sent"; } + @Override protected void onResponseStatus(Buffer version, int status, Buffer reason) { result="status"; // System.err.println(n+" Response Status: " + version+" "+status+" "+reason); } + @Override protected void onResponseHeader(Buffer name, Buffer value) { // System.err.println(n+" Response header: " + name + " = " + value); } + @Override protected void onResponseHeaderComplete() throws IOException { result="content"; super.onResponseHeaderComplete(); } + @Override protected void onResponseContent(Buffer content) { len+=content.length(); // System.err.println(n+" Response content:" + content.length()); } + @Override protected void onResponseComplete() { result="complete"; @@ -160,6 +168,7 @@ public class HttpExchangeTest extends TestCase complete.countDown(); } + @Override protected void onConnectionFailed(Throwable ex) { complete.countDown(); @@ -168,6 +177,7 @@ public class HttpExchangeTest extends TestCase super.onConnectionFailed(ex); } + @Override protected void onException(Throwable ex) { complete.countDown(); @@ -176,6 +186,7 @@ public class HttpExchangeTest extends TestCase super.onException(ex); } + @Override protected void onExpire() { complete.countDown(); @@ -184,6 +195,7 @@ public class HttpExchangeTest extends TestCase super.onExpire(); } + @Override public String toString() { return n+" "+result+" "+len; diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/NonBlockingHttpExchangeCancelTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/NonBlockingHttpExchangeCancelTest.java index ca5094a4caf..74266bba199 100644 --- a/jetty-client/src/test/java/org/eclipse/jetty/client/NonBlockingHttpExchangeCancelTest.java +++ b/jetty-client/src/test/java/org/eclipse/jetty/client/NonBlockingHttpExchangeCancelTest.java @@ -37,6 +37,7 @@ public class NonBlockingHttpExchangeCancelTest extends AbstractHttpExchangeCance super.tearDown(); } + @Override protected HttpClient getHttpClient() { return httpClient; diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/SecurityListenerTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/SecurityListenerTest.java index d4d36d9183b..7e7fb65e713 100644 --- a/jetty-client/src/test/java/org/eclipse/jetty/client/SecurityListenerTest.java +++ b/jetty-client/src/test/java/org/eclipse/jetty/client/SecurityListenerTest.java @@ -39,7 +39,6 @@ import org.eclipse.jetty.security.LoginService; import org.eclipse.jetty.security.authentication.BasicAuthenticator; import org.eclipse.jetty.server.Connector; import org.eclipse.jetty.server.Handler; -import org.eclipse.jetty.server.HttpConnection; import org.eclipse.jetty.server.Request; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.handler.AbstractHandler; @@ -61,6 +60,7 @@ public class SecurityListenerTest extends TestCase private Realm _jettyRealm; private static final String APP_CONTEXT = "localhost /"; + @Override protected void setUp() throws Exception { startServer(); @@ -90,6 +90,7 @@ public class SecurityListenerTest extends TestCase _httpClient.setRealmResolver( new SimpleRealmResolver(_jettyRealm) ); } + @Override protected void tearDown() throws Exception { stopServer(); @@ -123,26 +124,31 @@ public class SecurityListenerTest extends TestCase HttpExchange httpExchange=new HttpExchange() { + @Override protected void onRequestCommitted() { // System.err.println("Request committed"); } + @Override protected void onResponseStatus(Buffer version, int status, Buffer reason) { // System.err.println("Response Status: " + version+" "+status+" "+reason); } + @Override protected void onResponseHeader(Buffer name, Buffer value) { // System.err.println("Response header: " + name + " = " + value); } + @Override protected void onResponseContent(Buffer content) { // System.err.println("Response content:" + content); } + @Override protected void onResponseComplete() { // System.err.println("Response completed "+n); @@ -202,6 +208,7 @@ public class SecurityListenerTest extends TestCase ContentExchange httpExchange = new ContentExchange() { + @Override protected void onResponseComplete() throws IOException { super.onResponseComplete(); @@ -220,6 +227,7 @@ public class SecurityListenerTest extends TestCase barrier.reset(); ContentExchange httpExchange2 = new ContentExchange() { + @Override protected void onResponseComplete() throws IOException { super.onResponseComplete(); diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/SslHttpExchangeTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/SslHttpExchangeTest.java index 84f4a6e8922..55c4397f954 100644 --- a/jetty-client/src/test/java/org/eclipse/jetty/client/SslHttpExchangeTest.java +++ b/jetty-client/src/test/java/org/eclipse/jetty/client/SslHttpExchangeTest.java @@ -27,6 +27,7 @@ import org.eclipse.jetty.server.ssl.SslSocketConnector; */ public class SslHttpExchangeTest extends HttpExchangeTest { + @Override protected void setUp() throws Exception { _scheme="https://"; @@ -38,6 +39,7 @@ public class SslHttpExchangeTest extends HttpExchangeTest _httpClient.start(); } + @Override protected void newServer() { _server = new Server(); diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/SslSecurityListenerTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/SslSecurityListenerTest.java index df092eb7208..34df08f3e5d 100644 --- a/jetty-client/src/test/java/org/eclipse/jetty/client/SslSecurityListenerTest.java +++ b/jetty-client/src/test/java/org/eclipse/jetty/client/SslSecurityListenerTest.java @@ -40,7 +40,6 @@ import org.eclipse.jetty.security.HashLoginService; import org.eclipse.jetty.security.authentication.BasicAuthenticator; import org.eclipse.jetty.server.Connector; import org.eclipse.jetty.server.Handler; -import org.eclipse.jetty.server.HttpConnection; import org.eclipse.jetty.server.Request; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.handler.AbstractHandler; @@ -58,6 +57,7 @@ public class SslSecurityListenerTest extends TestCase protected int _type = HttpClient.CONNECTOR_SOCKET; private static final String APP_CONTEXT = "localhost /"; + @Override protected void setUp() throws Exception { startServer(); @@ -89,6 +89,7 @@ public class SslSecurityListenerTest extends TestCase _httpClient.setRealmResolver(resolver); } + @Override protected void tearDown() throws Exception { Thread.sleep(1000); @@ -103,6 +104,7 @@ public class SslSecurityListenerTest extends TestCase ContentExchange httpExchange = new ContentExchange(true) { + @Override protected void onResponseComplete() throws IOException { super.onResponseComplete(); diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/WebdavListenerTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/WebdavListenerTest.java index 6917af4b55e..4984788a3b7 100644 --- a/jetty-client/src/test/java/org/eclipse/jetty/client/WebdavListenerTest.java +++ b/jetty-client/src/test/java/org/eclipse/jetty/client/WebdavListenerTest.java @@ -46,6 +46,7 @@ public class WebdavListenerTest extends TestCase//extends HttpExchangeTest + @Override protected void setUp() throws Exception { _singleFileURL = "https://dav.codehaus.org/user/" + _username + "/foo.txt"; @@ -81,6 +82,7 @@ public class WebdavListenerTest extends TestCase//extends HttpExchangeTest } + @Override public void tearDown () throws Exception { _httpClient.stop(); diff --git a/jetty-continuation/src/main/java/org/eclipse/jetty/continuation/ContinuationFilter.java b/jetty-continuation/src/main/java/org/eclipse/jetty/continuation/ContinuationFilter.java index 1587b24fdfa..da730deb7f6 100644 --- a/jetty-continuation/src/main/java/org/eclipse/jetty/continuation/ContinuationFilter.java +++ b/jetty-continuation/src/main/java/org/eclipse/jetty/continuation/ContinuationFilter.java @@ -87,7 +87,7 @@ public class ContinuationFilter implements Filter { try { - if (fc==null || ((FilteredContinuation)fc).enter(response)) + if (fc==null || (fc).enter(response)) chain.doFilter(request,response); } catch (ContinuationThrowable e) @@ -99,7 +99,7 @@ public class ContinuationFilter implements Filter if (fc==null) fc = (FilteredContinuation) request.getAttribute(Continuation.ATTRIBUTE); - complete=fc==null || ((FilteredContinuation)fc).exit(); + complete=fc==null || (fc).exit(); } } } diff --git a/jetty-continuation/src/main/java/org/eclipse/jetty/continuation/ContinuationSupport.java b/jetty-continuation/src/main/java/org/eclipse/jetty/continuation/ContinuationSupport.java index 53b2da65b78..777c61dceb2 100644 --- a/jetty-continuation/src/main/java/org/eclipse/jetty/continuation/ContinuationSupport.java +++ b/jetty-continuation/src/main/java/org/eclipse/jetty/continuation/ContinuationSupport.java @@ -14,12 +14,10 @@ package org.eclipse.jetty.continuation; import java.lang.reflect.Constructor; + import javax.servlet.ServletRequest; import javax.servlet.ServletRequestWrapper; import javax.servlet.ServletResponse; -import javax.servlet.ServletResponseWrapper; - -import org.mortbay.util.ajax.WaitingContinuation; /* ------------------------------------------------------------ */ /** ContinuationSupport. @@ -154,6 +152,7 @@ public class ContinuationSupport * @deprecated use {@link #getContinuation(ServletRequest)} * @return */ + @Deprecated public static Continuation getContinuation(final ServletRequest request, final ServletResponse response) { return getContinuation(request); diff --git a/jetty-continuation/src/main/java/org/eclipse/jetty/continuation/FauxContinuation.java b/jetty-continuation/src/main/java/org/eclipse/jetty/continuation/FauxContinuation.java index 20dfc650897..cede7e22af4 100644 --- a/jetty-continuation/src/main/java/org/eclipse/jetty/continuation/FauxContinuation.java +++ b/jetty-continuation/src/main/java/org/eclipse/jetty/continuation/FauxContinuation.java @@ -425,6 +425,7 @@ class FauxContinuation implements FilteredContinuation this.notifyAll(); } + @Override public String toString() { return getStatusString(); diff --git a/jetty-continuation/src/main/java/org/eclipse/jetty/continuation/Jetty6Continuation.java b/jetty-continuation/src/main/java/org/eclipse/jetty/continuation/Jetty6Continuation.java index c7c74aca2b9..28bda7f16f6 100644 --- a/jetty-continuation/src/main/java/org/eclipse/jetty/continuation/Jetty6Continuation.java +++ b/jetty-continuation/src/main/java/org/eclipse/jetty/continuation/Jetty6Continuation.java @@ -2,6 +2,7 @@ package org.eclipse.jetty.continuation; import java.util.ArrayList; import java.util.List; + import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.ServletResponseWrapper; diff --git a/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/ContextDeployer.java b/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/ContextDeployer.java index dc2c77dba27..5a1971669d5 100644 --- a/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/ContextDeployer.java +++ b/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/ContextDeployer.java @@ -107,6 +107,7 @@ public class ContextDeployer extends AbstractLifeCycle { undeploy(filename); } + @Override public String toString() { return "ContextDeployer$Scanner"; @@ -193,6 +194,7 @@ public class ContextDeployer extends AbstractLifeCycle * @throws Exception * @deprecated use {@link #setContextsDir(String)} */ + @Deprecated public void setConfigurationDir(String dir) throws Exception { setConfigurationDir(Resource.newResource(dir)); @@ -204,6 +206,7 @@ public class ContextDeployer extends AbstractLifeCycle * @throws Exception * @deprecated use {@link #setContextsDir(String)} */ + @Deprecated public void setConfigurationDir(File file) throws Exception { setConfigurationDir(Resource.newResource(file.toURL())); @@ -214,6 +217,7 @@ public class ContextDeployer extends AbstractLifeCycle * @param resource * @deprecated use {@link #setContextsDir(String)} */ + @Deprecated public void setConfigurationDir(Resource resource) { if (isStarted()||isStarting()) @@ -226,6 +230,7 @@ public class ContextDeployer extends AbstractLifeCycle * @param directory * @deprecated use {@link #setContextsDir(String)} */ + @Deprecated public void setDirectory(String directory) throws Exception { setConfigurationDir(directory); @@ -236,6 +241,7 @@ public class ContextDeployer extends AbstractLifeCycle * @return * @deprecated use {@link #setContextsDir(String)} */ + @Deprecated public String getDirectory() { return getConfigurationDir().getName(); @@ -246,6 +252,7 @@ public class ContextDeployer extends AbstractLifeCycle * @return * @deprecated use {@link #setContextsDir(String)} */ + @Deprecated public Resource getConfigurationDir() { return _contextsDir; @@ -359,6 +366,7 @@ public class ContextDeployer extends AbstractLifeCycle * * @see org.eclipse.jetty.util.component.AbstractLifeCycle#doStart() */ + @Override protected void doStart() throws Exception { if (_contextsDir==null) @@ -401,6 +409,7 @@ public class ContextDeployer extends AbstractLifeCycle * * @see org.eclipse.jetty.util.component.AbstractLifeCycle#doStop() */ + @Override protected void doStop() throws Exception { _scanner.removeListener(_scannerListener); diff --git a/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/WebAppDeployer.java b/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/WebAppDeployer.java index 7a7cbae38c9..de78be93366 100644 --- a/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/WebAppDeployer.java +++ b/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/WebAppDeployer.java @@ -164,6 +164,7 @@ public class WebAppDeployer extends AbstractLifeCycle /** * @throws Exception */ + @Override public void doStart() throws Exception { _deployed=new ArrayList(); @@ -292,6 +293,7 @@ public class WebAppDeployer extends AbstractLifeCycle } } + @Override public void doStop() throws Exception { for (int i=_deployed.size();i-->0;) diff --git a/jetty-http/src/main/java/org/eclipse/jetty/http/EncodedHttpURI.java b/jetty-http/src/main/java/org/eclipse/jetty/http/EncodedHttpURI.java index 3279fa3031f..775206c5935 100644 --- a/jetty-http/src/main/java/org/eclipse/jetty/http/EncodedHttpURI.java +++ b/jetty-http/src/main/java/org/eclipse/jetty/http/EncodedHttpURI.java @@ -33,6 +33,7 @@ public class EncodedHttpURI extends HttpURI } + @Override public String getScheme() { if (_scheme==_authority) @@ -55,6 +56,7 @@ public class EncodedHttpURI extends HttpURI return StringUtil.toString(_raw,_scheme,_authority-_scheme-1,_encoding); } + @Override public String getAuthority() { if (_authority==_path) @@ -62,6 +64,7 @@ public class EncodedHttpURI extends HttpURI return StringUtil.toString(_raw,_authority,_path-_authority,_encoding); } + @Override public String getHost() { if (_host==_port) @@ -69,6 +72,7 @@ public class EncodedHttpURI extends HttpURI return StringUtil.toString(_raw,_host,_port-_host,_encoding); } + @Override public int getPort() { if (_port==_path) @@ -76,6 +80,7 @@ public class EncodedHttpURI extends HttpURI return TypeUtil.parseInt(_raw, _port+1, _path-_port-1,10); } + @Override public String getPath() { if (_path==_param) @@ -83,6 +88,7 @@ public class EncodedHttpURI extends HttpURI return StringUtil.toString(_raw,_path,_param-_path,_encoding); } + @Override public String getDecodedPath() { if (_path==_param) @@ -90,6 +96,7 @@ public class EncodedHttpURI extends HttpURI return URIUtil.decodePath(_raw,_path,_param-_path); } + @Override public String getPathAndParam() { if (_path==_query) @@ -97,6 +104,7 @@ public class EncodedHttpURI extends HttpURI return StringUtil.toString(_raw,_path,_query-_path,_encoding); } + @Override public String getCompletePath() { if (_path==_end) @@ -104,6 +112,7 @@ public class EncodedHttpURI extends HttpURI return StringUtil.toString(_raw,_path,_end-_path,_encoding); } + @Override public String getParam() { if (_param==_query) @@ -111,6 +120,7 @@ public class EncodedHttpURI extends HttpURI return StringUtil.toString(_raw,_param+1,_query-_param-1,_encoding); } + @Override public String getQuery() { if (_query==_fragment) @@ -118,11 +128,13 @@ public class EncodedHttpURI extends HttpURI return StringUtil.toString(_raw,_query+1,_fragment-_query-1,_encoding); } + @Override public boolean hasQuery() { return (_fragment>_query); } + @Override public String getFragment() { if (_fragment==_end) @@ -130,6 +142,7 @@ public class EncodedHttpURI extends HttpURI return StringUtil.toString(_raw,_fragment+1,_end-_fragment-1,_encoding); } + @Override public void decodeQueryTo(MultiMap parameters) { if (_query==_fragment) @@ -137,6 +150,7 @@ public class EncodedHttpURI extends HttpURI UrlEncoded.decodeTo(StringUtil.toString(_raw,_query+1,_fragment-_query-1,_encoding),parameters,_encoding); } + @Override public void decodeQueryTo(MultiMap parameters, String encoding) throws UnsupportedEncodingException { @@ -148,6 +162,7 @@ public class EncodedHttpURI extends HttpURI UrlEncoded.decodeTo(StringUtil.toString(_raw,_query+1,_fragment-_query-1,encoding),parameters,encoding); } + @Override public String toString() { if (_rawString==null) diff --git a/jetty-http/src/main/java/org/eclipse/jetty/http/HttpBuffers.java b/jetty-http/src/main/java/org/eclipse/jetty/http/HttpBuffers.java index 71769479c5a..95bcdf84ab1 100644 --- a/jetty-http/src/main/java/org/eclipse/jetty/http/HttpBuffers.java +++ b/jetty-http/src/main/java/org/eclipse/jetty/http/HttpBuffers.java @@ -75,6 +75,7 @@ public abstract class HttpBuffers extends AbstractLifeCycle _responseBuffers.setHeaderSize(6*1024); } + @Override protected void doStart() throws Exception { @@ -85,6 +86,7 @@ public abstract class HttpBuffers extends AbstractLifeCycle * @return Returns the headerBufferSize. * @deprecated use {@link #getRequestHeaderSize()} or {@link #getResponseHeaderSize()} */ + @Deprecated public int getHeaderBufferSize() { return _requestBuffers.getHeaderSize(); @@ -160,6 +162,7 @@ public abstract class HttpBuffers extends AbstractLifeCycle * @param headerBufferSize The headerBufferSize to set. * @deprecated */ + @Deprecated public void setHeaderBufferSize( int headerBufferSize ) { setRequestHeaderSize(headerBufferSize); diff --git a/jetty-http/src/main/java/org/eclipse/jetty/http/HttpException.java b/jetty-http/src/main/java/org/eclipse/jetty/http/HttpException.java index 63dbb2920db..b543b9ee857 100644 --- a/jetty-http/src/main/java/org/eclipse/jetty/http/HttpException.java +++ b/jetty-http/src/main/java/org/eclipse/jetty/http/HttpException.java @@ -79,6 +79,7 @@ public class HttpException extends IOException } /* ------------------------------------------------------------ */ + @Override public String toString() { return ("HttpException("+_status+","+_reason+","+super.getCause()+")"); diff --git a/jetty-http/src/main/java/org/eclipse/jetty/http/HttpFields.java b/jetty-http/src/main/java/org/eclipse/jetty/http/HttpFields.java index f4fc1c825b3..dcc0105986f 100644 --- a/jetty-http/src/main/java/org/eclipse/jetty/http/HttpFields.java +++ b/jetty-http/src/main/java/org/eclipse/jetty/http/HttpFields.java @@ -40,7 +40,6 @@ import org.eclipse.jetty.util.LazyList; import org.eclipse.jetty.util.QuotedStringTokenizer; import org.eclipse.jetty.util.StringMap; import org.eclipse.jetty.util.StringUtil; -import org.eclipse.jetty.util.URIUtil; import org.eclipse.jetty.util.log.Log; /* ------------------------------------------------------------ */ diff --git a/jetty-http/src/main/java/org/eclipse/jetty/http/HttpGenerator.java b/jetty-http/src/main/java/org/eclipse/jetty/http/HttpGenerator.java index 9c89018fd1e..a9929693f51 100644 --- a/jetty-http/src/main/java/org/eclipse/jetty/http/HttpGenerator.java +++ b/jetty-http/src/main/java/org/eclipse/jetty/http/HttpGenerator.java @@ -122,6 +122,7 @@ public class HttpGenerator extends AbstractGenerator } /* ------------------------------------------------------------------------------- */ + @Override public void reset(boolean returnBuffers) { super.reset(returnBuffers); @@ -270,6 +271,7 @@ public class HttpGenerator extends AbstractGenerator * @return the available space in the buffer. * @throws IOException */ + @Override public int prepareUncheckedAddContent() throws IOException { if (_noContent) @@ -301,6 +303,7 @@ public class HttpGenerator extends AbstractGenerator } /* ------------------------------------------------------------ */ + @Override public boolean isBufferFull() { // Should we flush the buffers? @@ -347,6 +350,7 @@ public class HttpGenerator extends AbstractGenerator } /* ------------------------------------------------------------ */ + @Override public void completeHeader(HttpFields fields, boolean allContentAdded) throws IOException { if (_state != STATE_HEADER) @@ -740,6 +744,7 @@ public class HttpGenerator extends AbstractGenerator * * @throws IOException */ + @Override public void complete() throws IOException { if (_state == STATE_END) @@ -758,6 +763,7 @@ public class HttpGenerator extends AbstractGenerator } /* ------------------------------------------------------------ */ + @Override public long flushBuffer() throws IOException { try @@ -979,6 +985,7 @@ public class HttpGenerator extends AbstractGenerator (_content==null||_content.length()==0); } + @Override public String toString() { return "HttpGenerator s="+_state+ diff --git a/jetty-http/src/main/java/org/eclipse/jetty/http/HttpParser.java b/jetty-http/src/main/java/org/eclipse/jetty/http/HttpParser.java index 79113abd8cc..7c8fbf3229f 100644 --- a/jetty-http/src/main/java/org/eclipse/jetty/http/HttpParser.java +++ b/jetty-http/src/main/java/org/eclipse/jetty/http/HttpParser.java @@ -1002,6 +1002,7 @@ public class HttpParser implements Parser } /* ------------------------------------------------------------------------------- */ + @Override public String toString() { return "state=" + _state + " length=" + _length + " len=" + _contentLength; diff --git a/jetty-http/src/main/java/org/eclipse/jetty/http/HttpURI.java b/jetty-http/src/main/java/org/eclipse/jetty/http/HttpURI.java index c8964320cdd..47c67c1a483 100644 --- a/jetty-http/src/main/java/org/eclipse/jetty/http/HttpURI.java +++ b/jetty-http/src/main/java/org/eclipse/jetty/http/HttpURI.java @@ -581,6 +581,7 @@ public class HttpURI _encoded=false; } + @Override public String toString() { if (_rawString==null) diff --git a/jetty-http/src/main/java/org/eclipse/jetty/http/PathMap.java b/jetty-http/src/main/java/org/eclipse/jetty/http/PathMap.java index a7d4d7ff096..2a5b77c0859 100644 --- a/jetty-http/src/main/java/org/eclipse/jetty/http/PathMap.java +++ b/jetty-http/src/main/java/org/eclipse/jetty/http/PathMap.java @@ -143,6 +143,7 @@ public class PathMap extends HashMap implements Externalizable * path specifications. * @param object The object the path maps to */ + @Override public Object put(Object pathSpec, Object object) { StringTokenizer tok = new StringTokenizer(pathSpec.toString(),__pathSpecSeparators); @@ -335,6 +336,7 @@ public class PathMap extends HashMap implements Externalizable } /* --------------------------------------------------------------- */ + @Override public Object remove(Object pathSpec) { if (pathSpec!=null) @@ -362,6 +364,7 @@ public class PathMap extends HashMap implements Externalizable } /* --------------------------------------------------------------- */ + @Override public void clear() { _exactMap.clear(); @@ -537,6 +540,7 @@ public class PathMap extends HashMap implements Externalizable throw new UnsupportedOperationException(); } + @Override public String toString() { if (string==null) diff --git a/jetty-http/src/main/java/org/eclipse/jetty/http/security/Constraint.java b/jetty-http/src/main/java/org/eclipse/jetty/http/security/Constraint.java index 3616984396b..5984c23c89e 100644 --- a/jetty-http/src/main/java/org/eclipse/jetty/http/security/Constraint.java +++ b/jetty-http/src/main/java/org/eclipse/jetty/http/security/Constraint.java @@ -87,6 +87,7 @@ public class Constraint implements Cloneable, Serializable } /* ------------------------------------------------------------ */ + @Override public Object clone() throws CloneNotSupportedException { return super.clone(); @@ -200,6 +201,7 @@ public class Constraint implements Cloneable, Serializable } /* ------------------------------------------------------------ */ + @Override public String toString() { return "SC{" + _name diff --git a/jetty-http/src/main/java/org/eclipse/jetty/http/security/Credential.java b/jetty-http/src/main/java/org/eclipse/jetty/http/security/Credential.java index 73c35c642c7..cd39338a85b 100644 --- a/jetty-http/src/main/java/org/eclipse/jetty/http/security/Credential.java +++ b/jetty-http/src/main/java/org/eclipse/jetty/http/security/Credential.java @@ -13,7 +13,6 @@ package org.eclipse.jetty.http.security; -import java.lang.reflect.Array; import java.security.MessageDigest; import org.eclipse.jetty.util.StringUtil; @@ -81,6 +80,7 @@ public abstract class Credential _cooked = cooked.startsWith(Crypt.__TYPE) ? cooked.substring(__TYPE.length()) : cooked; } + @Override public boolean check(Object credentials) { if (credentials instanceof char[]) @@ -126,6 +126,7 @@ public abstract class Credential } /* ------------------------------------------------------------ */ + @Override public boolean check(Object credentials) { try diff --git a/jetty-http/src/main/java/org/eclipse/jetty/http/security/Password.java b/jetty-http/src/main/java/org/eclipse/jetty/http/security/Password.java index 8af54178490..ea82a409aea 100644 --- a/jetty-http/src/main/java/org/eclipse/jetty/http/security/Password.java +++ b/jetty-http/src/main/java/org/eclipse/jetty/http/security/Password.java @@ -68,6 +68,7 @@ public class Password extends Credential } /* ------------------------------------------------------------ */ + @Override public String toString() { return _pw; @@ -80,6 +81,7 @@ public class Password extends Credential } /* ------------------------------------------------------------ */ + @Override public boolean check(Object credentials) { if (this == credentials) return true; @@ -96,6 +98,7 @@ public class Password extends Credential } /* ------------------------------------------------------------ */ + @Override public boolean equals(Object o) { if (this == o) @@ -118,6 +121,7 @@ public class Password extends Credential } /* ------------------------------------------------------------ */ + @Override public int hashCode() { return null == _pw ? super.hashCode() : _pw.hashCode(); diff --git a/jetty-http/src/main/java/org/eclipse/jetty/http/security/UnixCrypt.java b/jetty-http/src/main/java/org/eclipse/jetty/http/security/UnixCrypt.java index 4eb029c9662..96f472d464c 100644 --- a/jetty-http/src/main/java/org/eclipse/jetty/http/security/UnixCrypt.java +++ b/jetty-http/src/main/java/org/eclipse/jetty/http/security/UnixCrypt.java @@ -23,7 +23,6 @@ package org.eclipse.jetty.http.security; -import org.eclipse.jetty.util.StringUtil; /* ------------------------------------------------------------ */ /** @@ -141,10 +140,10 @@ public class UnixCrypt for (int i = 0; i < 64; i++) { int k; - if ((k = (int) PC2[i]) == 0) continue; + if ((k = PC2[i]) == 0) continue; k += Rotates[0] - 1; if ((k % 28) < Rotates[0]) k -= 28; - k = (int) PC1[k]; + k = PC1[k]; if (k > 0) { k--; @@ -163,12 +162,12 @@ public class UnixCrypt perm[i] = temp[i] = 0; for (int i = 0; i < 64; i++) { - if ((k = (int) PC2[i]) == 0) continue; + if ((k = PC2[i]) == 0) continue; temp[k - 1] = (byte) (i + 1); } for (int i = 0; i < 64; i++) { - if ((k = (int) PC2[i]) == 0) continue; + if ((k = PC2[i]) == 0) continue; k += j; if ((k % 28) <= j) k -= 28; perm[i] = temp[k]; @@ -233,7 +232,7 @@ public class UnixCrypt temp[4 * t + i] = (byte) ((k >> i) & 0x01); long kk = 0; for (int i = 24; --i >= 0;) - kk = ((kk << 1) | ((long) temp[perm[i] - 1]) << 32 | ((long) temp[perm[i + 24] - 1])); + kk = ((kk << 1) | ((long) temp[perm[i] - 1]) << 32 | (temp[perm[i + 24] - 1])); SPE[t][j] = to_six_bit(kk); } diff --git a/jetty-http/src/main/java/org/eclipse/jetty/http/ssl/SslSelectChannelEndPoint.java b/jetty-http/src/main/java/org/eclipse/jetty/http/ssl/SslSelectChannelEndPoint.java index a8cfc03c047..de2543baf1e 100644 --- a/jetty-http/src/main/java/org/eclipse/jetty/http/ssl/SslSelectChannelEndPoint.java +++ b/jetty-http/src/main/java/org/eclipse/jetty/http/ssl/SslSelectChannelEndPoint.java @@ -100,6 +100,7 @@ public class SslSelectChannelEndPoint extends SelectChannelEndPoint /* (non-Javadoc) * @see org.eclipse.io.nio.SelectChannelEndPoint#idleExpired() */ + @Override protected void idleExpired() { try @@ -125,6 +126,7 @@ public class SslSelectChannelEndPoint extends SelectChannelEndPoint } /* ------------------------------------------------------------ */ + @Override public void close() throws IOException { // TODO - this really should not be done in a loop here - but with async callbacks. @@ -816,18 +818,21 @@ public class SslSelectChannelEndPoint extends SelectChannelEndPoint } /* ------------------------------------------------------------ */ + @Override public boolean isBufferingInput() { return _inNIOBuffer.hasContent(); } /* ------------------------------------------------------------ */ + @Override public boolean isBufferingOutput() { return _outNIOBuffer.hasContent(); } /* ------------------------------------------------------------ */ + @Override public boolean isBufferred() { return true; @@ -840,6 +845,7 @@ public class SslSelectChannelEndPoint extends SelectChannelEndPoint } /* ------------------------------------------------------------ */ + @Override public String toString() { return super.toString()+","+_engine.getHandshakeStatus()+", in/out="+_inNIOBuffer.length()+"/"+_outNIOBuffer.length()+" "+_result; diff --git a/jetty-http/src/test/java/org/eclipse/jetty/http/HttpGeneratorClientTest.java b/jetty-http/src/test/java/org/eclipse/jetty/http/HttpGeneratorClientTest.java index e95eab6d8fc..e08612fd850 100644 --- a/jetty-http/src/test/java/org/eclipse/jetty/http/HttpGeneratorClientTest.java +++ b/jetty-http/src/test/java/org/eclipse/jetty/http/HttpGeneratorClientTest.java @@ -236,33 +236,34 @@ public class HttpGeneratorClientTest extends TestCase { view.setPutIndex(i*inc); view.setGetIndex((i-1)*inc); - hb.addContent(view,HttpGenerator.MORE); - if (hb.isBufferFull() && hb.isState(HttpGenerator.STATE_HEADER)) - hb.completeHeader(fields, HttpGenerator.MORE); + hb.addContent(view,Generator.MORE); + if (hb.isBufferFull() && hb.isState(AbstractGenerator.STATE_HEADER)) + hb.completeHeader(fields, Generator.MORE); if (i%2==0) { - if (hb.isState(HttpGenerator.STATE_HEADER)) + if (hb.isState(AbstractGenerator.STATE_HEADER)) { if (version<11) fields.addLongField("Content-Length",body.length()); - hb.completeHeader(fields, HttpGenerator.MORE); + hb.completeHeader(fields, Generator.MORE); } hb.flushBuffer(); } } view.setPutIndex(buf.putIndex()); view.setGetIndex((chunks-1)*inc); - hb.addContent(view,HttpGenerator.LAST); - if(hb.isState(HttpGenerator.STATE_HEADER)) - hb.completeHeader(fields, HttpGenerator.LAST); + hb.addContent(view,Generator.LAST); + if(hb.isState(AbstractGenerator.STATE_HEADER)) + hb.completeHeader(fields, Generator.LAST); } else { - hb.completeHeader(fields, HttpGenerator.LAST); + hb.completeHeader(fields, Generator.LAST); } hb.complete(); } + @Override public String toString() { return "["+values[0]+","+values[1]+","+(body==null?"none":"_content")+"]"; @@ -292,6 +293,7 @@ public class HttpGeneratorClientTest extends TestCase { int index=0; + @Override public void content(Buffer ref) { if (index == 0) @@ -301,6 +303,7 @@ public class HttpGeneratorClientTest extends TestCase } + @Override public void startRequest(Buffer tok0, Buffer tok1, Buffer tok2) { h= -1; @@ -320,6 +323,7 @@ public class HttpGeneratorClientTest extends TestCase /* (non-Javadoc) * @see org.eclipse.jetty.EventHandler#startResponse(org.eclipse.io.Buffer, int, org.eclipse.io.Buffer) */ + @Override public void startResponse(Buffer version, int status, Buffer reason) { h= -1; @@ -334,17 +338,20 @@ public class HttpGeneratorClientTest extends TestCase index=0; } + @Override public void parsedHeader(Buffer name,Buffer value) { hdr[++h]= name.toString(); val[h]= value.toString(); } + @Override public void headerComplete() { content= null; } + @Override public void messageComplete(long contentLength) { } diff --git a/jetty-http/src/test/java/org/eclipse/jetty/http/HttpGeneratorTest.java b/jetty-http/src/test/java/org/eclipse/jetty/http/HttpGeneratorTest.java index c57a2fa9012..17e13f7f024 100644 --- a/jetty-http/src/test/java/org/eclipse/jetty/http/HttpGeneratorTest.java +++ b/jetty-http/src/test/java/org/eclipse/jetty/http/HttpGeneratorTest.java @@ -154,29 +154,30 @@ public class HttpGeneratorTest extends TestCase { view.setPutIndex(i*inc); view.setGetIndex((i-1)*inc); - hb.addContent(view,HttpGenerator.MORE); - if (hb.isBufferFull() && hb.isState(HttpGenerator.STATE_HEADER)) - hb.completeHeader(fields, HttpGenerator.MORE); + hb.addContent(view,Generator.MORE); + if (hb.isBufferFull() && hb.isState(AbstractGenerator.STATE_HEADER)) + hb.completeHeader(fields, Generator.MORE); if (i%2==0) { - if (hb.isState(HttpGenerator.STATE_HEADER)) - hb.completeHeader(fields, HttpGenerator.MORE); + if (hb.isState(AbstractGenerator.STATE_HEADER)) + hb.completeHeader(fields, Generator.MORE); hb.flushBuffer(); } } view.setPutIndex(buf.putIndex()); view.setGetIndex((chunks-1)*inc); - hb.addContent(view,HttpGenerator.LAST); - if(hb.isState(HttpGenerator.STATE_HEADER)) - hb.completeHeader(fields, HttpGenerator.LAST); + hb.addContent(view,Generator.LAST); + if(hb.isState(AbstractGenerator.STATE_HEADER)) + hb.completeHeader(fields, Generator.LAST); } else { - hb.completeHeader(fields, HttpGenerator.LAST); + hb.completeHeader(fields, Generator.LAST); } hb.complete(); } + @Override public String toString() { return "["+code+","+values[0]+","+values[1]+","+(body==null?"none":"_content")+"]"; @@ -207,6 +208,7 @@ public class HttpGeneratorTest extends TestCase { int index=0; + @Override public void content(Buffer ref) { if (index == 0) @@ -216,6 +218,7 @@ public class HttpGeneratorTest extends TestCase } + @Override public void startRequest(Buffer tok0, Buffer tok1, Buffer tok2) { h= -1; @@ -235,6 +238,7 @@ public class HttpGeneratorTest extends TestCase /* (non-Javadoc) * @see org.eclipse.jetty.EventHandler#startResponse(org.eclipse.io.Buffer, int, org.eclipse.io.Buffer) */ + @Override public void startResponse(Buffer version, int status, Buffer reason) { h= -1; @@ -249,17 +253,20 @@ public class HttpGeneratorTest extends TestCase index=0; } + @Override public void parsedHeader(Buffer name,Buffer value) { hdr[++h]= name.toString(); val[h]= value.toString(); } + @Override public void headerComplete() { content= null; } + @Override public void messageComplete(long contentLength) { } diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/AbstractBuffer.java b/jetty-io/src/main/java/org/eclipse/jetty/io/AbstractBuffer.java index adf92c230ba..e2e43804889 100644 --- a/jetty-io/src/main/java/org/eclipse/jetty/io/AbstractBuffer.java +++ b/jetty-io/src/main/java/org/eclipse/jetty/io/AbstractBuffer.java @@ -149,6 +149,7 @@ public abstract class AbstractBuffer implements Buffer } } + @Override public boolean equals(Object obj) { if (obj==this) @@ -274,6 +275,7 @@ public abstract class AbstractBuffer implements Buffer return _put > _get; } + @Override public int hashCode() { if (_hash == 0 || _hashGet!=_get || _hashPut!=_put) @@ -613,6 +615,7 @@ public abstract class AbstractBuffer implements Buffer } /* ------------------------------------------------------------ */ + @Override public String toString() { if (isImmutable()) diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/BufferCache.java b/jetty-io/src/main/java/org/eclipse/jetty/io/BufferCache.java index 5f191dba133..721a7a5f8a5 100644 --- a/jetty-io/src/main/java/org/eclipse/jetty/io/BufferCache.java +++ b/jetty-io/src/main/java/org/eclipse/jetty/io/BufferCache.java @@ -143,6 +143,7 @@ public class BufferCache } + @Override public String toString() { return "CACHE["+ diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/ByteArrayBuffer.java b/jetty-io/src/main/java/org/eclipse/jetty/io/ByteArrayBuffer.java index f1b75ac78d4..6dea1974bd1 100644 --- a/jetty-io/src/main/java/org/eclipse/jetty/io/ByteArrayBuffer.java +++ b/jetty-io/src/main/java/org/eclipse/jetty/io/ByteArrayBuffer.java @@ -97,6 +97,7 @@ public class ByteArrayBuffer extends AbstractBuffer return _bytes.length; } + @Override public void compact() { if (isReadOnly()) @@ -116,6 +117,7 @@ public class ByteArrayBuffer extends AbstractBuffer } + @Override public boolean equals(Object obj) { if (obj==this) @@ -155,6 +157,7 @@ public class ByteArrayBuffer extends AbstractBuffer } + @Override public boolean equalsIgnoreCase(Buffer b) { if (b==this) @@ -206,11 +209,13 @@ public class ByteArrayBuffer extends AbstractBuffer return true; } + @Override public byte get() { return _bytes[_get++]; } + @Override public int hashCode() { if (_hash == 0 || _hashGet!=_get || _hashPut!=_put) @@ -268,6 +273,7 @@ public class ByteArrayBuffer extends AbstractBuffer _bytes[index] = b; } + @Override public int poke(int index, Buffer src) { _hash=0; @@ -303,6 +309,7 @@ public class ByteArrayBuffer extends AbstractBuffer } + @Override public int poke(int index, byte[] b, int offset, int length) { _hash=0; @@ -358,6 +365,7 @@ public class ByteArrayBuffer extends AbstractBuffer } /* ------------------------------------------------------------ */ + @Override public void writeTo(OutputStream out) throws IOException { @@ -366,6 +374,7 @@ public class ByteArrayBuffer extends AbstractBuffer } /* ------------------------------------------------------------ */ + @Override public int readFrom(InputStream in,int max) throws IOException { if (max<0||max>space()) @@ -394,6 +403,7 @@ public class ByteArrayBuffer extends AbstractBuffer } /* ------------------------------------------------------------ */ + @Override public int space() { return _bytes.length - _put; @@ -415,6 +425,7 @@ public class ByteArrayBuffer extends AbstractBuffer super(b,o,l,rw); } + @Override public boolean equals(Object obj) { return obj instanceof Buffer && equalsIgnoreCase((Buffer)obj); diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/ThreadLocalBuffers.java b/jetty-io/src/main/java/org/eclipse/jetty/io/ThreadLocalBuffers.java index 839dab4f7c9..8127d8e153d 100644 --- a/jetty-io/src/main/java/org/eclipse/jetty/io/ThreadLocalBuffers.java +++ b/jetty-io/src/main/java/org/eclipse/jetty/io/ThreadLocalBuffers.java @@ -13,7 +13,6 @@ package org.eclipse.jetty.io; -import org.eclipse.jetty.util.component.AbstractLifeCycle; /* ------------------------------------------------------------ */ /** Abstract Buffer pool. @@ -28,6 +27,7 @@ public abstract class ThreadLocalBuffers implements Buffers /* ------------------------------------------------------------ */ private final ThreadLocal _buffers=new ThreadLocal() { + @Override protected ThreadBuffers initialValue() { return new ThreadBuffers(); diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/UncheckedPrintWriter.java b/jetty-io/src/main/java/org/eclipse/jetty/io/UncheckedPrintWriter.java index 4494c78b897..72f5d5d9034 100644 --- a/jetty-io/src/main/java/org/eclipse/jetty/io/UncheckedPrintWriter.java +++ b/jetty-io/src/main/java/org/eclipse/jetty/io/UncheckedPrintWriter.java @@ -15,8 +15,8 @@ package org.eclipse.jetty.io; import java.io.BufferedWriter; -import java.io.InterruptedIOException; import java.io.IOException; +import java.io.InterruptedIOException; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.PrintWriter; @@ -107,6 +107,7 @@ public class UncheckedPrintWriter extends PrintWriter /** * Flush the stream. */ + @Override public void flush() { try { synchronized (lock) { @@ -125,6 +126,7 @@ public class UncheckedPrintWriter extends PrintWriter /** * Close the stream. */ + @Override public void close() { try { synchronized (lock) { @@ -143,6 +145,7 @@ public class UncheckedPrintWriter extends PrintWriter * Write a single character. * @param c int specifying a character to be written. */ + @Override public void write(int c) { try { synchronized (lock) { @@ -167,6 +170,7 @@ public class UncheckedPrintWriter extends PrintWriter * @param off Offset from which to start writing characters * @param len Number of characters to write */ + @Override public void write(char buf[], int off, int len) { try { synchronized (lock) { @@ -190,6 +194,7 @@ public class UncheckedPrintWriter extends PrintWriter * Writer class because it must suppress I/O exceptions. * @param buf Array of characters to be written */ + @Override public void write(char buf[]) { this.write(buf, 0, buf.length); } @@ -201,6 +206,7 @@ public class UncheckedPrintWriter extends PrintWriter * @param off Offset from which to start writing characters * @param len Number of characters to write */ + @Override public void write(String s, int off, int len) { try { synchronized (lock) { @@ -224,6 +230,7 @@ public class UncheckedPrintWriter extends PrintWriter * because it must suppress I/O exceptions. * @param s String to be written */ + @Override public void write(String s) { this.write(s, 0, s.length()); } @@ -260,6 +267,7 @@ public class UncheckedPrintWriter extends PrintWriter * * @param b The boolean to be printed */ + @Override public void print(boolean b) { this.write(b ? "true" : "false"); } @@ -273,6 +281,7 @@ public class UncheckedPrintWriter extends PrintWriter * * @param c The char to be printed */ + @Override public void print(char c) { this.write(c); } @@ -288,6 +297,7 @@ public class UncheckedPrintWriter extends PrintWriter * @param i The int to be printed * @see java.lang.Integer#toString(int) */ + @Override public void print(int i) { this.write(String.valueOf(i)); } @@ -303,6 +313,7 @@ public class UncheckedPrintWriter extends PrintWriter * @param l The long to be printed * @see java.lang.Long#toString(long) */ + @Override public void print(long l) { this.write(String.valueOf(l)); } @@ -318,6 +329,7 @@ public class UncheckedPrintWriter extends PrintWriter * @param f The float to be printed * @see java.lang.Float#toString(float) */ + @Override public void print(float f) { this.write(String.valueOf(f)); } @@ -333,6 +345,7 @@ public class UncheckedPrintWriter extends PrintWriter * @param d The double to be printed * @see java.lang.Double#toString(double) */ + @Override public void print(double d) { this.write(String.valueOf(d)); } @@ -348,6 +361,7 @@ public class UncheckedPrintWriter extends PrintWriter * * @throws NullPointerException If s is null */ + @Override public void print(char s[]) { this.write(s); } @@ -362,6 +376,7 @@ public class UncheckedPrintWriter extends PrintWriter * * @param s The String to be printed */ + @Override public void print(String s) { if (s == null) { s = "null"; @@ -380,6 +395,7 @@ public class UncheckedPrintWriter extends PrintWriter * @param obj The Object to be printed * @see java.lang.Object#toString() */ + @Override public void print(Object obj) { this.write(String.valueOf(obj)); } @@ -394,6 +410,7 @@ public class UncheckedPrintWriter extends PrintWriter * line.separator, and is not necessarily a single newline * character ('\n'). */ + @Override public void println() { this.newLine(); } @@ -406,6 +423,7 @@ public class UncheckedPrintWriter extends PrintWriter * * @param x the boolean value to be printed */ + @Override public void println(boolean x) { synchronized (lock) { this.print(x); @@ -421,6 +439,7 @@ public class UncheckedPrintWriter extends PrintWriter * * @param x the char value to be printed */ + @Override public void println(char x) { synchronized (lock) { this.print(x); @@ -436,6 +455,7 @@ public class UncheckedPrintWriter extends PrintWriter * * @param x the int value to be printed */ + @Override public void println(int x) { synchronized (lock) { this.print(x); @@ -451,6 +471,7 @@ public class UncheckedPrintWriter extends PrintWriter * * @param x the long value to be printed */ + @Override public void println(long x) { synchronized (lock) { this.print(x); @@ -466,6 +487,7 @@ public class UncheckedPrintWriter extends PrintWriter * * @param x the float value to be printed */ + @Override public void println(float x) { synchronized (lock) { this.print(x); @@ -482,6 +504,7 @@ public class UncheckedPrintWriter extends PrintWriter * @param x the double value to be printed */ /* ------------------------------------------------------------ */ + @Override public void println(double x) { synchronized (lock) { this.print(x); @@ -497,6 +520,7 @@ public class UncheckedPrintWriter extends PrintWriter * * @param x the array of char values to be printed */ + @Override public void println(char x[]) { synchronized (lock) { this.print(x); @@ -512,6 +536,7 @@ public class UncheckedPrintWriter extends PrintWriter * * @param x the String value to be printed */ + @Override public void println(String x) { synchronized (lock) { this.print(x); @@ -527,6 +552,7 @@ public class UncheckedPrintWriter extends PrintWriter * * @param x the Object value to be printed */ + @Override public void println(Object x) { synchronized (lock) { this.print(x); diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/View.java b/jetty-io/src/main/java/org/eclipse/jetty/io/View.java index c1e92bb7466..6555814f082 100644 --- a/jetty-io/src/main/java/org/eclipse/jetty/io/View.java +++ b/jetty-io/src/main/java/org/eclipse/jetty/io/View.java @@ -92,6 +92,7 @@ public class View extends AbstractBuffer /** * @return The {@link Buffer#buffer()} from the underlying buffer. */ + @Override public Buffer buffer() { return _buffer.buffer(); @@ -108,6 +109,7 @@ public class View extends AbstractBuffer /** * */ + @Override public void clear() { setMarkIndex(-1); @@ -119,6 +121,7 @@ public class View extends AbstractBuffer /** * */ + @Override public void compact() { // TODO @@ -129,6 +132,7 @@ public class View extends AbstractBuffer * * @see java.lang.Object#equals(java.lang.Object) */ + @Override public boolean equals(Object obj) { return this==obj ||((obj instanceof Buffer)&& obj.equals(this)) || super.equals(obj); @@ -137,6 +141,7 @@ public class View extends AbstractBuffer /** * @return Whether the underlying buffer is {@link Buffer#isReadOnly read only} */ + @Override public boolean isReadOnly() { return _buffer.isReadOnly(); @@ -145,6 +150,7 @@ public class View extends AbstractBuffer /** * @return Whether the underlying buffer is {@link Buffer#isVolatile volatile} */ + @Override public boolean isVolatile() { return true; @@ -169,6 +175,7 @@ public class View extends AbstractBuffer /** * @return The result of calling {@link Buffer#peek(int, int)} on the underlying buffer */ + @Override public Buffer peek(int index, int length) { return _buffer.peek(index, length); @@ -178,6 +185,7 @@ public class View extends AbstractBuffer * @param index * @param src */ + @Override public int poke(int index, Buffer src) { return _buffer.poke(index,src); @@ -198,11 +206,13 @@ public class View extends AbstractBuffer * @param offset * @param length */ + @Override public int poke(int index, byte[] b, int offset, int length) { return _buffer.poke(index,b,offset,length); } + @Override public String toString() { if (_buffer==null) @@ -227,6 +237,7 @@ public class View extends AbstractBuffer super(buffer); } + @Override public boolean equals(Object obj) { return this==obj ||((obj instanceof Buffer)&&((Buffer)obj).equalsIgnoreCase(this)) || super.equals(obj); diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/WriterOutputStream.java b/jetty-io/src/main/java/org/eclipse/jetty/io/WriterOutputStream.java index 2f024758c22..6db000c45aa 100644 --- a/jetty-io/src/main/java/org/eclipse/jetty/io/WriterOutputStream.java +++ b/jetty-io/src/main/java/org/eclipse/jetty/io/WriterOutputStream.java @@ -46,6 +46,7 @@ public class WriterOutputStream extends OutputStream } /* ------------------------------------------------------------ */ + @Override public void close() throws IOException { @@ -53,6 +54,7 @@ public class WriterOutputStream extends OutputStream } /* ------------------------------------------------------------ */ + @Override public void flush() throws IOException { @@ -60,6 +62,7 @@ public class WriterOutputStream extends OutputStream } /* ------------------------------------------------------------ */ + @Override public void write(byte[] b) throws IOException { @@ -70,6 +73,7 @@ public class WriterOutputStream extends OutputStream } /* ------------------------------------------------------------ */ + @Override public void write(byte[] b, int off, int len) throws IOException { @@ -80,6 +84,7 @@ public class WriterOutputStream extends OutputStream } /* ------------------------------------------------------------ */ + @Override public synchronized void write(int b) throws IOException { diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/bio/SocketEndPoint.java b/jetty-io/src/main/java/org/eclipse/jetty/io/bio/SocketEndPoint.java index 77fb4d25665..35dc9533123 100644 --- a/jetty-io/src/main/java/org/eclipse/jetty/io/bio/SocketEndPoint.java +++ b/jetty-io/src/main/java/org/eclipse/jetty/io/bio/SocketEndPoint.java @@ -46,6 +46,7 @@ public class SocketEndPoint extends StreamEndPoint /* (non-Javadoc) * @see org.eclipse.io.BufferIO#isClosed() */ + @Override public boolean isOpen() { return super.isOpen() && _socket!=null && !_socket.isClosed() && !_socket.isInputShutdown() && !_socket.isOutputShutdown(); @@ -54,6 +55,7 @@ public class SocketEndPoint extends StreamEndPoint /* (non-Javadoc) * @see org.eclipse.io.BufferIO#close() */ + @Override public void close() throws IOException { if (!_socket.isClosed() && !_socket.isOutputShutdown()) @@ -81,6 +83,7 @@ public class SocketEndPoint extends StreamEndPoint /* * @see org.eclipse.io.EndPoint#getLocalAddr() */ + @Override public String getLocalAddr() { if (_local==null) @@ -96,6 +99,7 @@ public class SocketEndPoint extends StreamEndPoint /* * @see org.eclipse.io.EndPoint#getLocalHost() */ + @Override public String getLocalHost() { if (_local==null) @@ -111,6 +115,7 @@ public class SocketEndPoint extends StreamEndPoint /* * @see org.eclipse.io.EndPoint#getLocalPort() */ + @Override public int getLocalPort() { if (_local==null) @@ -124,6 +129,7 @@ public class SocketEndPoint extends StreamEndPoint /* * @see org.eclipse.io.EndPoint#getRemoteAddr() */ + @Override public String getRemoteAddr() { if (_remote==null) @@ -138,6 +144,7 @@ public class SocketEndPoint extends StreamEndPoint /* * @see org.eclipse.io.EndPoint#getRemoteHost() */ + @Override public String getRemoteHost() { if (_remote==null) @@ -151,6 +158,7 @@ public class SocketEndPoint extends StreamEndPoint /* * @see org.eclipse.io.EndPoint#getRemotePort() */ + @Override public int getRemotePort() { if (_remote==null) @@ -164,6 +172,7 @@ public class SocketEndPoint extends StreamEndPoint /* * @see org.eclipse.io.EndPoint#getConnection() */ + @Override public Object getTransport() { return _socket; diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/bio/StringEndPoint.java b/jetty-io/src/main/java/org/eclipse/jetty/io/bio/StringEndPoint.java index 047ed75d3e4..1e8aad30a26 100644 --- a/jetty-io/src/main/java/org/eclipse/jetty/io/bio/StringEndPoint.java +++ b/jetty-io/src/main/java/org/eclipse/jetty/io/bio/StringEndPoint.java @@ -15,7 +15,6 @@ package org.eclipse.jetty.io.bio; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; -import java.io.IOException; import org.eclipse.jetty.util.StringUtil; diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/nio/DirectNIOBuffer.java b/jetty-io/src/main/java/org/eclipse/jetty/io/nio/DirectNIOBuffer.java index e3546f3b9fb..45bb0f8dc6c 100644 --- a/jetty-io/src/main/java/org/eclipse/jetty/io/nio/DirectNIOBuffer.java +++ b/jetty-io/src/main/java/org/eclipse/jetty/io/nio/DirectNIOBuffer.java @@ -130,6 +130,7 @@ public class DirectNIOBuffer extends AbstractBuffer implements NIOBuffer _buf.put(index,b); } + @Override public int poke(int index, Buffer src) { if (isReadOnly()) throw new IllegalStateException(__READONLY); @@ -174,6 +175,7 @@ public class DirectNIOBuffer extends AbstractBuffer implements NIOBuffer } } + @Override public int poke(int index, byte[] b, int offset, int length) { if (isReadOnly()) throw new IllegalStateException(__READONLY); @@ -212,6 +214,7 @@ public class DirectNIOBuffer extends AbstractBuffer implements NIOBuffer } /* ------------------------------------------------------------ */ + @Override public int readFrom(InputStream in, int max) throws IOException { if (_in==null || !_in.isOpen() || in!=_inStream) @@ -276,6 +279,7 @@ public class DirectNIOBuffer extends AbstractBuffer implements NIOBuffer } /* ------------------------------------------------------------ */ + @Override public void writeTo(OutputStream out) throws IOException { if (_out==null || !_out.isOpen() || out!=_outStream) diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/nio/RandomAccessFileBuffer.java b/jetty-io/src/main/java/org/eclipse/jetty/io/nio/RandomAccessFileBuffer.java index 4f5cd248ef2..7126a4eabf7 100644 --- a/jetty-io/src/main/java/org/eclipse/jetty/io/nio/RandomAccessFileBuffer.java +++ b/jetty-io/src/main/java/org/eclipse/jetty/io/nio/RandomAccessFileBuffer.java @@ -76,6 +76,7 @@ public class RandomAccessFileBuffer extends AbstractBuffer implements Buffer return _capacity; } + @Override public void clear() { try @@ -93,6 +94,7 @@ public class RandomAccessFileBuffer extends AbstractBuffer implements Buffer } + @Override public byte peek() { synchronized (_file) @@ -158,6 +160,7 @@ public class RandomAccessFileBuffer extends AbstractBuffer implements Buffer } } + @Override public int poke(int index, byte[] b, int offset, int length) { synchronized (_file) diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/nio/SelectChannelEndPoint.java b/jetty-io/src/main/java/org/eclipse/jetty/io/nio/SelectChannelEndPoint.java index 508c14bc920..3b21e63620c 100644 --- a/jetty-io/src/main/java/org/eclipse/jetty/io/nio/SelectChannelEndPoint.java +++ b/jetty-io/src/main/java/org/eclipse/jetty/io/nio/SelectChannelEndPoint.java @@ -18,7 +18,6 @@ import java.nio.channels.ClosedChannelException; import java.nio.channels.SelectableChannel; import java.nio.channels.SelectionKey; import java.nio.channels.SocketChannel; -import java.util.concurrent.atomic.AtomicInteger; import org.eclipse.jetty.io.AsyncEndPoint; import org.eclipse.jetty.io.Buffer; @@ -208,6 +207,7 @@ public class SelectChannelEndPoint extends ChannelEndPoint implements Runnable, /* ------------------------------------------------------------ */ /* */ + @Override public int flush(Buffer header, Buffer buffer, Buffer trailer) throws IOException { int l = super.flush(header, buffer, trailer); @@ -218,6 +218,7 @@ public class SelectChannelEndPoint extends ChannelEndPoint implements Runnable, /* ------------------------------------------------------------ */ /* */ + @Override public int flush(Buffer buffer) throws IOException { int l = super.flush(buffer); @@ -238,6 +239,7 @@ public class SelectChannelEndPoint extends ChannelEndPoint implements Runnable, /* * Allows thread to block waiting for further events. */ + @Override public boolean blockReadable(long timeoutMs) throws IOException { synchronized (this) @@ -274,6 +276,7 @@ public class SelectChannelEndPoint extends ChannelEndPoint implements Runnable, /* * Allows thread to block waiting for further events. */ + @Override public boolean blockWritable(long timeoutMs) throws IOException { synchronized (this) @@ -480,6 +483,7 @@ public class SelectChannelEndPoint extends ChannelEndPoint implements Runnable, /* * @see org.eclipse.io.nio.ChannelEndPoint#close() */ + @Override public void close() throws IOException { try @@ -497,6 +501,7 @@ public class SelectChannelEndPoint extends ChannelEndPoint implements Runnable, } /* ------------------------------------------------------------ */ + @Override public String toString() { synchronized(this) @@ -527,11 +532,13 @@ public class SelectChannelEndPoint extends ChannelEndPoint implements Runnable, /* * @see org.eclipse.thread.Timeout.Task#expire() */ + @Override public void expired() { idleExpired(); } + @Override public String toString() { return "TimeoutTask:" + SelectChannelEndPoint.this.toString(); diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/nio/SelectorManager.java b/jetty-io/src/main/java/org/eclipse/jetty/io/nio/SelectorManager.java index e89ca927e10..390fc1ae01d 100644 --- a/jetty-io/src/main/java/org/eclipse/jetty/io/nio/SelectorManager.java +++ b/jetty-io/src/main/java/org/eclipse/jetty/io/nio/SelectorManager.java @@ -21,8 +21,6 @@ import java.nio.channels.Selector; import java.nio.channels.ServerSocketChannel; import java.nio.channels.SocketChannel; import java.util.ArrayList; -import java.util.Date; -import java.util.Iterator; import java.util.List; import org.eclipse.jetty.io.Connection; @@ -196,6 +194,7 @@ public abstract class SelectorManager extends AbstractLifeCycle /* (non-Javadoc) * @see org.eclipse.component.AbstractLifeCycle#doStart() */ + @Override protected void doStart() throws Exception { _selectSet = new SelectSet[_selectSets]; @@ -207,6 +206,7 @@ public abstract class SelectorManager extends AbstractLifeCycle /* ------------------------------------------------------------------------------- */ + @Override protected void doStop() throws Exception { SelectSet[] sets= _selectSet; @@ -596,7 +596,7 @@ public abstract class SelectorManager extends AbstractLifeCycle else if (__BUSY_KEY>0 && selected==1 && _selects>__MAX_SELECTS) { // Look for busy key - SelectionKey busy = (SelectionKey)selector.selectedKeys().iterator().next(); + SelectionKey busy = selector.selectedKeys().iterator().next(); if (busy==_busyKey) { if (++_busyKeyCount>__BUSY_KEY) diff --git a/jetty-io/src/test/java/org/eclipse/jetty/io/BufferCacheTest.java b/jetty-io/src/test/java/org/eclipse/jetty/io/BufferCacheTest.java index f24b1f040af..542c9b7ef01 100644 --- a/jetty-io/src/test/java/org/eclipse/jetty/io/BufferCacheTest.java +++ b/jetty-io/src/test/java/org/eclipse/jetty/io/BufferCacheTest.java @@ -40,6 +40,7 @@ public class BufferCacheTest extends TestCase /** * @see TestCase#setUp() */ + @Override protected void setUp() throws Exception { super.setUp(); @@ -52,6 +53,7 @@ public class BufferCacheTest extends TestCase /** * @see TestCase#tearDown() */ + @Override protected void tearDown() throws Exception { super.tearDown(); diff --git a/jetty-io/src/test/java/org/eclipse/jetty/io/BufferTest.java b/jetty-io/src/test/java/org/eclipse/jetty/io/BufferTest.java index 7a6650a3683..c335c27a922 100644 --- a/jetty-io/src/test/java/org/eclipse/jetty/io/BufferTest.java +++ b/jetty-io/src/test/java/org/eclipse/jetty/io/BufferTest.java @@ -39,6 +39,7 @@ public class BufferTest extends TestCase /* * @see TestCase#setUp() */ + @Override protected void setUp() throws Exception { super.setUp(); @@ -57,6 +58,7 @@ public class BufferTest extends TestCase /* * @see TestCase#tearDown() */ + @Override protected void tearDown() throws Exception { super.tearDown(); diff --git a/jetty-io/src/test/java/org/eclipse/jetty/io/ThreadLocalBuffersTest.java b/jetty-io/src/test/java/org/eclipse/jetty/io/ThreadLocalBuffersTest.java index 94b58759849..86b99325ab8 100644 --- a/jetty-io/src/test/java/org/eclipse/jetty/io/ThreadLocalBuffersTest.java +++ b/jetty-io/src/test/java/org/eclipse/jetty/io/ThreadLocalBuffersTest.java @@ -14,10 +14,8 @@ package org.eclipse.jetty.io; import java.util.ArrayList; -import java.util.HashSet; import java.util.Iterator; import java.util.List; -import java.util.Set; import java.util.concurrent.atomic.AtomicLong; import junit.framework.TestCase; @@ -40,12 +38,14 @@ public class ThreadLocalBuffersTest AtomicLong buffersRetrieved; + @Override protected void setUp() throws Exception { super.setUp(); } + @Override protected void tearDown() throws Exception { @@ -262,6 +262,7 @@ public class ThreadLocalBuffersTest start(); } + @Override public void run() { while ( true ) diff --git a/jetty-jaspi/src/main/java/org/eclipse/jetty/security/jaspi/JaspiAuthenticator.java b/jetty-jaspi/src/main/java/org/eclipse/jetty/security/jaspi/JaspiAuthenticator.java index 268ec2479dc..e640e376ac7 100644 --- a/jetty-jaspi/src/main/java/org/eclipse/jetty/security/jaspi/JaspiAuthenticator.java +++ b/jetty-jaspi/src/main/java/org/eclipse/jetty/security/jaspi/JaspiAuthenticator.java @@ -15,7 +15,7 @@ package org.eclipse.jetty.security.jaspi; import java.security.Principal; import java.util.Map; -import java.util.Set; +import java.util.Set; import javax.security.auth.Subject; import javax.security.auth.message.AuthException; @@ -28,9 +28,9 @@ import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import org.eclipse.jetty.security.Authenticator; -import org.eclipse.jetty.security.UserAuthentication; -import org.eclipse.jetty.security.ServerAuthException; import org.eclipse.jetty.security.IdentityService; +import org.eclipse.jetty.security.ServerAuthException; +import org.eclipse.jetty.security.UserAuthentication; import org.eclipse.jetty.security.authentication.DeferredAuthentication; import org.eclipse.jetty.server.Authentication; import org.eclipse.jetty.server.UserIdentity; diff --git a/jetty-jaspi/src/main/java/org/eclipse/jetty/security/jaspi/JaspiAuthenticatorFactory.java b/jetty-jaspi/src/main/java/org/eclipse/jetty/security/jaspi/JaspiAuthenticatorFactory.java index 96b895df89f..2ad57dd6a6b 100644 --- a/jetty-jaspi/src/main/java/org/eclipse/jetty/security/jaspi/JaspiAuthenticatorFactory.java +++ b/jetty-jaspi/src/main/java/org/eclipse/jetty/security/jaspi/JaspiAuthenticatorFactory.java @@ -29,8 +29,8 @@ import javax.servlet.ServletContext; import org.eclipse.jetty.security.Authenticator; import org.eclipse.jetty.security.DefaultAuthenticatorFactory; -import org.eclipse.jetty.security.LoginService; import org.eclipse.jetty.security.IdentityService; +import org.eclipse.jetty.security.LoginService; import org.eclipse.jetty.security.Authenticator.Configuration; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.util.log.Log; diff --git a/jetty-plus/src/main/java/org/eclipse/jetty/plus/annotation/InjectionCollection.java b/jetty-plus/src/main/java/org/eclipse/jetty/plus/annotation/InjectionCollection.java index 439ba958679..0d7bd771a33 100644 --- a/jetty-plus/src/main/java/org/eclipse/jetty/plus/annotation/InjectionCollection.java +++ b/jetty-plus/src/main/java/org/eclipse/jetty/plus/annotation/InjectionCollection.java @@ -13,15 +13,10 @@ package org.eclipse.jetty.plus.annotation; -import java.lang.reflect.Field; -import java.lang.reflect.Member; -import java.lang.reflect.Method; import java.util.ArrayList; -import java.util.Collections; import java.util.HashMap; import java.util.Iterator; import java.util.List; -import java.util.Map; import org.eclipse.jetty.util.log.Log; diff --git a/jetty-security/src/main/java/org/eclipse/jetty/security/DefaultIdentityService.java b/jetty-security/src/main/java/org/eclipse/jetty/security/DefaultIdentityService.java index 1c7014db329..e5f3335a64d 100644 --- a/jetty-security/src/main/java/org/eclipse/jetty/security/DefaultIdentityService.java +++ b/jetty-security/src/main/java/org/eclipse/jetty/security/DefaultIdentityService.java @@ -14,7 +14,6 @@ package org.eclipse.jetty.security; import java.security.Principal; -import java.util.Map; import javax.security.auth.Subject; diff --git a/jetty-security/src/main/java/org/eclipse/jetty/security/DefaultUserIdentity.java b/jetty-security/src/main/java/org/eclipse/jetty/security/DefaultUserIdentity.java index d576d64e85c..1d4425b627e 100644 --- a/jetty-security/src/main/java/org/eclipse/jetty/security/DefaultUserIdentity.java +++ b/jetty-security/src/main/java/org/eclipse/jetty/security/DefaultUserIdentity.java @@ -16,6 +16,7 @@ package org.eclipse.jetty.security; import java.security.Principal; import javax.security.auth.Subject; + import org.eclipse.jetty.server.UserIdentity; diff --git a/jetty-security/src/main/java/org/eclipse/jetty/security/SecurityHandler.java b/jetty-security/src/main/java/org/eclipse/jetty/security/SecurityHandler.java index f8dc21decd3..b3f9e8ac7af 100644 --- a/jetty-security/src/main/java/org/eclipse/jetty/security/SecurityHandler.java +++ b/jetty-security/src/main/java/org/eclipse/jetty/security/SecurityHandler.java @@ -28,7 +28,6 @@ import javax.servlet.http.HttpServletResponse; import org.eclipse.jetty.security.authentication.DeferredAuthentication; import org.eclipse.jetty.server.Authentication; import org.eclipse.jetty.server.Handler; -import org.eclipse.jetty.server.HttpConnection; import org.eclipse.jetty.server.Request; import org.eclipse.jetty.server.Response; import org.eclipse.jetty.server.UserIdentity; diff --git a/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/BasicAuthenticator.java b/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/BasicAuthenticator.java index 160564b8165..44f9ff3bf31 100644 --- a/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/BasicAuthenticator.java +++ b/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/BasicAuthenticator.java @@ -23,8 +23,8 @@ import javax.servlet.http.HttpServletResponse; import org.eclipse.jetty.http.HttpHeaders; import org.eclipse.jetty.http.security.B64Code; import org.eclipse.jetty.http.security.Constraint; -import org.eclipse.jetty.security.UserAuthentication; import org.eclipse.jetty.security.ServerAuthException; +import org.eclipse.jetty.security.UserAuthentication; import org.eclipse.jetty.server.Authentication; import org.eclipse.jetty.server.UserIdentity; import org.eclipse.jetty.server.Authentication.User; diff --git a/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/ClientCertAuthenticator.java b/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/ClientCertAuthenticator.java index ab314b0b89e..a344b7c0bfa 100644 --- a/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/ClientCertAuthenticator.java +++ b/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/ClientCertAuthenticator.java @@ -24,8 +24,8 @@ import javax.servlet.http.HttpServletResponse; import org.eclipse.jetty.http.security.B64Code; import org.eclipse.jetty.http.security.Constraint; -import org.eclipse.jetty.security.UserAuthentication; import org.eclipse.jetty.security.ServerAuthException; +import org.eclipse.jetty.security.UserAuthentication; import org.eclipse.jetty.server.Authentication; import org.eclipse.jetty.server.UserIdentity; import org.eclipse.jetty.server.Authentication.User; diff --git a/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/DigestAuthenticator.java b/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/DigestAuthenticator.java index 61a1d016a98..cef675d9ecf 100644 --- a/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/DigestAuthenticator.java +++ b/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/DigestAuthenticator.java @@ -25,8 +25,8 @@ import org.eclipse.jetty.http.HttpHeaders; import org.eclipse.jetty.http.security.B64Code; import org.eclipse.jetty.http.security.Constraint; import org.eclipse.jetty.http.security.Credential; -import org.eclipse.jetty.security.UserAuthentication; import org.eclipse.jetty.security.ServerAuthException; +import org.eclipse.jetty.security.UserAuthentication; import org.eclipse.jetty.server.Authentication; import org.eclipse.jetty.server.Request; import org.eclipse.jetty.server.UserIdentity; diff --git a/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/FormAuthenticator.java b/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/FormAuthenticator.java index 947c9b365aa..1f977c0298e 100644 --- a/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/FormAuthenticator.java +++ b/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/FormAuthenticator.java @@ -30,11 +30,10 @@ import javax.servlet.http.HttpSession; import org.eclipse.jetty.http.HttpHeaders; import org.eclipse.jetty.http.security.Constraint; import org.eclipse.jetty.security.Authenticator; -import org.eclipse.jetty.security.UserAuthentication; import org.eclipse.jetty.security.ServerAuthException; +import org.eclipse.jetty.security.UserAuthentication; import org.eclipse.jetty.server.Authentication; import org.eclipse.jetty.server.UserIdentity; -import org.eclipse.jetty.server.Authentication.Deferred; import org.eclipse.jetty.server.Authentication.User; import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.URIUtil; diff --git a/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/LoginCallbackImpl.java b/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/LoginCallbackImpl.java index 578310d9484..0d3c2998332 100644 --- a/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/LoginCallbackImpl.java +++ b/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/LoginCallbackImpl.java @@ -18,7 +18,6 @@ import java.security.Principal; import javax.security.auth.Subject; import org.eclipse.jetty.security.IdentityService; -import org.eclipse.jetty.server.UserIdentity; /** * This is similar to the jaspi PasswordValidationCallback but includes user diff --git a/jetty-security/src/test/java/org/eclipse/jetty/security/Constrain2tTest.java b/jetty-security/src/test/java/org/eclipse/jetty/security/Constrain2tTest.java index 47054c1eb8d..772788bcbd1 100644 --- a/jetty-security/src/test/java/org/eclipse/jetty/security/Constrain2tTest.java +++ b/jetty-security/src/test/java/org/eclipse/jetty/security/Constrain2tTest.java @@ -16,11 +16,13 @@ package org.eclipse.jetty.security; import java.io.IOException; import java.util.HashSet; import java.util.Set; + import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import junit.framework.TestCase; + import org.eclipse.jetty.http.security.Constraint; import org.eclipse.jetty.http.security.Password; import org.eclipse.jetty.security.authentication.FormAuthenticator; diff --git a/jetty-security/src/test/java/org/eclipse/jetty/security/ConstraintTest.java b/jetty-security/src/test/java/org/eclipse/jetty/security/ConstraintTest.java index 5662edfd857..b21d927eb78 100644 --- a/jetty-security/src/test/java/org/eclipse/jetty/security/ConstraintTest.java +++ b/jetty-security/src/test/java/org/eclipse/jetty/security/ConstraintTest.java @@ -18,11 +18,13 @@ import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; + import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import junit.framework.TestCase; + import org.eclipse.jetty.http.security.B64Code; import org.eclipse.jetty.http.security.Constraint; import org.eclipse.jetty.http.security.Password; diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractConnector.java b/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractConnector.java index 0a031197441..2c3ebba3fe9 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractConnector.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractConnector.java @@ -17,6 +17,7 @@ import java.io.IOException; import java.net.InetAddress; import java.net.Socket; import java.net.UnknownHostException; + import javax.servlet.ServletRequest; import org.eclipse.jetty.http.HttpBuffers; @@ -107,36 +108,42 @@ public abstract class AbstractConnector extends HttpBuffers implements Connector } /* ------------------------------------------------------------------------------- */ + @Override public Buffer newRequestBuffer(int size) { return new ByteArrayBuffer(size); } /* ------------------------------------------------------------------------------- */ + @Override public Buffer newRequestHeader(int size) { return new ByteArrayBuffer(size); } /* ------------------------------------------------------------------------------- */ + @Override public Buffer newResponseBuffer(int size) { return new ByteArrayBuffer(size); } /* ------------------------------------------------------------------------------- */ + @Override public Buffer newResponseHeader(int size) { return new ByteArrayBuffer(size); } /* ------------------------------------------------------------------------------- */ + @Override protected boolean isRequestHeader(Buffer buffer) { return true; } /* ------------------------------------------------------------------------------- */ + @Override protected boolean isResponseHeader(Buffer buffer) { return true; @@ -319,6 +326,7 @@ public abstract class AbstractConnector extends HttpBuffers implements Connector } /* ------------------------------------------------------------ */ + @Override protected void doStart() throws Exception { if (_server==null) @@ -353,6 +361,7 @@ public abstract class AbstractConnector extends HttpBuffers implements Connector } /* ------------------------------------------------------------ */ + @Override protected void doStop() throws Exception { try{close();} catch(IOException e) {Log.warn(e);} @@ -696,6 +705,7 @@ public abstract class AbstractConnector extends HttpBuffers implements Connector } /* ------------------------------------------------------------ */ + @Override public String toString() { String name = this.getClass().getName(); diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/AsyncContinuation.java b/jetty-server/src/main/java/org/eclipse/jetty/server/AsyncContinuation.java index 646c14fbad6..c0829d48a84 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/AsyncContinuation.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/AsyncContinuation.java @@ -19,11 +19,10 @@ import java.util.List; import javax.servlet.ServletContext; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; -import javax.servlet.ServletResponseWrapper; -import org.eclipse.jetty.continuation.ContinuationThrowable; -import org.eclipse.jetty.continuation.ContinuationListener; import org.eclipse.jetty.continuation.Continuation; +import org.eclipse.jetty.continuation.ContinuationListener; +import org.eclipse.jetty.continuation.ContinuationThrowable; import org.eclipse.jetty.io.AsyncEndPoint; import org.eclipse.jetty.io.EndPoint; import org.eclipse.jetty.server.handler.ContextHandler; @@ -183,6 +182,7 @@ public class AsyncContinuation implements AsyncContext, Continuation } /* ------------------------------------------------------------ */ + @Override public String toString() { synchronized (this) @@ -871,6 +871,7 @@ public class AsyncContinuation implements AsyncContext, Continuation return _path; } + @Override public void expired() { AsyncContinuation.this.expired(); diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/Authentication.java b/jetty-server/src/main/java/org/eclipse/jetty/server/Authentication.java index 60d8341800f..6fa49026c5f 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/Authentication.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/Authentication.java @@ -120,7 +120,8 @@ public interface Authentication * This convenience instance is for non mandatory authentication where credentials * have been presented and checked, but failed authentication. */ - public final static Authentication UNAUTHENTICATED = new Authentication(){public String toString(){return "UNAUTHENTICATED";}}; + public final static Authentication UNAUTHENTICATED = new Authentication(){@Override + public String toString(){return "UNAUTHENTICATED";}}; /* ------------------------------------------------------------ */ /** Authentication not checked @@ -128,20 +129,24 @@ public interface Authentication * This convenience instance us for non mandatory authentication when no * credentials are present to be checked. */ - public final static Authentication NOT_CHECKED = new Authentication(){public String toString(){return "NOT CHECKED";}}; + public final static Authentication NOT_CHECKED = new Authentication(){@Override + public String toString(){return "NOT CHECKED";}}; /* ------------------------------------------------------------ */ /** Authentication challenge sent. *

* This convenience instance is for when an authentication challenge has been sent. */ - public final static Authentication SEND_CONTINUE = new Authentication.Challenge(){public String toString(){return "CHALLENGE";}}; + public final static Authentication SEND_CONTINUE = new Authentication.Challenge(){@Override + public String toString(){return "CHALLENGE";}}; /* ------------------------------------------------------------ */ /** Authentication failure sent. *

* This convenience instance is for when an authentication failure has been sent. */ - public final static Authentication SEND_FAILURE = new Authentication.Failure(){public String toString(){return "FAILURE";}}; - public final static Authentication SEND_SUCCESS = new SendSuccess(){public String toString(){return "SEND_SUCCESS";}}; + public final static Authentication SEND_FAILURE = new Authentication.Failure(){@Override + public String toString(){return "FAILURE";}}; + public final static Authentication SEND_SUCCESS = new SendSuccess(){@Override + public String toString(){return "SEND_SUCCESS";}}; } diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/CookieCutter.java b/jetty-server/src/main/java/org/eclipse/jetty/server/CookieCutter.java index d2ee27a3e31..73db4c6d340 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/CookieCutter.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/CookieCutter.java @@ -13,11 +13,9 @@ package org.eclipse.jetty.server; import javax.servlet.http.Cookie; -import javax.servlet.http.HttpServletRequest; import org.eclipse.jetty.util.LazyList; import org.eclipse.jetty.util.QuotedStringTokenizer; -import org.eclipse.jetty.util.URIUtil; import org.eclipse.jetty.util.log.Log; diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/Dispatcher.java b/jetty-server/src/main/java/org/eclipse/jetty/server/Dispatcher.java index 874ebb909bf..93f20ec2c5a 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/Dispatcher.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/Dispatcher.java @@ -477,6 +477,7 @@ public class Dispatcher implements RequestDispatcher } /* ------------------------------------------------------------ */ + @Override public String toString() { return "FORWARD+"+_attr.toString(); @@ -583,6 +584,7 @@ public class Dispatcher implements RequestDispatcher } /* ------------------------------------------------------------ */ + @Override public String toString() { return "INCLUDE+"+_attr.toString(); diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpConnection.java b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpConnection.java index 681e4d4e548..7f096477b47 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpConnection.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpConnection.java @@ -16,6 +16,7 @@ package org.eclipse.jetty.server; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; + import javax.servlet.ServletInputStream; import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletResponse; @@ -39,12 +40,12 @@ import org.eclipse.jetty.http.HttpVersions; import org.eclipse.jetty.http.MimeTypes; import org.eclipse.jetty.http.Parser; import org.eclipse.jetty.io.Buffer; -import org.eclipse.jetty.io.BufferCache.CachedBuffer; import org.eclipse.jetty.io.Connection; import org.eclipse.jetty.io.EndPoint; import org.eclipse.jetty.io.EofException; import org.eclipse.jetty.io.RuntimeIOException; import org.eclipse.jetty.io.UncheckedPrintWriter; +import org.eclipse.jetty.io.BufferCache.CachedBuffer; import org.eclipse.jetty.io.nio.SelectChannelEndPoint; import org.eclipse.jetty.util.QuotedStringTokenizer; import org.eclipse.jetty.util.StringUtil; @@ -672,7 +673,7 @@ public class HttpConnection implements Connection _response.reset(); _generator.reset(true); _generator.setResponse(HttpStatus.INTERNAL_SERVER_ERROR_500,null); - _generator.completeHeader(_responseFields,HttpGenerator.LAST); + _generator.completeHeader(_responseFields,Generator.LAST); _generator.complete(); throw new HttpException(HttpStatus.INTERNAL_SERVER_ERROR_500); } @@ -690,7 +691,7 @@ public class HttpConnection implements Connection _generator.setResponse(_response.getStatus(), _response.getReason()); try { - _generator.completeHeader(_responseFields, HttpGenerator.LAST); + _generator.completeHeader(_responseFields, Generator.LAST); } catch(IOException io) { @@ -704,7 +705,7 @@ public class HttpConnection implements Connection _response.reset(); _generator.reset(true); _generator.setResponse(HttpStatus.INTERNAL_SERVER_ERROR_500,null); - _generator.completeHeader(_responseFields,HttpGenerator.LAST); + _generator.completeHeader(_responseFields,Generator.LAST); _generator.complete(); throw new HttpException(HttpStatus.INTERNAL_SERVER_ERROR_500); } @@ -718,7 +719,7 @@ public class HttpConnection implements Connection { try { - commitResponse(HttpGenerator.MORE); + commitResponse(Generator.MORE); _generator.flushBuffer(); } catch(IOException e) @@ -792,6 +793,7 @@ public class HttpConnection implements Connection * @see org.eclipse.jetty.server.server.HttpParser.EventHandler#startRequest(org.eclipse.io.Buffer, * org.eclipse.io.Buffer, org.eclipse.io.Buffer) */ + @Override public void startRequest(Buffer method, Buffer uri, Buffer version) throws IOException { _host = false; @@ -835,6 +837,7 @@ public class HttpConnection implements Connection /* * @see org.eclipse.jetty.server.server.HttpParser.EventHandler#parsedHeaderValue(org.eclipse.io.Buffer) */ + @Override public void parsedHeader(Buffer name, Buffer value) { int ho = HttpHeaders.CACHE.getOrdinal(name); @@ -939,6 +942,7 @@ public class HttpConnection implements Connection /* * @see org.eclipse.jetty.server.server.HttpParser.EventHandler#headerComplete() */ + @Override public void headerComplete() throws IOException { _requests++; @@ -989,6 +993,7 @@ public class HttpConnection implements Connection /* * @see org.eclipse.jetty.server.server.HttpParser.EventHandler#content(int, org.eclipse.io.Buffer) */ + @Override public void content(Buffer ref) throws IOException { if (_delayedHandling) @@ -1004,6 +1009,7 @@ public class HttpConnection implements Connection * * @see org.eclipse.jetty.server.server.HttpParser.EventHandler#messageComplete(int) */ + @Override public void messageComplete(long contentLength) throws IOException { if (_delayedHandling) @@ -1020,6 +1026,7 @@ public class HttpConnection implements Connection * @see org.eclipse.jetty.server.server.HttpParser.EventHandler#startResponse(org.eclipse.io.Buffer, int, * org.eclipse.io.Buffer) */ + @Override public void startResponse(Buffer version, int status, Buffer reason) { Log.debug("Bad request!: "+version+" "+status+" "+reason); @@ -1042,13 +1049,14 @@ public class HttpConnection implements Connection /* * @see java.io.OutputStream#close() */ + @Override public void close() throws IOException { if (_closed) return; if (!isIncluding() && !super._generator.isCommitted()) - commitResponse(HttpGenerator.LAST); + commitResponse(Generator.LAST); else flushResponse(); @@ -1060,10 +1068,11 @@ public class HttpConnection implements Connection /* * @see java.io.OutputStream#flush() */ + @Override public void flush() throws IOException { if (!super._generator.isCommitted()) - commitResponse(HttpGenerator.MORE); + commitResponse(Generator.MORE); super.flush(); } @@ -1071,6 +1080,7 @@ public class HttpConnection implements Connection /* * @see javax.servlet.ServletOutputStream#print(java.lang.String) */ + @Override public void print(String s) throws IOException { if (_closed) @@ -1151,8 +1161,8 @@ public class HttpConnection implements Connection if (content instanceof Buffer) { - super._generator.addContent((Buffer) content, HttpGenerator.LAST); - commitResponse(HttpGenerator.LAST); + super._generator.addContent((Buffer) content, Generator.LAST); + commitResponse(Generator.LAST); } else if (content instanceof InputStream) { diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpInput.java b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpInput.java index d817e55bc8b..3ada12803a5 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpInput.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpInput.java @@ -36,6 +36,7 @@ public class HttpInput extends ServletInputStream /* * @see java.io.InputStream#read() */ + @Override public int read() throws IOException { int c=-1; @@ -49,6 +50,7 @@ public class HttpInput extends ServletInputStream /* * @see java.io.InputStream#read(byte[], int, int) */ + @Override public int read(byte[] b, int off, int len) throws IOException { int l=-1; diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpOutput.java b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpOutput.java index 75a0a53d188..ea64e52fcd1 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpOutput.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpOutput.java @@ -59,6 +59,7 @@ public class HttpOutput extends ServletOutputStream /* * @see java.io.OutputStream#close() */ + @Override public void close() throws IOException { _closed=true; @@ -71,12 +72,14 @@ public class HttpOutput extends ServletOutputStream } /* ------------------------------------------------------------ */ + @Override public void flush() throws IOException { _generator.flush(_maxIdleTime); } /* ------------------------------------------------------------ */ + @Override public void write(byte[] b, int off, int len) throws IOException { _buf.wrap(b, off, len); @@ -87,6 +90,7 @@ public class HttpOutput extends ServletOutputStream /* * @see java.io.OutputStream#write(byte[]) */ + @Override public void write(byte[] b) throws IOException { _buf.wrap(b); @@ -97,6 +101,7 @@ public class HttpOutput extends ServletOutputStream /* * @see java.io.OutputStream#write(int) */ + @Override public void write(int b) throws IOException { if (_closed) @@ -166,6 +171,7 @@ public class HttpOutput extends ServletOutputStream /* * @see javax.servlet.ServletOutputStream#print(java.lang.String) */ + @Override public void print(String s) throws IOException { write(s.getBytes()); diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpWriter.java b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpWriter.java index 45466a5e2c1..00739f02705 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpWriter.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpWriter.java @@ -74,18 +74,21 @@ public class HttpWriter extends Writer } /* ------------------------------------------------------------ */ + @Override public void close() throws IOException { _out.close(); } /* ------------------------------------------------------------ */ + @Override public void flush() throws IOException { _out.flush(); } /* ------------------------------------------------------------ */ + @Override public void write (String s,int offset, int length) throws IOException { while (length > MAX_OUTPUT_CHARS) @@ -105,6 +108,7 @@ public class HttpWriter extends Writer } /* ------------------------------------------------------------ */ + @Override public void write (char[] s,int offset, int length) throws IOException { HttpOutput out = _out; diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/LocalConnector.java b/jetty-server/src/main/java/org/eclipse/jetty/server/LocalConnector.java index 9a577cfd9dd..5012fdc9297 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/LocalConnector.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/LocalConnector.java @@ -59,6 +59,7 @@ public class LocalConnector extends AbstractConnector return request.getResponsesBuffer(); } + @Override protected void accept(int acceptorID) throws IOException, InterruptedException { Request request = requests.take(); diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/NCSARequestLog.java b/jetty-server/src/main/java/org/eclipse/jetty/server/NCSARequestLog.java index df7bdcb6c1a..5a19545b100 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/NCSARequestLog.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/NCSARequestLog.java @@ -425,6 +425,7 @@ public class NCSARequestLog extends AbstractLifeCycle implements RequestLog } /* ------------------------------------------------------------ */ + @Override protected void doStart() throws Exception { if (_logDateFormat != null) @@ -460,6 +461,7 @@ public class NCSARequestLog extends AbstractLifeCycle implements RequestLog } /* ------------------------------------------------------------ */ + @Override protected void doStop() throws Exception { super.doStop(); diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/Request.java b/jetty-server/src/main/java/org/eclipse/jetty/server/Request.java index 43f0a5eb225..0f93ecbc1f4 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/Request.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/Request.java @@ -768,6 +768,7 @@ public class Request implements HttpServletRequest _readerEncoding=encoding; _reader=new BufferedReader(new InputStreamReader(in,encoding)) { + @Override public void close() throws IOException { in.close(); @@ -1787,6 +1788,7 @@ public class Request implements HttpServletRequest } /* ------------------------------------------------------------ */ + @Override public String toString() { return (_handled?"[":"(")+getMethod()+" "+_uri+(_handled?"]@":")@")+hashCode()+" "+super.toString(); diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/ResourceCache.java b/jetty-server/src/main/java/org/eclipse/jetty/server/ResourceCache.java index bfc66994fc4..c5492a38b97 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/ResourceCache.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/ResourceCache.java @@ -15,7 +15,6 @@ package org.eclipse.jetty.server; import java.io.IOException; import java.io.InputStream; -import java.io.Serializable; import java.util.ArrayList; import java.util.HashMap; import java.util.Map; @@ -266,6 +265,7 @@ public class ResourceCache extends AbstractLifeCycle } /* ------------------------------------------------------------ */ + @Override public synchronized void doStart() throws Exception { @@ -277,6 +277,7 @@ public class ResourceCache extends AbstractLifeCycle /* ------------------------------------------------------------ */ /** Stop the context. */ + @Override public void doStop() throws InterruptedException { @@ -528,6 +529,7 @@ public class ResourceCache extends AbstractLifeCycle } /* ------------------------------------------------------------ */ + @Override public String toString() { return "{"+_resource+","+_contentType+","+_lastModifiedBytes+"}"; @@ -549,6 +551,7 @@ public class ResourceCache extends AbstractLifeCycle } /* ------------------------------------------------------------ */ + @Override boolean isValid() { if (_resource.exists()) diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/Response.java b/jetty-server/src/main/java/org/eclipse/jetty/server/Response.java index c05461d2ed1..6c9fe249795 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/Response.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/Response.java @@ -19,13 +19,11 @@ import java.util.Collections; import java.util.Enumeration; import java.util.Locale; -import javax.servlet.RequestDispatcher; import javax.servlet.ServletOutputStream; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; -import org.eclipse.jetty.http.Generator; import org.eclipse.jetty.http.HttpCookie; import org.eclipse.jetty.http.HttpFields; import org.eclipse.jetty.http.HttpGenerator; @@ -35,7 +33,6 @@ import org.eclipse.jetty.http.HttpStatus; import org.eclipse.jetty.http.HttpURI; import org.eclipse.jetty.http.HttpVersions; import org.eclipse.jetty.http.MimeTypes; -import org.eclipse.jetty.http.HttpStatus.Code; import org.eclipse.jetty.io.BufferCache.CachedBuffer; import org.eclipse.jetty.server.handler.ContextHandler; import org.eclipse.jetty.server.handler.ErrorHandler; @@ -1172,6 +1169,7 @@ public class Response implements HttpServletResponse } /* ------------------------------------------------------------ */ + @Override public String toString() { return "HTTP/1.1 "+_status+" "+ (_reason==null?"":_reason) +System.getProperty("line.separator")+ @@ -1183,18 +1181,22 @@ public class Response implements HttpServletResponse /* ------------------------------------------------------------ */ private static class NullOutput extends ServletOutputStream { + @Override public void write(int b) throws IOException { } + @Override public void print(String s) throws IOException { } + @Override public void println(String s) throws IOException { } + @Override public void write(byte[] b, int off, int len) throws IOException { } diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/Server.java b/jetty-server/src/main/java/org/eclipse/jetty/server/Server.java index 5e32ac741bc..e62fb0baa88 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/Server.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/Server.java @@ -13,12 +13,9 @@ package org.eclipse.jetty.server; -import java.io.File; import java.io.IOException; import java.lang.reflect.Method; -import java.net.URLClassLoader; import java.util.ArrayList; -import java.util.Arrays; import java.util.Enumeration; import java.util.Iterator; import java.util.List; @@ -33,7 +30,6 @@ import javax.servlet.http.HttpServletResponse; import org.eclipse.jetty.http.HttpGenerator; import org.eclipse.jetty.http.HttpURI; import org.eclipse.jetty.server.bio.SocketConnector; -import org.eclipse.jetty.server.handler.HandlerCollection; import org.eclipse.jetty.server.handler.HandlerWrapper; import org.eclipse.jetty.server.nio.SelectChannelConnector; import org.eclipse.jetty.util.Attributes; @@ -44,7 +40,6 @@ import org.eclipse.jetty.util.URIUtil; import org.eclipse.jetty.util.component.Container; import org.eclipse.jetty.util.component.LifeCycle; import org.eclipse.jetty.util.log.Log; -import org.eclipse.jetty.util.resource.Resource; import org.eclipse.jetty.util.thread.QueuedThreadPool; import org.eclipse.jetty.util.thread.ThreadPool; @@ -190,6 +185,7 @@ public class Server extends HandlerWrapper implements Attributes } /* ------------------------------------------------------------ */ + @Override protected void doStart() throws Exception { if (getStopAtShutdown()) @@ -253,6 +249,7 @@ public class Server extends HandlerWrapper implements Attributes } /* ------------------------------------------------------------ */ + @Override protected void doStop() throws Exception { MultiException mex=new MultiException(); @@ -444,6 +441,7 @@ public class Server extends HandlerWrapper implements Attributes * @deprecated Use {@link #addBean(LifeCycle)} * @param c */ + @Deprecated public void addLifeCycle (LifeCycle c) { addBean(c); @@ -503,6 +501,7 @@ public class Server extends HandlerWrapper implements Attributes * along with the Server * @deprecated Use {@link #removeBean(Object)} */ + @Deprecated public void removeLifeCycle (LifeCycle c) { removeBean(c); @@ -600,6 +599,7 @@ public class Server extends HandlerWrapper implements Attributes /** * Stop all Servers in list. */ + @Override public void run() { setName("Shutdown"); @@ -700,6 +700,7 @@ public class Server extends HandlerWrapper implements Attributes _graceful=timeoutMS; } + @Override public String toString() { return this.getClass().getName()+"@"+Integer.toHexString(hashCode()); diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/SessionManager.java b/jetty-server/src/main/java/org/eclipse/jetty/server/SessionManager.java index 0beeb2dd315..d0758bf0086 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/SessionManager.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/SessionManager.java @@ -15,6 +15,7 @@ package org.eclipse.jetty.server; import java.util.EventListener; +import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; @@ -191,6 +192,7 @@ public interface SessionManager extends LifeCycle * @return the cross context session id manager. * @deprecated use {@link #getIdManager()} */ + @Deprecated public SessionIdManager getMetaManager(); /* ------------------------------------------------------------ */ diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/UserIdentity.java b/jetty-server/src/main/java/org/eclipse/jetty/server/UserIdentity.java index ca7715c9c39..0c849bd5932 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/UserIdentity.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/UserIdentity.java @@ -109,6 +109,7 @@ public interface UserIdentity return false; } + @Override public String toString() { return "UNAUTHENTICATED"; diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/bio/SocketConnector.java b/jetty-server/src/main/java/org/eclipse/jetty/server/bio/SocketConnector.java index 51bb6740753..de703860ddc 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/bio/SocketConnector.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/bio/SocketConnector.java @@ -23,7 +23,6 @@ import java.util.Set; import org.eclipse.jetty.http.HttpException; import org.eclipse.jetty.io.Buffer; -import org.eclipse.jetty.io.ByteArrayBuffer; import org.eclipse.jetty.io.EndPoint; import org.eclipse.jetty.io.EofException; import org.eclipse.jetty.io.bio.SocketEndPoint; @@ -93,6 +92,7 @@ public class SocketConnector extends AbstractConnector } /* ------------------------------------------------------------ */ + @Override public void accept(int acceptorID) throws IOException, InterruptedException { @@ -113,6 +113,7 @@ public class SocketConnector extends AbstractConnector } /* ------------------------------------------------------------------------------- */ + @Override public void customize(EndPoint endpoint, Request request) throws IOException { @@ -136,6 +137,7 @@ public class SocketConnector extends AbstractConnector } /* ------------------------------------------------------------------------------- */ + @Override protected void doStart() throws Exception { _connections.clear(); @@ -143,6 +145,7 @@ public class SocketConnector extends AbstractConnector } /* ------------------------------------------------------------------------------- */ + @Override protected void doStop() throws Exception { super.doStop(); @@ -188,6 +191,7 @@ public class SocketConnector extends AbstractConnector } } + @Override public int fill(Buffer buffer) throws IOException { int l = super.fill(buffer); @@ -196,6 +200,7 @@ public class SocketConnector extends AbstractConnector return l; } + @Override public void close() throws IOException { _connection.getRequest().getAsyncContinuation().cancel(); diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/AbstractHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/AbstractHandler.java index 8f0fed72cbf..7cc8ac27c79 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/AbstractHandler.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/AbstractHandler.java @@ -41,6 +41,7 @@ public abstract class AbstractHandler extends AbstractLifeCycle implements Handl /* * @see org.eclipse.thread.LifeCycle#start() */ + @Override protected void doStart() throws Exception { Log.debug("starting {}",this); @@ -50,12 +51,14 @@ public abstract class AbstractHandler extends AbstractLifeCycle implements Handl /* * @see org.eclipse.thread.LifeCycle#stop() */ + @Override protected void doStop() throws Exception { Log.debug("stopping {}",this); } /* ------------------------------------------------------------ */ + @Override public String toString() { StringBuilder b=new StringBuilder(); diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/AbstractHandlerContainer.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/AbstractHandlerContainer.java index d42fd8d1c65..fbaa3513d22 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/AbstractHandlerContainer.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/AbstractHandlerContainer.java @@ -83,6 +83,7 @@ public abstract class AbstractHandlerContainer extends AbstractHandler implement } /* ------------------------------------------------------------ */ + @Override protected void dump(StringBuilder b,String indent) { super.dump(b,indent); diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java index 44b7f107244..ad7320cc7eb 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java @@ -21,7 +21,6 @@ import java.net.URL; import java.net.URLClassLoader; import java.util.Arrays; import java.util.Collections; -import java.util.EnumSet; import java.util.Enumeration; import java.util.EventListener; import java.util.HashMap; @@ -30,7 +29,6 @@ import java.util.Locale; import java.util.Map; import java.util.Set; -import javax.servlet.Filter; import javax.servlet.RequestDispatcher; import javax.servlet.Servlet; import javax.servlet.ServletContext; @@ -206,6 +204,7 @@ public class ContextHandler extends ScopedHandler implements Attributes, Server. } /* ------------------------------------------------------------ */ + @Override public void setServer(Server server) { if (_errorHandler!=null) @@ -269,6 +268,7 @@ public class ContextHandler extends ScopedHandler implements Attributes, Server. /** * @deprecated use {@link #setConnectorNames(String[])} */ + @Deprecated public void setHosts(String[] hosts) { setConnectorNames(hosts); @@ -278,6 +278,7 @@ public class ContextHandler extends ScopedHandler implements Attributes, Server. /** Get the hosts for the context. * @deprecated */ + @Deprecated public String[] getHosts() { return getConnectorNames(); @@ -545,6 +546,7 @@ public class ContextHandler extends ScopedHandler implements Attributes, Server. /* * @see org.eclipse.thread.AbstractLifeCycle#doStart() */ + @Override protected void doStart() throws Exception { _availability=__STOPPED; @@ -650,6 +652,7 @@ public class ContextHandler extends ScopedHandler implements Attributes, Server. /* * @see org.eclipse.thread.AbstractLifeCycle#doStop() */ + @Override protected void doStop() throws Exception { _availability=__STOPPED; @@ -1283,6 +1286,7 @@ public class ContextHandler extends ScopedHandler implements Attributes, Server. } /* ------------------------------------------------------------ */ + @Override public String toString() { @@ -1837,6 +1841,7 @@ public class ContextHandler extends ScopedHandler implements Attributes, Server. } /* ------------------------------------------------------------ */ + @Override public String toString() { return "ServletContext@"+Integer.toHexString(hashCode())+"{"+(getContextPath().equals("")?URIUtil.SLASH:getContextPath())+","+getBaseResource()+"}"; diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandlerCollection.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandlerCollection.java index 0348f66be31..c91e067ed37 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandlerCollection.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandlerCollection.java @@ -25,7 +25,6 @@ import org.eclipse.jetty.http.PathMap; import org.eclipse.jetty.server.AsyncContinuation; import org.eclipse.jetty.server.Handler; import org.eclipse.jetty.server.HandlerContainer; -import org.eclipse.jetty.server.HttpConnection; import org.eclipse.jetty.server.Request; import org.eclipse.jetty.util.LazyList; import org.eclipse.jetty.util.log.Log; @@ -146,6 +145,7 @@ public class ContextHandlerCollection extends HandlerCollection /* * @see org.eclipse.jetty.server.server.handler.HandlerCollection#setHandlers(org.eclipse.jetty.server.server.Handler[]) */ + @Override public void setHandlers(Handler[] handlers) { _contextMap=null; @@ -155,6 +155,7 @@ public class ContextHandlerCollection extends HandlerCollection } /* ------------------------------------------------------------ */ + @Override protected void doStart() throws Exception { mapContexts(); @@ -166,6 +167,7 @@ public class ContextHandlerCollection extends HandlerCollection /* * @see org.eclipse.jetty.server.server.Handler#handle(java.lang.String, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, int) */ + @Override public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { Handler[] handlers = getHandlers(); diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/DebugHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/DebugHandler.java index 1f2f3a5feaf..9053c4479f1 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/DebugHandler.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/DebugHandler.java @@ -46,6 +46,7 @@ public class DebugHandler extends HandlerWrapper /* * @see org.eclipse.jetty.server.Handler#handle(java.lang.String, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, int) */ + @Override public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { @@ -116,6 +117,7 @@ public class DebugHandler extends HandlerWrapper /* (non-Javadoc) * @see org.eclipse.jetty.server.handler.HandlerWrapper#doStart() */ + @Override protected void doStart() throws Exception { if (_out==null) @@ -127,6 +129,7 @@ public class DebugHandler extends HandlerWrapper /* (non-Javadoc) * @see org.eclipse.jetty.server.handler.HandlerWrapper#doStop() */ + @Override protected void doStop() throws Exception { super.doStop(); diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/DefaultHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/DefaultHandler.java index 5b336c2e92e..232aba637c5 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/DefaultHandler.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/DefaultHandler.java @@ -25,7 +25,6 @@ import org.eclipse.jetty.http.HttpHeaders; import org.eclipse.jetty.http.HttpMethods; import org.eclipse.jetty.http.MimeTypes; import org.eclipse.jetty.server.Handler; -import org.eclipse.jetty.server.HttpConnection; import org.eclipse.jetty.server.Request; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.util.ByteArrayISO8859Writer; diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ErrorHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ErrorHandler.java index d22382e2e65..c6bd25ffa82 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ErrorHandler.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ErrorHandler.java @@ -23,11 +23,9 @@ import org.eclipse.jetty.http.HttpHeaders; import org.eclipse.jetty.http.HttpMethods; import org.eclipse.jetty.http.HttpStatus; import org.eclipse.jetty.http.MimeTypes; -import org.eclipse.jetty.http.HttpStatus.Code; import org.eclipse.jetty.server.HttpConnection; import org.eclipse.jetty.server.Request; import org.eclipse.jetty.util.ByteArrayISO8859Writer; -import org.eclipse.jetty.util.StringUtil; /* ------------------------------------------------------------ */ diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/HandlerCollection.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/HandlerCollection.java index fb7f5421b02..7746bf5d755 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/HandlerCollection.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/HandlerCollection.java @@ -155,6 +155,7 @@ public class HandlerCollection extends AbstractHandlerContainer /* * @see org.eclipse.jetty.server.server.handler.AbstractHandler#doStart() */ + @Override protected void doStart() throws Exception { MultiException mex=new MultiException(); @@ -171,6 +172,7 @@ public class HandlerCollection extends AbstractHandlerContainer /* * @see org.eclipse.jetty.server.server.handler.AbstractHandler#doStop() */ + @Override protected void doStop() throws Exception { MultiException mex=new MultiException(); @@ -184,6 +186,7 @@ public class HandlerCollection extends AbstractHandlerContainer } /* ------------------------------------------------------------ */ + @Override public void setServer(Server server) { if (isStarted()) @@ -222,6 +225,7 @@ public class HandlerCollection extends AbstractHandlerContainer } /* ------------------------------------------------------------ */ + @Override protected Object expandChildren(Object list, Class byClass) { Handler[] handlers = getHandlers(); diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/HandlerList.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/HandlerList.java index b92a181b7c8..c25ab0e18ee 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/HandlerList.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/HandlerList.java @@ -20,7 +20,6 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.eclipse.jetty.server.Handler; -import org.eclipse.jetty.server.HttpConnection; import org.eclipse.jetty.server.Request; /* ------------------------------------------------------------ */ @@ -35,6 +34,7 @@ public class HandlerList extends HandlerCollection /* * @see org.eclipse.jetty.server.server.EventHandler#handle(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) */ + @Override public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/HandlerWrapper.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/HandlerWrapper.java index 0b0cfc611b7..d68ce6b020f 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/HandlerWrapper.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/HandlerWrapper.java @@ -20,7 +20,6 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.eclipse.jetty.server.Handler; -import org.eclipse.jetty.server.HandlerContainer; import org.eclipse.jetty.server.Request; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.util.component.LifeCycle; @@ -86,6 +85,7 @@ public class HandlerWrapper extends AbstractHandlerContainer /* * @see org.eclipse.thread.AbstractLifeCycle#doStart() */ + @Override protected void doStart() throws Exception { if (_handler!=null) @@ -97,6 +97,7 @@ public class HandlerWrapper extends AbstractHandlerContainer /* * @see org.eclipse.thread.AbstractLifeCycle#doStop() */ + @Override protected void doStop() throws Exception { super.doStop(); diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/HotSwapHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/HotSwapHandler.java index 987b1b0d01a..dbc1dac1b79 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/HotSwapHandler.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/HotSwapHandler.java @@ -20,10 +20,8 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.eclipse.jetty.server.Handler; -import org.eclipse.jetty.server.HandlerContainer; import org.eclipse.jetty.server.Request; import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.util.component.LifeCycle; /* ------------------------------------------------------------ */ /** A HandlerContainer that allows a hot swap @@ -100,6 +98,7 @@ public class HotSwapHandler extends AbstractHandlerContainer /* * @see org.eclipse.thread.AbstractLifeCycle#doStart() */ + @Override protected void doStart() throws Exception { if (_handler!=null) @@ -111,6 +110,7 @@ public class HotSwapHandler extends AbstractHandlerContainer /* * @see org.eclipse.thread.AbstractLifeCycle#doStop() */ + @Override protected void doStop() throws Exception { super.doStop(); @@ -132,6 +132,7 @@ public class HotSwapHandler extends AbstractHandlerContainer /* ------------------------------------------------------------ */ + @Override public void setServer(Server server) { Server old_server=getServer(); @@ -153,6 +154,7 @@ public class HotSwapHandler extends AbstractHandlerContainer /* ------------------------------------------------------------ */ + @Override protected Object expandChildren(Object list, Class byClass) { return expandHandler(_handler,list,byClass); diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/MovedContextHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/MovedContextHandler.java index 219206e2bf2..ef401d5a15c 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/MovedContextHandler.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/MovedContextHandler.java @@ -21,7 +21,6 @@ import javax.servlet.http.HttpServletResponse; import org.eclipse.jetty.http.HttpHeaders; import org.eclipse.jetty.server.HandlerContainer; -import org.eclipse.jetty.server.HttpConnection; import org.eclipse.jetty.server.Request; import org.eclipse.jetty.util.URIUtil; diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/RequestLogHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/RequestLogHandler.java index 43a1e24ec21..e2f8d6be428 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/RequestLogHandler.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/RequestLogHandler.java @@ -20,7 +20,6 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.eclipse.jetty.server.DispatcherType; -import org.eclipse.jetty.server.HttpConnection; import org.eclipse.jetty.server.Request; import org.eclipse.jetty.server.RequestLog; import org.eclipse.jetty.server.Response; @@ -44,6 +43,7 @@ public class RequestLogHandler extends HandlerWrapper /* * @see org.eclipse.jetty.server.server.Handler#handle(java.lang.String, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, int) */ + @Override public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { @@ -87,6 +87,7 @@ public class RequestLogHandler extends HandlerWrapper /* * @see org.eclipse.jetty.server.server.handler.HandlerWrapper#setServer(org.eclipse.jetty.server.server.Server) */ + @Override public void setServer(Server server) { if (_requestLog!=null) @@ -111,6 +112,7 @@ public class RequestLogHandler extends HandlerWrapper /* * @see org.eclipse.jetty.server.server.handler.HandlerWrapper#doStart() */ + @Override protected void doStart() throws Exception { super.doStart(); @@ -122,6 +124,7 @@ public class RequestLogHandler extends HandlerWrapper /* * @see org.eclipse.jetty.server.server.handler.HandlerWrapper#doStop() */ + @Override protected void doStop() throws Exception { super.doStop(); diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ResourceHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ResourceHandler.java index 66af4834f20..92744fa1183 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ResourceHandler.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ResourceHandler.java @@ -118,6 +118,7 @@ public class ResourceHandler extends AbstractHandler } /* ------------------------------------------------------------ */ + @Override public void doStart() throws Exception { diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ScopedHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ScopedHandler.java index e8709e68b8f..ae3154c3b70 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ScopedHandler.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ScopedHandler.java @@ -110,6 +110,7 @@ public abstract class ScopedHandler extends HandlerWrapper /* ------------------------------------------------------------ */ /* */ + @Override public final void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { if (_outerScope==null) diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/StatisticsHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/StatisticsHandler.java index 589ab91e230..535eb688ef4 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/StatisticsHandler.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/StatisticsHandler.java @@ -16,6 +16,7 @@ package org.eclipse.jetty.server.handler; import java.io.IOException; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; + import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -101,6 +102,7 @@ public class StatisticsHandler extends HandlerWrapper } } + @Override public void handle(String path, Request request, HttpServletRequest httpRequest, HttpServletResponse httpResponse) throws IOException, ServletException { _requests.incrementAndGet(); @@ -173,6 +175,7 @@ public class StatisticsHandler extends HandlerWrapper _responsesTotalBytes.addAndGet(response.getContentCount()); } + @Override protected void doStart() throws Exception { super.doStart(); diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/nio/AbstractNIOConnector.java b/jetty-server/src/main/java/org/eclipse/jetty/server/nio/AbstractNIOConnector.java index 5240a5ed693..b914a88a2b0 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/nio/AbstractNIOConnector.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/nio/AbstractNIOConnector.java @@ -17,10 +17,8 @@ package org.eclipse.jetty.server.nio; import org.eclipse.jetty.io.Buffer; -import org.eclipse.jetty.io.ByteArrayBuffer; import org.eclipse.jetty.io.nio.DirectNIOBuffer; import org.eclipse.jetty.io.nio.IndirectNIOBuffer; -import org.eclipse.jetty.io.nio.NIOBuffer; import org.eclipse.jetty.server.AbstractConnector; /* ------------------------------------------------------------ */ @@ -49,36 +47,42 @@ public abstract class AbstractNIOConnector extends AbstractConnector implements } /* ------------------------------------------------------------------------------- */ + @Override public Buffer newRequestBuffer(int size) { return _useDirectBuffers?new DirectNIOBuffer(size):new IndirectNIOBuffer(size); } /* ------------------------------------------------------------------------------- */ + @Override public Buffer newRequestHeader(int size) { return new IndirectNIOBuffer(size); } /* ------------------------------------------------------------------------------- */ + @Override public Buffer newResponseBuffer(int size) { return _useDirectBuffers?new DirectNIOBuffer(size):new IndirectNIOBuffer(size); } /* ------------------------------------------------------------------------------- */ + @Override public Buffer newResponseHeader(int size) { return new IndirectNIOBuffer(size); } /* ------------------------------------------------------------------------------- */ + @Override protected boolean isRequestHeader(Buffer buffer) { return buffer instanceof IndirectNIOBuffer; } /* ------------------------------------------------------------------------------- */ + @Override protected boolean isResponseHeader(Buffer buffer) { return buffer instanceof IndirectNIOBuffer; diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/nio/BlockingChannelConnector.java b/jetty-server/src/main/java/org/eclipse/jetty/server/nio/BlockingChannelConnector.java index 0994ccbcfb5..4b94cc78db0 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/nio/BlockingChannelConnector.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/nio/BlockingChannelConnector.java @@ -80,6 +80,7 @@ public class BlockingChannelConnector extends AbstractNIOConnector } /* ------------------------------------------------------------ */ + @Override public void accept(int acceptorID) throws IOException, InterruptedException { @@ -93,6 +94,7 @@ public class BlockingChannelConnector extends AbstractNIOConnector } /* ------------------------------------------------------------------------------- */ + @Override public void customize(EndPoint endpoint, Request request) throws IOException { diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/nio/InheritedChannelConnector.java b/jetty-server/src/main/java/org/eclipse/jetty/server/nio/InheritedChannelConnector.java index fca291ba7ee..ccb05743c96 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/nio/InheritedChannelConnector.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/nio/InheritedChannelConnector.java @@ -38,6 +38,7 @@ import org.eclipse.jetty.util.log.Log; public class InheritedChannelConnector extends SelectChannelConnector { /* ------------------------------------------------------------ */ + @Override public void open() throws IOException { synchronized(this) diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/nio/SelectChannelConnector.java b/jetty-server/src/main/java/org/eclipse/jetty/server/nio/SelectChannelConnector.java index b4ecc4cd668..daeabe107b1 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/nio/SelectChannelConnector.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/nio/SelectChannelConnector.java @@ -67,6 +67,7 @@ public class SelectChannelConnector extends AbstractNIOConnector private final SelectorManager _manager = new SelectorManager() { + @Override protected SocketChannel acceptChannel(SelectionKey key) throws IOException { // TODO handle max connections @@ -79,27 +80,32 @@ public class SelectChannelConnector extends AbstractNIOConnector return channel; } + @Override public boolean dispatch(Runnable task) { return getThreadPool().dispatch(task); } + @Override protected void endPointClosed(final SelectChannelEndPoint endpoint) { connectionClosed((HttpConnection)endpoint.getConnection()); } + @Override protected void endPointOpened(SelectChannelEndPoint endpoint) { // TODO handle max connections and low resources connectionOpened((HttpConnection)endpoint.getConnection()); } + @Override protected Connection newConnection(SocketChannel channel,SelectChannelEndPoint endpoint) { return SelectChannelConnector.this.newConnection(channel,endpoint); } + @Override protected SelectChannelEndPoint newEndPoint(SocketChannel channel, SelectSet selectSet, SelectionKey sKey) throws IOException { return SelectChannelConnector.this.newEndPoint(channel,selectSet,sKey); @@ -116,6 +122,7 @@ public class SelectChannelConnector extends AbstractNIOConnector } /* ------------------------------------------------------------ */ + @Override public void accept(int acceptorID) throws IOException { _manager.doSelect(acceptorID); @@ -201,6 +208,7 @@ public class SelectChannelConnector extends AbstractNIOConnector } /* ------------------------------------------------------------ */ + @Override public void setMaxIdleTime(int maxIdleTime) { _manager.setMaxIdleTime(maxIdleTime); @@ -246,6 +254,7 @@ public class SelectChannelConnector extends AbstractNIOConnector * @see {@link #setMaxIdleTime(long)} * @deprecated use {@link #setLowResourceMaxIdleTime(int)} */ + @Deprecated public void setLowResourcesMaxIdleTime(long lowResourcesMaxIdleTime) { _lowResourcesMaxIdleTime=lowResourcesMaxIdleTime; @@ -260,6 +269,7 @@ public class SelectChannelConnector extends AbstractNIOConnector * @param lowResourcesMaxIdleTime the period in ms that a connection is allowed to be idle when resources are low. * @see {@link #setMaxIdleTime(long)} */ + @Override public void setLowResourceMaxIdleTime(int lowResourcesMaxIdleTime) { _lowResourcesMaxIdleTime=lowResourcesMaxIdleTime; @@ -271,6 +281,7 @@ public class SelectChannelConnector extends AbstractNIOConnector /* * @see org.eclipse.jetty.server.server.AbstractConnector#doStart() */ + @Override protected void doStart() throws Exception { _manager.setSelectSets(getAcceptors()); @@ -287,6 +298,7 @@ public class SelectChannelConnector extends AbstractNIOConnector /* * @see org.eclipse.jetty.server.server.AbstractConnector#doStop() */ + @Override protected void doStop() throws Exception { super.doStop(); @@ -304,12 +316,14 @@ public class SelectChannelConnector extends AbstractNIOConnector return new HttpConnection(SelectChannelConnector.this,endpoint,getServer()) { /* ------------------------------------------------------------ */ + @Override public void cancelTimeout(Task task) { endpoint.getSelectSet().cancelTimeout(task); } /* ------------------------------------------------------------ */ + @Override public void scheduleTimeout(Task task, long timeoutMs) { endpoint.getSelectSet().scheduleTimeout(task,timeoutMs); diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionIdManager.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionIdManager.java index 40433178ea0..d9d47683d31 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionIdManager.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionIdManager.java @@ -120,6 +120,7 @@ public abstract class AbstractSessionIdManager extends AbstractLifeCycle impleme } + @Override public void doStart() { initRandom(); diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionManager.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionManager.java index f429239e418..8e9fd7bdf90 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionManager.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionManager.java @@ -23,7 +23,6 @@ import java.util.List; import java.util.Map; import javax.servlet.ServletContext; -import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSessionActivationListener; @@ -145,6 +144,7 @@ public abstract class AbstractSessionManager extends AbstractLifeCycle implement } /* ------------------------------------------------------------ */ + @Override public void doStart() throws Exception { _context=ContextHandler.getCurrentContext(); @@ -207,6 +207,7 @@ public abstract class AbstractSessionManager extends AbstractLifeCycle implement } /* ------------------------------------------------------------ */ + @Override public void doStop() throws Exception { super.doStop(); @@ -275,6 +276,7 @@ public abstract class AbstractSessionManager extends AbstractLifeCycle implement /** * @deprecated use {@link #getIdManager()} */ + @Deprecated public SessionIdManager getMetaManager() { return getIdManager(); @@ -470,6 +472,7 @@ public abstract class AbstractSessionManager extends AbstractLifeCycle implement /** * @deprecated use {@link #setIdManager(SessionIdManager)} */ + @Deprecated public void setMetaManager(SessionIdManager metaManager) { setIdManager(metaManager); @@ -684,6 +687,7 @@ public abstract class AbstractSessionManager extends AbstractLifeCycle implement /** * @deprecated From HttpSessionContext */ + @Deprecated public Enumeration getIds() { return Collections.enumeration(Collections.EMPTY_LIST); @@ -693,6 +697,7 @@ public abstract class AbstractSessionManager extends AbstractLifeCycle implement /** * @deprecated From HttpSessionContext */ + @Deprecated public HttpSession getSession(String id) { return null; @@ -859,6 +864,7 @@ public abstract class AbstractSessionManager extends AbstractLifeCycle implement /** * @deprecated */ + @Deprecated public HttpSessionContext getSessionContext() throws IllegalStateException { if (_invalid) @@ -871,6 +877,7 @@ public abstract class AbstractSessionManager extends AbstractLifeCycle implement * @deprecated As of Version 2.2, this method is replaced by * {@link #getAttribute} */ + @Deprecated public Object getValue(String name) throws IllegalStateException { return getAttribute(name); @@ -881,6 +888,7 @@ public abstract class AbstractSessionManager extends AbstractLifeCycle implement * @deprecated As of Version 2.2, this method is replaced by * {@link #getAttributeNames} */ + @Deprecated public String[] getValueNames() throws IllegalStateException { synchronized(this) @@ -1007,6 +1015,7 @@ public abstract class AbstractSessionManager extends AbstractLifeCycle implement * @deprecated As of Version 2.2, this method is replaced by * {@link #setAttribute} */ + @Deprecated public void putValue(java.lang.String name, java.lang.Object value) throws IllegalStateException { setAttribute(name,value); @@ -1045,6 +1054,7 @@ public abstract class AbstractSessionManager extends AbstractLifeCycle implement * @deprecated As of Version 2.2, this method is replaced by * {@link #removeAttribute} */ + @Deprecated public void removeValue(java.lang.String name) throws IllegalStateException { removeAttribute(name); @@ -1104,6 +1114,7 @@ public abstract class AbstractSessionManager extends AbstractLifeCycle implement } /* ------------------------------------------------------------- */ + @Override public String toString() { return this.getClass().getName()+":"+getId()+"@"+hashCode(); diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/HashSessionIdManager.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/HashSessionIdManager.java index ef9543678ab..a8f737eba29 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/HashSessionIdManager.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/HashSessionIdManager.java @@ -108,6 +108,7 @@ public class HashSessionIdManager extends AbstractLifeCycle implements SessionId } /* ------------------------------------------------------------ */ + @Override protected void doStart() { if (_random==null) @@ -140,6 +141,7 @@ public class HashSessionIdManager extends AbstractLifeCycle implements SessionId } /* ------------------------------------------------------------ */ + @Override protected void doStop() { if (_sessions!=null) diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/HashSessionManager.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/HashSessionManager.java index a82a79d889a..6666b54fbd0 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/HashSessionManager.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/HashSessionManager.java @@ -66,6 +66,7 @@ public class HashSessionManager extends AbstractSessionManager /* (non-Javadoc) * @see org.eclipse.jetty.servlet.AbstractSessionManager#doStart() */ + @Override public void doStart() throws Exception { _sessions=new ConcurrentHashMap(); // TODO: use syncronizedMap for JDK 1.4 @@ -91,6 +92,7 @@ public class HashSessionManager extends AbstractSessionManager /* (non-Javadoc) * @see org.eclipse.jetty.servlet.AbstractSessionManager#doStop() */ + @Override public void doStop() throws Exception { @@ -126,6 +128,7 @@ public class HashSessionManager extends AbstractSessionManager /* ------------------------------------------------------------ */ + @Override public Map getSessionMap() { return Collections.unmodifiableMap(_sessions); @@ -133,6 +136,7 @@ public class HashSessionManager extends AbstractSessionManager /* ------------------------------------------------------------ */ + @Override public int getSessions() { return _sessions.size(); @@ -140,6 +144,7 @@ public class HashSessionManager extends AbstractSessionManager /* ------------------------------------------------------------ */ + @Override public void setMaxInactiveInterval(int seconds) { super.setMaxInactiveInterval(seconds); @@ -166,6 +171,7 @@ public class HashSessionManager extends AbstractSessionManager { _saveTask = new TimerTask() { + @Override public void run() { try @@ -218,6 +224,7 @@ public class HashSessionManager extends AbstractSessionManager _task.cancel(); _task = new TimerTask() { + @Override public void run() { scavenge(); @@ -307,12 +314,14 @@ public class HashSessionManager extends AbstractSessionManager } /* ------------------------------------------------------------ */ + @Override protected void addSession(AbstractSessionManager.Session session) { _sessions.put(session.getClusterId(),session); } /* ------------------------------------------------------------ */ + @Override public AbstractSessionManager.Session getSession(String idInCluster) { try @@ -332,6 +341,7 @@ public class HashSessionManager extends AbstractSessionManager } /* ------------------------------------------------------------ */ + @Override protected void invalidateSessions() { // Invalidate all sessions to cause unbind events @@ -346,6 +356,7 @@ public class HashSessionManager extends AbstractSessionManager } /* ------------------------------------------------------------ */ + @Override protected AbstractSessionManager.Session newSession(HttpServletRequest request) { return new Session(request); @@ -358,6 +369,7 @@ public class HashSessionManager extends AbstractSessionManager } /* ------------------------------------------------------------ */ + @Override protected void removeSession(String clusterId) { _sessions.remove(clusterId); @@ -530,6 +542,7 @@ public class HashSessionManager extends AbstractSessionManager } /* ------------------------------------------------------------- */ + @Override public void setMaxInactiveInterval(int secs) { super.setMaxInactiveInterval(secs); @@ -538,6 +551,7 @@ public class HashSessionManager extends AbstractSessionManager } /* ------------------------------------------------------------ */ + @Override protected Map newAttributeMap() { return new HashMap(3); @@ -545,6 +559,7 @@ public class HashSessionManager extends AbstractSessionManager /* ------------------------------------------------------------ */ + @Override public void invalidate () throws IllegalStateException { @@ -635,6 +650,7 @@ public class HashSessionManager extends AbstractSessionManager } /* ------------------------------------------------------------ */ + @Override public Class resolveClass (java.io.ObjectStreamClass cl) throws IOException, ClassNotFoundException { try diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/JDBCSessionIdManager.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/JDBCSessionIdManager.java index 2148dde7a3b..d023682cff5 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/JDBCSessionIdManager.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/JDBCSessionIdManager.java @@ -215,6 +215,7 @@ public class JDBCSessionIdManager extends AbstractSessionIdManager _task.cancel(); _task = new TimerTask() { + @Override public void run() { scavenge(); @@ -372,6 +373,7 @@ public class JDBCSessionIdManager extends AbstractSessionIdManager * * @see org.eclipse.jetty.server.session.AbstractSessionIdManager#doStart() */ + @Override public void doStart() { try @@ -394,6 +396,7 @@ public class JDBCSessionIdManager extends AbstractSessionIdManager * * @see org.eclipse.jetty.util.component.AbstractLifeCycle#doStop() */ + @Override public void doStop () throws Exception { diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/JDBCSessionManager.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/JDBCSessionManager.java index 18eaa9a86a6..3e3b1df7efa 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/JDBCSessionManager.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/JDBCSessionManager.java @@ -231,6 +231,7 @@ public class JDBCSessionManager extends AbstractSessionManager return _virtualHost; } + @Override public String toString () { return "Session rowId="+_rowId+",id="+_id+",lastNode="+_lastNode+ @@ -280,24 +281,28 @@ public class JDBCSessionManager extends AbstractSessionManager _values=data.getAttributeMap(); } - protected Map newAttributeMap() + @Override + protected Map newAttributeMap() { return _data.getAttributeMap(); } - public void setAttribute (String name, Object value) + @Override + public void setAttribute (String name, Object value) { super.setAttribute(name, value); _dirty=true; } - public void removeAttribute (String name) + @Override + public void removeAttribute (String name) { super.removeAttribute(name); _dirty=true; } - protected void cookieSet() + @Override + protected void cookieSet() { _data.setCookieSet(_data.getAccessed()); } @@ -308,6 +313,7 @@ public class JDBCSessionManager extends AbstractSessionManager * * @see org.eclipse.jetty.server.session.AbstractSessionManager.Session#access(long) */ + @Override protected void access(long time) { super.access(time); @@ -320,6 +326,7 @@ public class JDBCSessionManager extends AbstractSessionManager * Exit from session * @see org.eclipse.jetty.server.session.AbstractSessionManager.Session#complete() */ + @Override protected void complete() { super.complete(); @@ -347,6 +354,7 @@ public class JDBCSessionManager extends AbstractSessionManager } } + @Override protected void timeout() throws IllegalStateException { if (Log.isDebugEnabled()) Log.debug("Timing out session id="+getClusterId()); @@ -374,6 +382,7 @@ public class JDBCSessionManager extends AbstractSessionManager super(); } + @Override public Class resolveClass (java.io.ObjectStreamClass cl) throws IOException, ClassNotFoundException { try @@ -435,6 +444,7 @@ public class JDBCSessionManager extends AbstractSessionManager * * @see org.eclipse.jetty.server.session.AbstractSessionManager#getSession(java.lang.String) */ + @Override public Session getSession(String idInCluster) { Session session = (Session)_sessions.get(idInCluster); @@ -502,6 +512,7 @@ public class JDBCSessionManager extends AbstractSessionManager * * @see org.eclipse.jetty.server.session.AbstractSessionManager#getSessionMap() */ + @Override public Map getSessionMap() { return Collections.unmodifiableMap(_sessions); @@ -513,6 +524,7 @@ public class JDBCSessionManager extends AbstractSessionManager * * @see org.eclipse.jetty.server.session.AbstractSessionManager#getSessions() */ + @Override public int getSessions() { int size = 0; @@ -529,6 +541,7 @@ public class JDBCSessionManager extends AbstractSessionManager * * @see org.eclipse.jetty.server.session.AbstractSessionManager#doStart() */ + @Override public void doStart() throws Exception { if (_sessionIdManager==null) @@ -546,6 +559,7 @@ public class JDBCSessionManager extends AbstractSessionManager * * @see org.eclipse.jetty.server.session.AbstractSessionManager#doStop() */ + @Override public void doStop() throws Exception { _sessions.clear(); @@ -554,6 +568,7 @@ public class JDBCSessionManager extends AbstractSessionManager super.doStop(); } + @Override protected void invalidateSessions() { //Do nothing - we don't want to remove and @@ -588,6 +603,7 @@ public class JDBCSessionManager extends AbstractSessionManager * * @see org.eclipse.jetty.server.session.AbstractSessionManager#removeSession(java.lang.String) */ + @Override protected void removeSession(String idInCluster) { synchronized (this) @@ -610,6 +626,7 @@ public class JDBCSessionManager extends AbstractSessionManager * * @see org.eclipse.jetty.server.session.AbstractSessionManager#addSession(org.eclipse.jetty.server.session.AbstractSessionManager.Session) */ + @Override protected void addSession(AbstractSessionManager.Session session) { if (session==null) @@ -639,6 +656,7 @@ public class JDBCSessionManager extends AbstractSessionManager * * @see org.eclipse.jetty.server.session.AbstractSessionManager#newSession(javax.servlet.http.HttpServletRequest) */ + @Override protected AbstractSessionManager.Session newSession(HttpServletRequest request) { return new Session(request); @@ -650,6 +668,7 @@ public class JDBCSessionManager extends AbstractSessionManager * @param invalidate True if {@link HttpSessionListener#sessionDestroyed(HttpSessionEvent)} and * {@link SessionIdManager#invalidateAll(String)} should be called. */ + @Override public void removeSession(AbstractSessionManager.Session session, boolean invalidate) { // Remove session from context and global maps diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/SessionHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/SessionHandler.java index 719e5ff0c43..66c78813f52 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/SessionHandler.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/SessionHandler.java @@ -24,7 +24,6 @@ import javax.servlet.http.HttpSession; import org.eclipse.jetty.http.HttpCookie; import org.eclipse.jetty.server.DispatcherType; -import org.eclipse.jetty.server.HttpConnection; import org.eclipse.jetty.server.Request; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.SessionManager; @@ -94,6 +93,7 @@ public class SessionHandler extends HandlerWrapper /* ------------------------------------------------------------ */ + @Override public void setServer(Server server) { Server old_server=getServer(); @@ -109,6 +109,7 @@ public class SessionHandler extends HandlerWrapper /* * @see org.eclipse.thread.AbstractLifeCycle#doStart() */ + @Override protected void doStart() throws Exception { _sessionManager.start(); @@ -118,6 +119,7 @@ public class SessionHandler extends HandlerWrapper /* * @see org.eclipse.thread.AbstractLifeCycle#doStop() */ + @Override protected void doStop() throws Exception { super.doStop(); @@ -128,6 +130,7 @@ public class SessionHandler extends HandlerWrapper /* * @see org.eclipse.jetty.server.Handler#handle(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, int) */ + @Override public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/ssl/SslSelectChannelConnector.java b/jetty-server/src/main/java/org/eclipse/jetty/server/ssl/SslSelectChannelConnector.java index f45c31d47d9..08a5a3dd48e 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/ssl/SslSelectChannelConnector.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/ssl/SslSelectChannelConnector.java @@ -273,6 +273,7 @@ public class SslSelectChannelConnector extends SelectChannelConnector implements * @deprecated use {@link #getSslKeyManagerFactoryAlgorithm()} or * {@link #getSslTrustManagerFactoryAlgorithm()} */ + @Deprecated public String getAlgorithm() { return getSslKeyManagerFactoryAlgorithm(); @@ -283,6 +284,7 @@ public class SslSelectChannelConnector extends SelectChannelConnector implements * @deprecated use {@link #setSslKeyManagerFactoryAlgorithm(String)} or * {@link #setSslTrustManagerFactoryAlgorithm(String)} */ + @Deprecated public void setAlgorithm(String algorithm) { setSslKeyManagerFactoryAlgorithm(algorithm); @@ -525,6 +527,7 @@ public class SslSelectChannelConnector extends SelectChannelConnector implements * client certs providing CONFIDENTIAL, whereas another SSL listener not * requiring client certs providing mere INTEGRAL constraints. */ + @Override public boolean isConfidential(Request request) { final int confidentialPort=getConfidentialPort(); @@ -540,6 +543,7 @@ public class SslSelectChannelConnector extends SelectChannelConnector implements * client certs providing CONFIDENTIAL, whereas another SSL listener not * requiring client certs providing mere INTEGRAL constraints. */ + @Override public boolean isIntegral(Request request) { final int integralPort=getIntegralPort(); @@ -547,12 +551,14 @@ public class SslSelectChannelConnector extends SelectChannelConnector implements } /* ------------------------------------------------------------------------------- */ + @Override protected SelectChannelEndPoint newEndPoint(SocketChannel channel, SelectSet selectSet, SelectionKey key) throws IOException { return new SslSelectChannelEndPoint(_sslBuffers,channel,selectSet,key,createSSLEngine()); } /* ------------------------------------------------------------------------------- */ + @Override protected Connection newConnection(SocketChannel channel, SelectChannelEndPoint endpoint) { HttpConnection connection=(HttpConnection)super.newConnection(channel,endpoint); @@ -603,6 +609,7 @@ public class SslSelectChannelConnector extends SelectChannelConnector implements } + @Override protected void doStart() throws Exception { if (_context == null) diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/ssl/SslSocketConnector.java b/jetty-server/src/main/java/org/eclipse/jetty/server/ssl/SslSocketConnector.java index 90d6daf23ea..37a1113f207 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/ssl/SslSocketConnector.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/ssl/SslSocketConnector.java @@ -14,7 +14,6 @@ package org.eclipse.jetty.server.ssl; import java.io.ByteArrayInputStream; -import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.InetAddress; @@ -158,6 +157,7 @@ public class SslSocketConnector extends SocketConnector implements SslConnector /* ------------------------------------------------------------ */ + @Override public void accept(int acceptorID) throws IOException, InterruptedException { @@ -169,6 +169,7 @@ public class SslSocketConnector extends SocketConnector implements SslConnector } /* ------------------------------------------------------------ */ + @Override protected void configure(Socket socket) throws IOException { @@ -267,6 +268,7 @@ public class SslSocketConnector extends SocketConnector implements SslConnector * This should be a {@link SocketEndPoint} wrapping a {@link SSLSocket}. * @param request HttpRequest to be customised. */ + @Override public void customize(EndPoint endpoint, Request request) throws IOException { @@ -394,6 +396,7 @@ public class SslSocketConnector extends SocketConnector implements SslConnector * configured to require client certs providing CONFIDENTIAL, whereas another SSL listener not * requiring client certs providing mere INTEGRAL constraints. */ + @Override public boolean isConfidential(Request request) { final int confidentialPort = getConfidentialPort(); @@ -408,6 +411,7 @@ public class SslSocketConnector extends SocketConnector implements SslConnector * require client certs providing CONFIDENTIAL, whereas another SSL listener not requiring * client certs providing mere INTEGRAL constraints. */ + @Override public boolean isIntegral(Request request) { final int integralPort = getIntegralPort(); @@ -427,6 +431,7 @@ public class SslSocketConnector extends SocketConnector implements SslConnector */ /* ------------------------------------------------------------ */ + @Override protected ServerSocket newServerSocket(String host, int port,int backlog) throws IOException { SSLServerSocketFactory factory = null; @@ -672,6 +677,7 @@ public class SslSocketConnector extends SocketConnector implements SslConnector super(socket); } + @Override public void run() { try diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/AsyncContextTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/AsyncContextTest.java index ee7a8a9d9f2..815723d254c 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/AsyncContextTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/AsyncContextTest.java @@ -15,11 +15,13 @@ package org.eclipse.jetty.server; import java.io.IOException; import java.io.InputStream; + import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import junit.framework.TestCase; + import org.eclipse.jetty.continuation.Continuation; import org.eclipse.jetty.continuation.ContinuationListener; import org.eclipse.jetty.server.handler.HandlerWrapper; @@ -30,6 +32,7 @@ public class AsyncContextTest extends TestCase protected SuspendHandler _handler = new SuspendHandler(); protected LocalConnector _connector; + @Override protected void setUp() throws Exception { _connector = new LocalConnector(); @@ -38,6 +41,7 @@ public class AsyncContextTest extends TestCase _server.start(); } + @Override protected void tearDown() throws Exception { _server.stop(); @@ -180,6 +184,7 @@ public class AsyncContextTest extends TestCase + @Override public void handle(String target, final Request baseRequest, final HttpServletRequest request, final HttpServletResponse response) throws IOException, ServletException { if (DispatcherType.REQUEST.equals(baseRequest.getDispatcherType())) @@ -205,6 +210,7 @@ public class AsyncContextTest extends TestCase if (_completeAfter>0) { new Thread() { + @Override public void run() { try @@ -233,6 +239,7 @@ public class AsyncContextTest extends TestCase if (_resumeAfter>0) { new Thread() { + @Override public void run() { try diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/AsyncStressTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/AsyncStressTest.java index fe43336eaf8..4b5a6c41e4b 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/AsyncStressTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/AsyncStressTest.java @@ -21,7 +21,6 @@ import java.net.Socket; import java.util.Random; import java.util.Timer; import java.util.TimerTask; -import java.util.concurrent.atomic.AtomicInteger; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; @@ -48,6 +47,7 @@ public class AsyncStressTest extends TestCase protected QueuedThreadPool _threads=new QueuedThreadPool(); protected boolean _stress; + @Override protected void setUp() throws Exception { _stress= Boolean.getBoolean("STRESS"); @@ -59,9 +59,10 @@ public class AsyncStressTest extends TestCase _server.setHandler(_handler); _server.start(); _port=_connector.getLocalPort(); - _addr=Inet4Address.getLocalHost(); + _addr=InetAddress.getLocalHost(); } + @Override protected void tearDown() throws Exception { _server.stop(); @@ -176,6 +177,7 @@ public class AsyncStressTest extends TestCase _timer=new Timer(); } + @Override public void handle(String target, final Request baseRequest, final HttpServletRequest request, final HttpServletResponse response) throws IOException, ServletException { int read_before=0; @@ -223,6 +225,7 @@ public class AsyncStressTest extends TestCase { TimerTask complete = new TimerTask() { + @Override public void run() { try @@ -261,6 +264,7 @@ public class AsyncStressTest extends TestCase { TimerTask resume = new TimerTask() { + @Override public void run() { asyncContext.dispatch(); diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/AsyncUploadTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/AsyncUploadTest.java index 6c43e30a07d..3ea0a80a31f 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/AsyncUploadTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/AsyncUploadTest.java @@ -105,6 +105,7 @@ public class AsyncUploadTest extends TestCase new Thread() { + @Override public void run() { try diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/BusySelectChannelServerTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/BusySelectChannelServerTest.java index 2a97454c6a8..2948e325b80 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/BusySelectChannelServerTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/BusySelectChannelServerTest.java @@ -39,6 +39,7 @@ public class BusySelectChannelServerTest extends HttpServerTestBase /* (non-Javadoc) * @see org.eclipse.jetty.server.server.nio.SelectChannelConnector#newEndPoint(java.nio.channels.SocketChannel, org.eclipse.io.nio.SelectorManager.SelectSet, java.nio.channels.SelectionKey) */ + @Override protected SelectChannelEndPoint newEndPoint(SocketChannel channel, SelectSet selectSet, SelectionKey key) throws IOException { return new SelectChannelEndPoint(channel,selectSet,key) @@ -50,6 +51,7 @@ public class BusySelectChannelServerTest extends HttpServerTestBase /* (non-Javadoc) * @see org.eclipse.io.nio.SelectChannelEndPoint#flush(org.eclipse.io.Buffer, org.eclipse.io.Buffer, org.eclipse.io.Buffer) */ + @Override public int flush(Buffer header, Buffer buffer, Buffer trailer) throws IOException { int x=write++&0xff; @@ -64,6 +66,7 @@ public class BusySelectChannelServerTest extends HttpServerTestBase /* (non-Javadoc) * @see org.eclipse.io.nio.SelectChannelEndPoint#flush(org.eclipse.io.Buffer) */ + @Override public int flush(Buffer buffer) throws IOException { int x=write++&0xff; @@ -85,6 +88,7 @@ public class BusySelectChannelServerTest extends HttpServerTestBase /* (non-Javadoc) * @see org.eclipse.io.nio.ChannelEndPoint#fill(org.eclipse.io.Buffer) */ + @Override public int fill(Buffer buffer) throws IOException { int x=read++&0xff; @@ -132,6 +136,7 @@ public class BusySelectChannelServerTest extends HttpServerTestBase } + @Override protected void configServer(Server server) { server.setThreadPool(new QueuedThreadPool()); diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/HttpConnectionTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/HttpConnectionTest.java index 4bcb36496a6..79f8d847227 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/HttpConnectionTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/HttpConnectionTest.java @@ -26,12 +26,12 @@ import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import junit.framework.TestCase; + import org.eclipse.jetty.http.HttpHeaders; import org.eclipse.jetty.http.MimeTypes; import org.eclipse.jetty.util.log.Log; -import junit.framework.TestCase; - /** * * diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/HttpWriterTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/HttpWriterTest.java index 865e25e1c8a..9ee05fb421c 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/HttpWriterTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/HttpWriterTest.java @@ -2,6 +2,8 @@ package org.eclipse.jetty.server; import java.io.IOException; +import junit.framework.TestCase; + import org.eclipse.jetty.http.AbstractGenerator; import org.eclipse.jetty.http.HttpFields; import org.eclipse.jetty.io.Buffer; @@ -11,8 +13,6 @@ import org.eclipse.jetty.io.ByteArrayEndPoint; import org.eclipse.jetty.io.SimpleBuffers; import org.eclipse.jetty.util.StringUtil; -import junit.framework.TestCase; - public class HttpWriterTest extends TestCase { HttpWriter _writer; diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/RFC2616Test.java b/jetty-server/src/test/java/org/eclipse/jetty/server/RFC2616Test.java index 4363d63f234..10cda0874fe 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/RFC2616Test.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/RFC2616Test.java @@ -24,6 +24,7 @@ import java.util.Enumeration; import java.util.List; import junit.framework.TestCase; + import org.eclipse.jetty.http.HttpFields; import org.eclipse.jetty.server.handler.ContextHandler; import org.eclipse.jetty.server.handler.HandlerCollection; diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/RequestTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/RequestTest.java index 36bcd9a6968..d05723c0b6d 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/RequestTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/RequestTest.java @@ -16,12 +16,14 @@ package org.eclipse.jetty.server; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; + import javax.servlet.ServletException; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import junit.framework.TestCase; + import org.eclipse.jetty.server.handler.AbstractHandler; import org.eclipse.jetty.util.IO; diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/ResourceCacheTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/ResourceCacheTest.java index e61355eb3f0..c8d16f44c27 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/ResourceCacheTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/ResourceCacheTest.java @@ -35,6 +35,7 @@ public class ResourceCacheTest extends TestCase /* (non-Javadoc) * @see junit.framework.TestCase#setUp() */ + @Override protected void setUp() throws Exception { for (int i=0;i extends AbstractList implements Queue } /* ------------------------------------------------------------ */ + @Override public boolean isEmpty() { synchronized(_lock) @@ -222,6 +223,7 @@ public class ArrayQueue extends AbstractList implements Queue } /* ------------------------------------------------------------ */ + @Override public E remove(int index) { synchronized(_lock) @@ -262,6 +264,7 @@ public class ArrayQueue extends AbstractList implements Queue } /* ------------------------------------------------------------ */ + @Override public E set(int index, E element) { synchronized(_lock) @@ -279,6 +282,7 @@ public class ArrayQueue extends AbstractList implements Queue } /* ------------------------------------------------------------ */ + @Override public void add(int index, E element) { synchronized(_lock) diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/AttributesMap.java b/jetty-util/src/main/java/org/eclipse/jetty/util/AttributesMap.java index fed60e08336..cd404f61946 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/AttributesMap.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/AttributesMap.java @@ -110,6 +110,7 @@ public class AttributesMap implements Attributes } /* ------------------------------------------------------------ */ + @Override public String toString() { return _map.toString(); diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/BlockingArrayQueue.java b/jetty-util/src/main/java/org/eclipse/jetty/util/BlockingArrayQueue.java index c53e20ae810..3e9a6121e9c 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/BlockingArrayQueue.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/BlockingArrayQueue.java @@ -124,6 +124,7 @@ public class BlockingArrayQueue extends AbstractList implements BlockingQu } /* ------------------------------------------------------------ */ + @Override public boolean add(E e) { return offer(e); @@ -350,6 +351,7 @@ public class BlockingArrayQueue extends AbstractList implements BlockingQu } /* ------------------------------------------------------------ */ + @Override public void clear() { _tailLock.lock(); @@ -374,18 +376,21 @@ public class BlockingArrayQueue extends AbstractList implements BlockingQu } /* ------------------------------------------------------------ */ + @Override public boolean isEmpty() { return _size.get()==0; } /* ------------------------------------------------------------ */ + @Override public int size() { return _size.get(); } /* ------------------------------------------------------------ */ + @Override public E get(int index) { _tailLock.lock(); @@ -413,6 +418,7 @@ public class BlockingArrayQueue extends AbstractList implements BlockingQu } /* ------------------------------------------------------------ */ + @Override public E remove(int index) { _tailLock.lock(); @@ -465,6 +471,7 @@ public class BlockingArrayQueue extends AbstractList implements BlockingQu } /* ------------------------------------------------------------ */ + @Override public E set(int index, E e) { if (e == null) @@ -499,6 +506,7 @@ public class BlockingArrayQueue extends AbstractList implements BlockingQu } /* ------------------------------------------------------------ */ + @Override public void add(int index, E e) { if (e == null) diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/ByteArrayISO8859Writer.java b/jetty-util/src/main/java/org/eclipse/jetty/util/ByteArrayISO8859Writer.java index 092dcbbe623..08c3aacc350 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/ByteArrayISO8859Writer.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/ByteArrayISO8859Writer.java @@ -117,6 +117,7 @@ public class ByteArrayISO8859Writer extends Writer } /* ------------------------------------------------------------ */ + @Override public void write(char[] ca) throws IOException { @@ -135,6 +136,7 @@ public class ByteArrayISO8859Writer extends Writer } /* ------------------------------------------------------------ */ + @Override public void write(char[] ca,int offset, int length) throws IOException { @@ -153,6 +155,7 @@ public class ByteArrayISO8859Writer extends Writer } /* ------------------------------------------------------------ */ + @Override public void write(String s) throws IOException { @@ -178,6 +181,7 @@ public class ByteArrayISO8859Writer extends Writer } /* ------------------------------------------------------------ */ + @Override public void write(String s,int offset, int length) throws IOException { @@ -214,6 +218,7 @@ public class ByteArrayISO8859Writer extends Writer } /* ------------------------------------------------------------ */ + @Override public void flush() {} @@ -224,6 +229,7 @@ public class ByteArrayISO8859Writer extends Writer } /* ------------------------------------------------------------ */ + @Override public void close() {} diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/IO.java b/jetty-util/src/main/java/org/eclipse/jetty/util/IO.java index 7141cd36a35..8ec5658c349 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/IO.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/IO.java @@ -12,7 +12,6 @@ // ======================================================================== package org.eclipse.jetty.util; -import java.io.BufferedReader; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; @@ -453,10 +452,15 @@ public class IO /* ------------------------------------------------------------ */ private static class NullOS extends OutputStream { + @Override public void close(){} + @Override public void flush(){} + @Override public void write(byte[]b){} + @Override public void write(byte[]b,int i,int l){} + @Override public void write(int b){} } private static NullOS __nullStream = new NullOS(); @@ -466,6 +470,7 @@ public class IO /* ------------------------------------------------------------ */ private static class ClosedIS extends InputStream { + @Override public int read() throws IOException { return -1; @@ -495,12 +500,19 @@ public class IO /* ------------------------------------------------------------ */ private static class NullWrite extends Writer { + @Override public void close(){} + @Override public void flush(){} + @Override public void write(char[]b){} + @Override public void write(char[]b,int o,int l){} + @Override public void write(int b){} + @Override public void write(String s){} + @Override public void write(String s,int o,int l){} } private static NullWrite __nullWriter = new NullWrite(); diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/LazyList.java b/jetty-util/src/main/java/org/eclipse/jetty/util/LazyList.java index 9b5a6f2cb1b..6156b9df164 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/LazyList.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/LazyList.java @@ -436,7 +436,7 @@ public class LazyList if (array==null) { if (type==null && item!=null) - type= (Class)item.getClass(); + type= item.getClass(); Object[] na = (Object[])Array.newInstance(type, 1); na[0]=item; return na; diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/MultiException.java b/jetty-util/src/main/java/org/eclipse/jetty/util/MultiException.java index a0b6532ddbb..a661d473a90 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/MultiException.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/MultiException.java @@ -133,6 +133,7 @@ public class MultiException extends Exception } /* ------------------------------------------------------------ */ + @Override public String toString() { if (LazyList.size(nested)>0) @@ -142,6 +143,7 @@ public class MultiException extends Exception } /* ------------------------------------------------------------ */ + @Override public void printStackTrace() { super.printStackTrace(); @@ -154,6 +156,7 @@ public class MultiException extends Exception /** * @see java.lang.Throwable#printStackTrace(java.io.PrintStream) */ + @Override public void printStackTrace(PrintStream out) { super.printStackTrace(out); @@ -165,6 +168,7 @@ public class MultiException extends Exception /** * @see java.lang.Throwable#printStackTrace(java.io.PrintWriter) */ + @Override public void printStackTrace(PrintWriter out) { super.printStackTrace(out); diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/MultiMap.java b/jetty-util/src/main/java/org/eclipse/jetty/util/MultiMap.java index c26224e7649..3e3876effa2 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/MultiMap.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/MultiMap.java @@ -309,11 +309,13 @@ public class MultiMap implements ConcurrentMap return _map.entrySet(); } + @Override public boolean equals(Object o) { return _map.equals(o); } + @Override public int hashCode() { return _map.hashCode(); diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/MultiPartOutputStream.java b/jetty-util/src/main/java/org/eclipse/jetty/util/MultiPartOutputStream.java index ebb68c401d9..5653e446ed9 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/MultiPartOutputStream.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/MultiPartOutputStream.java @@ -68,6 +68,7 @@ public class MultiPartOutputStream extends FilterOutputStream /** End the current part. * @exception IOException IOException */ + @Override public void close() throws IOException { diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/MultiPartWriter.java b/jetty-util/src/main/java/org/eclipse/jetty/util/MultiPartWriter.java index 41c774a23de..e39ca94c3dd 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/MultiPartWriter.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/MultiPartWriter.java @@ -54,6 +54,7 @@ public class MultiPartWriter extends FilterWriter /** End the current part. * @exception IOException IOException */ + @Override public void close() throws IOException { diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/QuotedStringTokenizer.java b/jetty-util/src/main/java/org/eclipse/jetty/util/QuotedStringTokenizer.java index a991473758e..90729a14f1b 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/QuotedStringTokenizer.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/QuotedStringTokenizer.java @@ -85,6 +85,7 @@ public class QuotedStringTokenizer } /* ------------------------------------------------------------ */ + @Override public boolean hasMoreTokens() { // Already found a token @@ -208,6 +209,7 @@ public class QuotedStringTokenizer } /* ------------------------------------------------------------ */ + @Override public String nextToken() throws NoSuchElementException { @@ -220,6 +222,7 @@ public class QuotedStringTokenizer } /* ------------------------------------------------------------ */ + @Override public String nextToken(String delim) throws NoSuchElementException { @@ -231,12 +234,14 @@ public class QuotedStringTokenizer } /* ------------------------------------------------------------ */ + @Override public boolean hasMoreElements() { return hasMoreTokens(); } /* ------------------------------------------------------------ */ + @Override public Object nextElement() throws NoSuchElementException { @@ -246,6 +251,7 @@ public class QuotedStringTokenizer /* ------------------------------------------------------------ */ /** Not implemented. */ + @Override public int countTokens() { return -1; diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/RolloverFileOutputStream.java b/jetty-util/src/main/java/org/eclipse/jetty/util/RolloverFileOutputStream.java index ed9e96f639f..f937c13ad17 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/RolloverFileOutputStream.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/RolloverFileOutputStream.java @@ -275,6 +275,7 @@ public class RolloverFileOutputStream extends FilterOutputStream } /* ------------------------------------------------------------ */ + @Override public void write (byte[] buf) throws IOException { @@ -282,6 +283,7 @@ public class RolloverFileOutputStream extends FilterOutputStream } /* ------------------------------------------------------------ */ + @Override public void write (byte[] buf, int off, int len) throws IOException { @@ -291,6 +293,7 @@ public class RolloverFileOutputStream extends FilterOutputStream /* ------------------------------------------------------------ */ /** */ + @Override public void close() throws IOException { @@ -312,6 +315,7 @@ public class RolloverFileOutputStream extends FilterOutputStream /* ------------------------------------------------------------ */ private class RollTask extends TimerTask { + @Override public void run() { try diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/SingletonList.java b/jetty-util/src/main/java/org/eclipse/jetty/util/SingletonList.java index bf26171a293..42dda6a909c 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/SingletonList.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/SingletonList.java @@ -42,6 +42,7 @@ public class SingletonList extends AbstractList } /* ------------------------------------------------------------ */ + @Override public Object get(int i) { if (i!=0) @@ -50,24 +51,28 @@ public class SingletonList extends AbstractList } /* ------------------------------------------------------------ */ + @Override public int size() { return 1; } /* ------------------------------------------------------------ */ + @Override public ListIterator listIterator() { return new SIterator(); } /* ------------------------------------------------------------ */ + @Override public ListIterator listIterator(int i) { return new SIterator(i); } /* ------------------------------------------------------------ */ + @Override public Iterator iterator() { return new SIterator(); diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/StringMap.java b/jetty-util/src/main/java/org/eclipse/jetty/util/StringMap.java index 1c57d84b6f2..c76bfced9b2 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/StringMap.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/StringMap.java @@ -112,6 +112,7 @@ public class StringMap extends AbstractMap implements Externalizable } /* ------------------------------------------------------------ */ + @Override public Object put(Object key, Object value) { if (key==null) @@ -231,6 +232,7 @@ public class StringMap extends AbstractMap implements Externalizable } /* ------------------------------------------------------------ */ + @Override public Object get(Object key) { if (key==null) @@ -428,6 +430,7 @@ public class StringMap extends AbstractMap implements Externalizable /* ------------------------------------------------------------ */ + @Override public Object remove(Object key) { if (key==null) @@ -500,24 +503,28 @@ public class StringMap extends AbstractMap implements Externalizable } /* ------------------------------------------------------------ */ + @Override public Set entrySet() { return _umEntrySet; } /* ------------------------------------------------------------ */ + @Override public int size() { return _entrySet.size(); } /* ------------------------------------------------------------ */ + @Override public boolean isEmpty() { return _entrySet.isEmpty(); } /* ------------------------------------------------------------ */ + @Override public boolean containsKey(Object key) { if (key==null) @@ -527,6 +534,7 @@ public class StringMap extends AbstractMap implements Externalizable } /* ------------------------------------------------------------ */ + @Override public void clear() { _root=new Node(); @@ -610,6 +618,7 @@ public class StringMap extends AbstractMap implements Externalizable public Object getKey(){return _key;} public Object getValue(){return _value;} public Object setValue(Object o){Object old=_value;_value=o;return old;} + @Override public String toString() { StringBuilder buf=new StringBuilder(); @@ -658,6 +667,7 @@ public class StringMap extends AbstractMap implements Externalizable public Object getValue(){return _nullValue;} public Object setValue(Object o) {Object old=_nullValue;_nullValue=o;return old;} + @Override public String toString(){return "[:null="+_nullValue+"]";} } diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/UrlEncoded.java b/jetty-util/src/main/java/org/eclipse/jetty/util/UrlEncoded.java index d9f338a7881..6e98b53128b 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/UrlEncoded.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/UrlEncoded.java @@ -359,7 +359,7 @@ public class UrlEncoded extends MultiMap break; case '+': - buffer.append((char)' '); + buffer.append(' '); break; case '%': @@ -858,6 +858,7 @@ public class UrlEncoded extends MultiMap /* ------------------------------------------------------------ */ /** */ + @Override public Object clone() { return new UrlEncoded(this); diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/Utf8StringBuffer.java b/jetty-util/src/main/java/org/eclipse/jetty/util/Utf8StringBuffer.java index 547a410b804..79370279086 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/Utf8StringBuffer.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/Utf8StringBuffer.java @@ -152,6 +152,7 @@ public class Utf8StringBuffer return _buffer; } + @Override public String toString() { if (_more!=0) diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/Utf8StringBuilder.java b/jetty-util/src/main/java/org/eclipse/jetty/util/Utf8StringBuilder.java index 7ba2290c57b..d5d981ccd5f 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/Utf8StringBuilder.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/Utf8StringBuilder.java @@ -150,6 +150,7 @@ public class Utf8StringBuilder return _buffer; } + @Override public String toString() { if (_more!=0) diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/ajax/JSON.java b/jetty-util/src/main/java/org/eclipse/jetty/util/ajax/JSON.java index 0018f4a4761..5a9cad196c9 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/ajax/JSON.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/ajax/JSON.java @@ -202,6 +202,7 @@ public class JSON * @param in Reader containing JSON object or array. * @return A Map, Object array or primitive array parsed from the JSON. */ + @Deprecated public static Object parse(InputStream in) throws IOException { return DEFAULT.parse(new StringSource(IO.toString(in)),false); @@ -214,6 +215,7 @@ public class JSON * @param stripOuterComment If true, an outer comment around the JSON is ignored. * @return A Map, Object array or primitive array parsed from the JSON. */ + @Deprecated public static Object parse(InputStream in, boolean stripOuterComment) throws IOException { return DEFAULT.parse(new StringSource(IO.toString(in)),stripOuterComment); @@ -569,7 +571,7 @@ public class JSON protected Convertor getConvertor(Class forClass) { Class cls=forClass; - Convertor convertor=(Convertor)_convertors.get(cls.getName()); + Convertor convertor=_convertors.get(cls.getName()); if (convertor==null && this!=DEFAULT) convertor=DEFAULT.getConvertor(cls); @@ -578,11 +580,11 @@ public class JSON Class[] ifs=cls.getInterfaces(); int i=0; while (convertor==null&&ifs!=null&&i"+_child; } + @Override public int hashCode() { return _parent.hashCode()+_child.hashCode()+_relationship.hashCode(); } + @Override public boolean equals(Object o) { if (o==null || !(o instanceof Relationship)) diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/log/Slf4jLog.java b/jetty-util/src/main/java/org/eclipse/jetty/util/log/Slf4jLog.java index 0252c5f5761..a62b62824bc 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/log/Slf4jLog.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/log/Slf4jLog.java @@ -133,6 +133,7 @@ public class Slf4jLog implements Logger } /* ------------------------------------------------------------ */ + @Override public String toString() { return _logger.toString(); diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/resource/BadResource.java b/jetty-util/src/main/java/org/eclipse/jetty/util/resource/BadResource.java index be88e931663..cce463a7be3 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/resource/BadResource.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/resource/BadResource.java @@ -42,24 +42,28 @@ class BadResource extends URLResource /* -------------------------------------------------------- */ + @Override public boolean exists() { return false; } /* -------------------------------------------------------- */ + @Override public long lastModified() { return -1; } /* -------------------------------------------------------- */ + @Override public boolean isDirectory() { return false; } /* --------------------------------------------------------- */ + @Override public long length() { return -1; @@ -67,18 +71,21 @@ class BadResource extends URLResource /* ------------------------------------------------------------ */ + @Override public File getFile() { return null; } /* --------------------------------------------------------- */ + @Override public InputStream getInputStream() throws IOException { throw new FileNotFoundException(_message); } /* --------------------------------------------------------- */ + @Override public OutputStream getOutputStream() throws java.io.IOException, SecurityException { @@ -86,6 +93,7 @@ class BadResource extends URLResource } /* --------------------------------------------------------- */ + @Override public boolean delete() throws SecurityException { @@ -93,6 +101,7 @@ class BadResource extends URLResource } /* --------------------------------------------------------- */ + @Override public boolean renameTo( Resource dest) throws SecurityException { @@ -100,6 +109,7 @@ class BadResource extends URLResource } /* --------------------------------------------------------- */ + @Override public String[] list() { return null; @@ -114,6 +124,7 @@ class BadResource extends URLResource } /* ------------------------------------------------------------ */ + @Override public String toString() { return super.toString()+"; BadResource="+_message; diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/resource/FileResource.java b/jetty-util/src/main/java/org/eclipse/jetty/util/resource/FileResource.java index b0afb0507d8..e37b223e88f 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/resource/FileResource.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/resource/FileResource.java @@ -125,6 +125,7 @@ public class FileResource extends URLResource } /* -------------------------------------------------------- */ + @Override public Resource addPath(String path) throws IOException,MalformedURLException { @@ -171,6 +172,7 @@ public class FileResource extends URLResource /* ------------------------------------------------------------ */ + @Override public URL getAlias() { if (__checkAliases && !_aliasChecked) @@ -204,6 +206,7 @@ public class FileResource extends URLResource /** * Returns true if the resource exists. */ + @Override public boolean exists() { return _file.exists(); @@ -213,6 +216,7 @@ public class FileResource extends URLResource /** * Returns the last modified time */ + @Override public long lastModified() { return _file.lastModified(); @@ -222,6 +226,7 @@ public class FileResource extends URLResource /** * Returns true if the respresenetd resource is a container/directory. */ + @Override public boolean isDirectory() { return _file.isDirectory(); @@ -231,6 +236,7 @@ public class FileResource extends URLResource /** * Return the length of the resource */ + @Override public long length() { return _file.length(); @@ -241,6 +247,7 @@ public class FileResource extends URLResource /** * Returns the name of the resource */ + @Override public String getName() { return _file.getAbsolutePath(); @@ -251,6 +258,7 @@ public class FileResource extends URLResource * Returns an File representing the given resource or NULL if this * is not possible. */ + @Override public File getFile() { return _file; @@ -260,6 +268,7 @@ public class FileResource extends URLResource /** * Returns an input stream to the resource */ + @Override public InputStream getInputStream() throws IOException { return new FileInputStream(_file); @@ -269,6 +278,7 @@ public class FileResource extends URLResource /** * Returns an output stream to the resource */ + @Override public OutputStream getOutputStream() throws java.io.IOException, SecurityException { @@ -279,6 +289,7 @@ public class FileResource extends URLResource /** * Deletes the given resource */ + @Override public boolean delete() throws SecurityException { @@ -289,6 +300,7 @@ public class FileResource extends URLResource /** * Rename the given resource */ + @Override public boolean renameTo( Resource dest) throws SecurityException { @@ -302,6 +314,7 @@ public class FileResource extends URLResource /** * Returns a list of resources contained in the given resource */ + @Override public String[] list() { String[] list =_file.list(); @@ -322,6 +335,7 @@ public class FileResource extends URLResource * @param uri URI to encode. * @return The uri unchanged. */ + @Override public String encode(String uri) { return uri; @@ -332,6 +346,7 @@ public class FileResource extends URLResource * @param o * @return true of the object o is a {@link FileResource} pointing to the same file as this resource. */ + @Override public boolean equals( Object o) { if (this == o) diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/resource/JarFileResource.java b/jetty-util/src/main/java/org/eclipse/jetty/util/resource/JarFileResource.java index 8dd5e59ecfc..aa97c535053 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/resource/JarFileResource.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/resource/JarFileResource.java @@ -51,6 +51,7 @@ class JarFileResource extends JarResource /* ------------------------------------------------------------ */ + @Override public synchronized void release() { _list=null; @@ -61,6 +62,7 @@ class JarFileResource extends JarResource } /* ------------------------------------------------------------ */ + @Override protected boolean checkConnection() { try{ @@ -81,6 +83,7 @@ class JarFileResource extends JarResource /* ------------------------------------------------------------ */ + @Override protected void newConnection() throws IOException { @@ -105,6 +108,7 @@ class JarFileResource extends JarResource /** * Returns true if the respresenetd resource exists. */ + @Override public boolean exists() { if (_exists) @@ -195,6 +199,7 @@ class JarFileResource extends JarResource * If the resource is not a file, resources ending with "/" are * considered directories. */ + @Override public boolean isDirectory() { return _urlString.endsWith("/") || exists() && _directory; @@ -204,6 +209,7 @@ class JarFileResource extends JarResource /** * Returns the last modified time */ + @Override public long lastModified() { if (checkConnection() && _file!=null) @@ -212,6 +218,7 @@ class JarFileResource extends JarResource } /* ------------------------------------------------------------ */ + @Override public synchronized String[] list() { @@ -279,6 +286,7 @@ class JarFileResource extends JarResource /** * Return the length of the resource */ + @Override public long length() { if (isDirectory()) @@ -296,6 +304,7 @@ class JarFileResource extends JarResource * @param uri URI to encode. * @return The uri unchanged. */ + @Override public String encode(String uri) { return uri; @@ -327,6 +336,7 @@ class JarFileResource extends JarResource * @return * @throws MalformedURLException */ + @Override public boolean isContainedIn (Resource resource) throws MalformedURLException { diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/resource/JarResource.java b/jetty-util/src/main/java/org/eclipse/jetty/util/resource/JarResource.java index 81c08d3ba43..b7534fffe32 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/resource/JarResource.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/resource/JarResource.java @@ -47,6 +47,7 @@ public class JarResource extends URLResource } /* ------------------------------------------------------------ */ + @Override public synchronized void release() { _jarConnection=null; @@ -54,6 +55,7 @@ public class JarResource extends URLResource } /* ------------------------------------------------------------ */ + @Override protected boolean checkConnection() { super.checkConnection(); @@ -84,6 +86,7 @@ public class JarResource extends URLResource /** * Returns true if the respresenetd resource exists. */ + @Override public boolean exists() { if (_urlString.endsWith("!/")) @@ -93,6 +96,7 @@ public class JarResource extends URLResource } /* ------------------------------------------------------------ */ + @Override public File getFile() throws IOException { @@ -100,6 +104,7 @@ public class JarResource extends URLResource } /* ------------------------------------------------------------ */ + @Override public InputStream getInputStream() throws java.io.IOException { @@ -107,6 +112,7 @@ public class JarResource extends URLResource if (!_urlString.endsWith("!/")) return new FilterInputStream(super.getInputStream()) { + @Override public void close() throws IOException {this.in=IO.getClosedStream();} }; diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/resource/Resource.java b/jetty-util/src/main/java/org/eclipse/jetty/util/resource/Resource.java index 74d5e427ab9..6c8b41695fa 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/resource/Resource.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/resource/Resource.java @@ -295,6 +295,7 @@ public abstract class Resource implements Serializable } /* ------------------------------------------------------------ */ + @Override protected void finalize() { release(); diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/resource/ResourceCollection.java b/jetty-util/src/main/java/org/eclipse/jetty/util/resource/ResourceCollection.java index b1ea66cc8f5..7ff50cfe63d 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/resource/ResourceCollection.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/resource/ResourceCollection.java @@ -179,6 +179,7 @@ public class ResourceCollection extends Resource * @param path The path segment to add * @return The contained resource (found first) in the collection of resources */ + @Override public Resource addPath(String path) throws IOException, MalformedURLException { if(_resources==null) @@ -272,12 +273,14 @@ public class ResourceCollection extends Resource } /* ------------------------------------------------------------ */ + @Override public boolean delete() throws SecurityException { throw new UnsupportedOperationException(); } /* ------------------------------------------------------------ */ + @Override public boolean exists() { if(_resources==null) @@ -287,6 +290,7 @@ public class ResourceCollection extends Resource } /* ------------------------------------------------------------ */ + @Override public File getFile() throws IOException { if(_resources==null) @@ -302,6 +306,7 @@ public class ResourceCollection extends Resource } /* ------------------------------------------------------------ */ + @Override public InputStream getInputStream() throws IOException { if(_resources==null) @@ -317,6 +322,7 @@ public class ResourceCollection extends Resource } /* ------------------------------------------------------------ */ + @Override public String getName() { if(_resources==null) @@ -332,6 +338,7 @@ public class ResourceCollection extends Resource } /* ------------------------------------------------------------ */ + @Override public OutputStream getOutputStream() throws IOException, SecurityException { if(_resources==null) @@ -347,6 +354,7 @@ public class ResourceCollection extends Resource } /* ------------------------------------------------------------ */ + @Override public URL getURL() { if(_resources==null) @@ -362,6 +370,7 @@ public class ResourceCollection extends Resource } /* ------------------------------------------------------------ */ + @Override public boolean isDirectory() { if(_resources==null) @@ -371,6 +380,7 @@ public class ResourceCollection extends Resource } /* ------------------------------------------------------------ */ + @Override public long lastModified() { if(_resources==null) @@ -386,6 +396,7 @@ public class ResourceCollection extends Resource } /* ------------------------------------------------------------ */ + @Override public long length() { return -1; @@ -395,6 +406,7 @@ public class ResourceCollection extends Resource /** * @return The list of resource names(merged) contained in the collection of resources. */ + @Override public String[] list() { if(_resources==null) @@ -412,6 +424,7 @@ public class ResourceCollection extends Resource } /* ------------------------------------------------------------ */ + @Override public void release() { if(_resources==null) diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/resource/URLResource.java b/jetty-util/src/main/java/org/eclipse/jetty/util/resource/URLResource.java index 7cb7cac048f..016322cfb86 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/resource/URLResource.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/resource/URLResource.java @@ -74,6 +74,7 @@ public class URLResource extends Resource /* ------------------------------------------------------------ */ /** Release any resources held by the resource. */ + @Override public synchronized void release() { if (_in!=null) @@ -90,6 +91,7 @@ public class URLResource extends Resource /** * Returns true if the represented resource exists. */ + @Override public boolean exists() { try @@ -113,6 +115,7 @@ public class URLResource extends Resource * If the resource is not a file, resources ending with "/" are * considered directories. */ + @Override public boolean isDirectory() { return exists() && _url.toString().endsWith("/"); @@ -123,6 +126,7 @@ public class URLResource extends Resource /** * Returns the last modified time */ + @Override public long lastModified() { if (checkConnection()) @@ -135,6 +139,7 @@ public class URLResource extends Resource /** * Return the length of the resource */ + @Override public long length() { if (checkConnection()) @@ -146,6 +151,7 @@ public class URLResource extends Resource /** * Returns an URL representing the given resource */ + @Override public URL getURL() { return _url; @@ -156,6 +162,7 @@ public class URLResource extends Resource * Returns an File representing the given resource or NULL if this * is not possible. */ + @Override public File getFile() throws IOException { @@ -179,6 +186,7 @@ public class URLResource extends Resource /** * Returns the name of the resource */ + @Override public String getName() { return _url.toExternalForm(); @@ -188,6 +196,7 @@ public class URLResource extends Resource /** * Returns an input stream to the resource */ + @Override public synchronized InputStream getInputStream() throws java.io.IOException { @@ -215,6 +224,7 @@ public class URLResource extends Resource /** * Returns an output stream to the resource */ + @Override public OutputStream getOutputStream() throws java.io.IOException, SecurityException { @@ -225,6 +235,7 @@ public class URLResource extends Resource /** * Deletes the given resource */ + @Override public boolean delete() throws SecurityException { @@ -235,6 +246,7 @@ public class URLResource extends Resource /** * Rename the given resource */ + @Override public boolean renameTo( Resource dest) throws SecurityException { @@ -245,6 +257,7 @@ public class URLResource extends Resource /** * Returns a list of resource names contained in the given resource */ + @Override public String[] list() { return null; @@ -255,6 +268,7 @@ public class URLResource extends Resource * Returns the resource contained inside the current resource with the * given name */ + @Override public Resource addPath(String path) throws IOException,MalformedURLException { @@ -267,18 +281,21 @@ public class URLResource extends Resource } /* ------------------------------------------------------------ */ + @Override public String toString() { return _urlString; } /* ------------------------------------------------------------ */ + @Override public int hashCode() { return _url.hashCode(); } /* ------------------------------------------------------------ */ + @Override public boolean equals( Object o) { return o instanceof URLResource && @@ -290,6 +307,7 @@ public class URLResource extends Resource return _useCaches; } + @Override public boolean isContainedIn (Resource containingResource) throws MalformedURLException { return false; //TODO gregw check this! diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/thread/OldQueuedThreadPool.java b/jetty-util/src/main/java/org/eclipse/jetty/util/thread/OldQueuedThreadPool.java index 2999f020cb5..bb7a3e58033 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/thread/OldQueuedThreadPool.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/thread/OldQueuedThreadPool.java @@ -389,6 +389,7 @@ public class OldQueuedThreadPool extends AbstractLifeCycle implements Serializab /* Start the BoundedThreadPool. * Construct the minimum number of threads. */ + @Override protected void doStart() throws Exception { if (_maxThreads<_minThreads || _minThreads<=0) @@ -412,6 +413,7 @@ public class OldQueuedThreadPool extends AbstractLifeCycle implements Serializab * min(getMaxStopTimeMs(),getMaxIdleTimeMs()), for all jobs to * stop, at which time killJob is called. */ + @Override protected void doStop() throws Exception { super.doStop(); @@ -503,6 +505,7 @@ public class OldQueuedThreadPool extends AbstractLifeCycle implements Serializab /** BoundedThreadPool run. * Loop getting jobs and handling them until idle or stopped. */ + @Override public void run() { boolean idle=false; diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/thread/QueuedThreadPool.java b/jetty-util/src/main/java/org/eclipse/jetty/util/thread/QueuedThreadPool.java index 6ebba996ded..e19e398bb96 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/thread/QueuedThreadPool.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/thread/QueuedThreadPool.java @@ -413,6 +413,7 @@ public class QueuedThreadPool extends AbstractLifeCycle implements ThreadPool, E } /* ------------------------------------------------------------ */ + @Override public String toString() { return _name+"{"+getMinThreads()+"<="+getIdleThreads()+"<="+getThreads()+"/"+getMaxThreads()+","+(_jobs==null?-1:_jobs.size())+"}"; diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/thread/Timeout.java b/jetty-util/src/main/java/org/eclipse/jetty/util/thread/Timeout.java index 605c3989251..4cbeb9d80b3 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/thread/Timeout.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/thread/Timeout.java @@ -217,6 +217,7 @@ public class Timeout } /* ------------------------------------------------------------ */ + @Override public String toString() { StringBuffer buf = new StringBuffer(); diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/BlockingArrayQueueTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/BlockingArrayQueueTest.java index da89c08e5b9..a7ae482adc3 100644 --- a/jetty-util/src/test/java/org/eclipse/jetty/util/BlockingArrayQueueTest.java +++ b/jetty-util/src/test/java/org/eclipse/jetty/util/BlockingArrayQueueTest.java @@ -141,6 +141,7 @@ public class BlockingArrayQueueTest extends TestCase Thread thread = new Thread() { + @Override public void run() { try @@ -197,6 +198,7 @@ public class BlockingArrayQueueTest extends TestCase final Integer id = new Integer(i); new Thread() { + @Override public void run() { final Random random = new Random(); @@ -253,6 +255,7 @@ public class BlockingArrayQueueTest extends TestCase final Integer id = new Integer(i); new Thread() { + @Override public void run() { final Random random = new Random(); diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/StringMapTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/StringMapTest.java index 087bc6b49c2..15ef32f992f 100644 --- a/jetty-util/src/test/java/org/eclipse/jetty/util/StringMapTest.java +++ b/jetty-util/src/test/java/org/eclipse/jetty/util/StringMapTest.java @@ -46,6 +46,7 @@ public class StringMapTest extends TestCase /* * @see TestCase#setUp() */ + @Override protected void setUp() throws Exception { super.setUp(); @@ -72,6 +73,7 @@ public class StringMapTest extends TestCase /* * @see TestCase#tearDown() */ + @Override protected void tearDown() throws Exception { super.tearDown(); diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/StringUtilTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/StringUtilTest.java index 7a26695bec4..10d2a51bdb1 100644 --- a/jetty-util/src/test/java/org/eclipse/jetty/util/StringUtilTest.java +++ b/jetty-util/src/test/java/org/eclipse/jetty/util/StringUtilTest.java @@ -35,6 +35,7 @@ public class StringUtilTest extends TestCase /* * @see TestCase#setUp() */ + @Override protected void setUp() throws Exception { super.setUp(); @@ -43,6 +44,7 @@ public class StringUtilTest extends TestCase /* * @see TestCase#tearDown() */ + @Override protected void tearDown() throws Exception { super.tearDown(); diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/TestIntrospectionUtil.java b/jetty-util/src/test/java/org/eclipse/jetty/util/TestIntrospectionUtil.java index 7048a1b92eb..91ed6f3acf6 100644 --- a/jetty-util/src/test/java/org/eclipse/jetty/util/TestIntrospectionUtil.java +++ b/jetty-util/src/test/java/org/eclipse/jetty/util/TestIntrospectionUtil.java @@ -75,6 +75,7 @@ public class TestIntrospectionUtil extends TestCase void setDefaultD(Integer d) {} } + @Override public void setUp() throws Exception { diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/ajax/JSONPojoConvertorFactoryTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/ajax/JSONPojoConvertorFactoryTest.java index 595737f08b2..860264cb982 100644 --- a/jetty-util/src/test/java/org/eclipse/jetty/util/ajax/JSONPojoConvertorFactoryTest.java +++ b/jetty-util/src/test/java/org/eclipse/jetty/util/ajax/JSONPojoConvertorFactoryTest.java @@ -26,8 +26,8 @@ public class JSONPojoConvertorFactoryTest extends TestCase { JSON jsonOut = new JSON(); JSON jsonIn = new JSON(); - jsonOut.registerConvertor(Object.class, new JSONPojoConvertorFactory(jsonOut)); - jsonIn.registerConvertor(Object.class, new JSONPojoConvertorFactory(jsonIn)); + JSON.registerConvertor(Object.class, new JSONPojoConvertorFactory(jsonOut)); + JSON.registerConvertor(Object.class, new JSONPojoConvertorFactory(jsonIn)); Foo foo = new Foo(); foo._name = "Foo @ " + System.currentTimeMillis(); @@ -87,6 +87,7 @@ public class JSONPojoConvertorFactoryTest extends TestCase { setBazs(bazs); } + @Override public String toString() { return new StringBuffer().append("\n=== ").append(getClass().getSimpleName()).append(" ===") @@ -166,6 +167,7 @@ public class JSONPojoConvertorFactoryTest extends TestCase { setFoo(foo); } + @Override public String toString() { return new StringBuffer().append("\n=== ").append(getClass().getSimpleName()).append(" ===") @@ -223,6 +225,7 @@ public class JSONPojoConvertorFactoryTest extends TestCase { } + @Override public String toString() { return new StringBuffer().append("\n=== ").append(getClass().getSimpleName()).append(" ===") @@ -238,6 +241,7 @@ public class JSONPojoConvertorFactoryTest extends TestCase { .toString(); } + @Override public boolean equals(Object another) { if(another instanceof Foo) diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/ajax/JSONPojoConvertorTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/ajax/JSONPojoConvertorTest.java index 8d3e7677cfe..041f697a3b0 100644 --- a/jetty-util/src/test/java/org/eclipse/jetty/util/ajax/JSONPojoConvertorTest.java +++ b/jetty-util/src/test/java/org/eclipse/jetty/util/ajax/JSONPojoConvertorTest.java @@ -134,6 +134,7 @@ public class JSONPojoConvertorTest extends TestCase setBazs(bazs); } + @Override public String toString() { return new StringBuffer().append("\n=== ").append(getClass().getSimpleName()).append(" ===") @@ -213,6 +214,7 @@ public class JSONPojoConvertorTest extends TestCase setFoo(foo); } + @Override public String toString() { return new StringBuffer().append("\n=== ").append(getClass().getSimpleName()).append(" ===") @@ -270,6 +272,7 @@ public class JSONPojoConvertorTest extends TestCase } + @Override public String toString() { return new StringBuffer().append("\n=== ").append(getClass().getSimpleName()).append(" ===") @@ -285,6 +288,7 @@ public class JSONPojoConvertorTest extends TestCase .toString(); } + @Override public boolean equals(Object another) { if(another instanceof Foo) diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/component/LifeCycleListenerTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/component/LifeCycleListenerTest.java index 7740255e498..7a0631c00c0 100644 --- a/jetty-util/src/test/java/org/eclipse/jetty/util/component/LifeCycleListenerTest.java +++ b/jetty-util/src/test/java/org/eclipse/jetty/util/component/LifeCycleListenerTest.java @@ -133,6 +133,7 @@ public class LifeCycleListenerTest extends TestCase { } + @Override protected void doStart() throws Exception { if (cause!=null) @@ -140,6 +141,7 @@ public class LifeCycleListenerTest extends TestCase super.doStart(); } + @Override protected void doStop() throws Exception { if (cause!=null) diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/resource/ResourceTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/resource/ResourceTest.java index a2698dd3eef..f2133f2c382 100644 --- a/jetty-util/src/test/java/org/eclipse/jetty/util/resource/ResourceTest.java +++ b/jetty-util/src/test/java/org/eclipse/jetty/util/resource/ResourceTest.java @@ -112,6 +112,7 @@ public class ResourceTest extends junit.framework.TestCase } /* ------------------------------------------------------------ */ + @Override protected void setUp() throws Exception { @@ -190,6 +191,7 @@ public class ResourceTest extends junit.framework.TestCase /* ------------------------------------------------------------ */ + @Override protected void tearDown() throws Exception { diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/thread/TimeoutTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/thread/TimeoutTest.java index c682c224563..b6316e96fe9 100644 --- a/jetty-util/src/test/java/org/eclipse/jetty/util/thread/TimeoutTest.java +++ b/jetty-util/src/test/java/org/eclipse/jetty/util/thread/TimeoutTest.java @@ -13,7 +13,6 @@ package org.eclipse.jetty.util.thread; -import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicIntegerArray; import junit.framework.TestCase; @@ -28,6 +27,7 @@ public class TimeoutTest extends TestCase /* * @see junit.framework.TestCase#setUp() */ + @Override protected void setUp() throws Exception { super.setUp(); @@ -48,6 +48,7 @@ public class TimeoutTest extends TestCase /* * @see junit.framework.TestCase#tearDown() */ + @Override protected void tearDown() throws Exception { super.tearDown(); @@ -144,6 +145,7 @@ public class TimeoutTest extends TestCase // Start a ticker thread that will tick over the timer frequently. Thread ticker = new Thread() { + @Override public void run() { while (running[0]) @@ -174,6 +176,7 @@ public class TimeoutTest extends TestCase // Thread th = new Thread() { + @Override public void run() { // count how many threads were started (should == LOOP) @@ -182,6 +185,7 @@ public class TimeoutTest extends TestCase // create a task for this thread Timeout.Task task = new Timeout.Task() { + @Override public void expired() { // count the number of expires diff --git a/jetty-webapp-logging/src/main/java/org/eclipse/jetty/webapp/logging/CentralizedWebAppLoggingConfiguration.java b/jetty-webapp-logging/src/main/java/org/eclipse/jetty/webapp/logging/CentralizedWebAppLoggingConfiguration.java index 3c54d918f49..ac80505a877 100644 --- a/jetty-webapp-logging/src/main/java/org/eclipse/jetty/webapp/logging/CentralizedWebAppLoggingConfiguration.java +++ b/jetty-webapp-logging/src/main/java/org/eclipse/jetty/webapp/logging/CentralizedWebAppLoggingConfiguration.java @@ -17,6 +17,7 @@ package org.eclipse.jetty.webapp.logging; import java.io.FileInputStream; import java.io.IOException; + import org.eclipse.jetty.logging.impl.CentralLoggerConfig; import org.eclipse.jetty.util.IO; import org.eclipse.jetty.util.log.Log; diff --git a/jetty-webapp-logging/src/test/java/org/eclipse/jetty/webapp/logging/MavenTestingUtils.java b/jetty-webapp-logging/src/test/java/org/eclipse/jetty/webapp/logging/MavenTestingUtils.java index e9dd9162663..e8158b3e5ca 100644 --- a/jetty-webapp-logging/src/test/java/org/eclipse/jetty/webapp/logging/MavenTestingUtils.java +++ b/jetty-webapp-logging/src/test/java/org/eclipse/jetty/webapp/logging/MavenTestingUtils.java @@ -18,6 +18,7 @@ package org.eclipse.jetty.webapp.logging; import java.io.File; import java.io.FileReader; import java.io.IOException; + import junit.framework.TestCase; import org.eclipse.jetty.util.IO; diff --git a/jetty-webapp-verifier/src/main/java/org/eclipse/jetty/webapp/verifier/rules/JarSignatureRule.java b/jetty-webapp-verifier/src/main/java/org/eclipse/jetty/webapp/verifier/rules/JarSignatureRule.java index 91fc2122082..60a7e1d8b62 100644 --- a/jetty-webapp-verifier/src/main/java/org/eclipse/jetty/webapp/verifier/rules/JarSignatureRule.java +++ b/jetty-webapp-verifier/src/main/java/org/eclipse/jetty/webapp/verifier/rules/JarSignatureRule.java @@ -23,6 +23,7 @@ import java.util.Enumeration; import java.util.List; import java.util.jar.JarEntry; import java.util.jar.JarFile; + import org.eclipse.jetty.util.IO; import org.eclipse.jetty.webapp.verifier.AbstractRule; diff --git a/jetty-webapp-verifier/src/test/java/org/eclipse/jetty/webapp/verifier/AbstractTestWebappVerifier.java b/jetty-webapp-verifier/src/test/java/org/eclipse/jetty/webapp/verifier/AbstractTestWebappVerifier.java index a3dec9785d8..62dd0fa258a 100644 --- a/jetty-webapp-verifier/src/test/java/org/eclipse/jetty/webapp/verifier/AbstractTestWebappVerifier.java +++ b/jetty-webapp-verifier/src/test/java/org/eclipse/jetty/webapp/verifier/AbstractTestWebappVerifier.java @@ -16,6 +16,7 @@ package org.eclipse.jetty.webapp.verifier; import java.io.File; + import junit.framework.TestCase; import org.eclipse.jetty.util.IO; diff --git a/jetty-webapp-verifier/src/test/java/org/eclipse/jetty/webapp/verifier/rules/JarSignatureRuleTest.java b/jetty-webapp-verifier/src/test/java/org/eclipse/jetty/webapp/verifier/rules/JarSignatureRuleTest.java index 10917769d99..a85560de4cc 100644 --- a/jetty-webapp-verifier/src/test/java/org/eclipse/jetty/webapp/verifier/rules/JarSignatureRuleTest.java +++ b/jetty-webapp-verifier/src/test/java/org/eclipse/jetty/webapp/verifier/rules/JarSignatureRuleTest.java @@ -15,7 +15,6 @@ package org.eclipse.jetty.webapp.verifier.rules; import org.eclipse.jetty.webapp.verifier.AbstractTestWebappVerifier; import org.eclipse.jetty.webapp.verifier.MavenTestingUtils; import org.eclipse.jetty.webapp.verifier.WebappVerifier; -import org.eclipse.jetty.webapp.verifier.rules.JarSignatureRule; /** * Tests against {@link JarSignatureRule} diff --git a/jetty-webapp-verifier/src/test/java/org/eclipse/jetty/webapp/verifier/rules/JavaSupportLevelRuleTest.java b/jetty-webapp-verifier/src/test/java/org/eclipse/jetty/webapp/verifier/rules/JavaSupportLevelRuleTest.java index bf1561b6483..81050f6b051 100644 --- a/jetty-webapp-verifier/src/test/java/org/eclipse/jetty/webapp/verifier/rules/JavaSupportLevelRuleTest.java +++ b/jetty-webapp-verifier/src/test/java/org/eclipse/jetty/webapp/verifier/rules/JavaSupportLevelRuleTest.java @@ -1,9 +1,9 @@ package org.eclipse.jetty.webapp.verifier.rules; -import org.eclipse.jetty.webapp.verifier.RuleAssert; - import junit.framework.TestCase; +import org.eclipse.jetty.webapp.verifier.RuleAssert; + public class JavaSupportLevelRuleTest extends TestCase { public void testJava15() throws Exception diff --git a/jetty-webapp-verifier/src/test/java/org/eclipse/jetty/webapp/verifier/rules/NoNativeRuleTest.java b/jetty-webapp-verifier/src/test/java/org/eclipse/jetty/webapp/verifier/rules/NoNativeRuleTest.java index f082411392e..87a4891c8f4 100644 --- a/jetty-webapp-verifier/src/test/java/org/eclipse/jetty/webapp/verifier/rules/NoNativeRuleTest.java +++ b/jetty-webapp-verifier/src/test/java/org/eclipse/jetty/webapp/verifier/rules/NoNativeRuleTest.java @@ -1,9 +1,9 @@ package org.eclipse.jetty.webapp.verifier.rules; -import org.eclipse.jetty.webapp.verifier.RuleAssert; - import junit.framework.TestCase; +import org.eclipse.jetty.webapp.verifier.RuleAssert; + public class NoNativeRuleTest extends TestCase { public void testNoNative() throws Exception diff --git a/jetty-webapp-verifier/src/test/java/org/eclipse/jetty/webapp/verifier/rules/NoSourceControlRuleTest.java b/jetty-webapp-verifier/src/test/java/org/eclipse/jetty/webapp/verifier/rules/NoSourceControlRuleTest.java index f1716cbf59d..ddc387a50ca 100644 --- a/jetty-webapp-verifier/src/test/java/org/eclipse/jetty/webapp/verifier/rules/NoSourceControlRuleTest.java +++ b/jetty-webapp-verifier/src/test/java/org/eclipse/jetty/webapp/verifier/rules/NoSourceControlRuleTest.java @@ -15,10 +15,10 @@ // ======================================================================== package org.eclipse.jetty.webapp.verifier.rules; -import org.eclipse.jetty.webapp.verifier.RuleAssert; - import junit.framework.TestCase; +import org.eclipse.jetty.webapp.verifier.RuleAssert; + /** * NoSourceControlRuleTest */ diff --git a/jetty-webapp-verifier/src/test/java/org/eclipse/jetty/webapp/verifier/rules/ServletSupportLevelRuleTest.java b/jetty-webapp-verifier/src/test/java/org/eclipse/jetty/webapp/verifier/rules/ServletSupportLevelRuleTest.java index 756a45aac0b..621abbcee7c 100644 --- a/jetty-webapp-verifier/src/test/java/org/eclipse/jetty/webapp/verifier/rules/ServletSupportLevelRuleTest.java +++ b/jetty-webapp-verifier/src/test/java/org/eclipse/jetty/webapp/verifier/rules/ServletSupportLevelRuleTest.java @@ -1,9 +1,9 @@ package org.eclipse.jetty.webapp.verifier.rules; -import org.eclipse.jetty.webapp.verifier.RuleAssert; - import junit.framework.TestCase; +import org.eclipse.jetty.webapp.verifier.RuleAssert; + public class ServletSupportLevelRuleTest extends TestCase { public void testServlet23Rule() throws Exception diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/FragmentConfiguration.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/FragmentConfiguration.java index 8f67cc30725..47a2d9f81cc 100644 --- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/FragmentConfiguration.java +++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/FragmentConfiguration.java @@ -15,7 +15,6 @@ package org.eclipse.jetty.webapp; import java.util.List; -import java.util.regex.Pattern; import org.eclipse.jetty.util.resource.Resource; diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/JarScanner.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/JarScanner.java index 354aee9b28b..c51c50a87f9 100644 --- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/JarScanner.java +++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/JarScanner.java @@ -18,8 +18,6 @@ import java.io.InputStream; import java.net.URI; import java.net.URL; import java.net.URLClassLoader; -import java.util.ArrayList; -import java.util.List; import java.util.jar.JarEntry; import java.util.jar.JarInputStream; import java.util.regex.Pattern; diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/TagLibConfiguration.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/TagLibConfiguration.java index cee9b115989..d5b349b35cf 100644 --- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/TagLibConfiguration.java +++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/TagLibConfiguration.java @@ -21,6 +21,7 @@ import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Set; + import javax.servlet.Servlet; import org.eclipse.jetty.util.Loader; diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebAppClassLoader.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebAppClassLoader.java index 7b4d4076677..393f21cdc3d 100644 --- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebAppClassLoader.java +++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebAppClassLoader.java @@ -14,9 +14,7 @@ package org.eclipse.jetty.webapp; import java.io.File; -import java.io.FileOutputStream; import java.io.IOException; -import java.io.InputStream; import java.net.URL; import java.net.URLClassLoader; import java.security.CodeSource; @@ -25,7 +23,6 @@ import java.util.HashSet; import java.util.StringTokenizer; import org.eclipse.jetty.server.handler.ContextHandler; -import org.eclipse.jetty.util.IO; import org.eclipse.jetty.util.LazyList; import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.log.Log; diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebXmlConfiguration.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebXmlConfiguration.java index de908ddb06a..42cfe18136d 100644 --- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebXmlConfiguration.java +++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebXmlConfiguration.java @@ -14,7 +14,6 @@ package org.eclipse.jetty.webapp; import java.io.IOException; import java.net.MalformedURLException; -import java.net.URL; import java.util.Collections; import org.eclipse.jetty.security.ConstraintAware; diff --git a/jetty-xml/src/main/java/org/eclipse/jetty/xml/XmlParser.java b/jetty-xml/src/main/java/org/eclipse/jetty/xml/XmlParser.java index a963f03321e..62ead4165a6 100644 --- a/jetty-xml/src/main/java/org/eclipse/jetty/xml/XmlParser.java +++ b/jetty-xml/src/main/java/org/eclipse/jetty/xml/XmlParser.java @@ -604,6 +604,7 @@ public class XmlParser } /* ------------------------------------------------------------ */ + @Override public void add(int i, Object o) { if (_list == null) diff --git a/test-continuation/src/main/java/org/eclipse/jetty/continuation/test/ContinuationBase.java b/test-continuation/src/main/java/org/eclipse/jetty/continuation/test/ContinuationBase.java index 0ddb28b707e..0d715bd6079 100644 --- a/test-continuation/src/main/java/org/eclipse/jetty/continuation/test/ContinuationBase.java +++ b/test-continuation/src/main/java/org/eclipse/jetty/continuation/test/ContinuationBase.java @@ -24,12 +24,12 @@ import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import junit.framework.TestCase; + import org.eclipse.jetty.continuation.Continuation; import org.eclipse.jetty.continuation.ContinuationListener; import org.eclipse.jetty.continuation.ContinuationSupport; -import junit.framework.TestCase; - public abstract class ContinuationBase extends TestCase @@ -314,6 +314,7 @@ public abstract class ContinuationBase extends TestCase { TimerTask complete = new TimerTask() { + @Override public void run() { try @@ -343,6 +344,7 @@ public abstract class ContinuationBase extends TestCase { TimerTask resume = new TimerTask() { + @Override public void run() { ((HttpServletResponse)continuation.getServletResponse()).addHeader("history","resume"); @@ -396,6 +398,7 @@ public abstract class ContinuationBase extends TestCase { TimerTask complete = new TimerTask() { + @Override public void run() { try @@ -425,6 +428,7 @@ public abstract class ContinuationBase extends TestCase { TimerTask resume = new TimerTask() { + @Override public void run() { ((HttpServletResponse)response).addHeader("history","resume"); diff --git a/test-continuation/src/test/java/org/eclipse/jetty/continuation/ContinuationTest.java b/test-continuation/src/test/java/org/eclipse/jetty/continuation/ContinuationTest.java index ef48a45a9c5..f70727d03e0 100644 --- a/test-continuation/src/test/java/org/eclipse/jetty/continuation/ContinuationTest.java +++ b/test-continuation/src/test/java/org/eclipse/jetty/continuation/ContinuationTest.java @@ -35,6 +35,7 @@ public class ContinuationTest extends ContinuationBase protected SelectChannelConnector _connector; FilterHolder _filter; + @Override protected void setUp() throws Exception { _connector = new SelectChannelConnector(); @@ -50,6 +51,7 @@ public class ContinuationTest extends ContinuationBase } + @Override protected void tearDown() throws Exception { _server.stop(); diff --git a/test-jetty-servlet/src/main/java/org/eclipse/jetty/testing/HttpTester.java b/test-jetty-servlet/src/main/java/org/eclipse/jetty/testing/HttpTester.java index 9863ff25213..fd0d59ef4af 100644 --- a/test-jetty-servlet/src/main/java/org/eclipse/jetty/testing/HttpTester.java +++ b/test-jetty-servlet/src/main/java/org/eclipse/jetty/testing/HttpTester.java @@ -457,6 +457,7 @@ public class HttpTester /* ------------------------------------------------------------ */ private class PH extends HttpParser.EventHandler { + @Override public void startRequest(Buffer method, Buffer url, Buffer version) throws IOException { reset(); @@ -465,6 +466,7 @@ public class HttpTester _version=getString(version); } + @Override public void startResponse(Buffer version, int status, Buffer reason) throws IOException { reset(); @@ -473,11 +475,13 @@ public class HttpTester _reason=getString(reason); } + @Override public void parsedHeader(Buffer name, Buffer value) throws IOException { _fields.add(name,value); } + @Override public void headerComplete() throws IOException { _contentType = _fields.get(HttpHeaders.CONTENT_TYPE_BUFFER); @@ -489,10 +493,12 @@ public class HttpTester } } + @Override public void messageComplete(long contextLength) throws IOException { } + @Override public void content(Buffer ref) throws IOException { if (_parsedContent==null) diff --git a/test-jetty-servlet/src/test/java/org/eclipse/jetty/testing/ServletTest.java b/test-jetty-servlet/src/test/java/org/eclipse/jetty/testing/ServletTest.java index 82473da9be2..22e2bba9b01 100644 --- a/test-jetty-servlet/src/test/java/org/eclipse/jetty/testing/ServletTest.java +++ b/test-jetty-servlet/src/test/java/org/eclipse/jetty/testing/ServletTest.java @@ -33,6 +33,7 @@ public class ServletTest extends TestCase ServletTester tester; /* ------------------------------------------------------------ */ + @Override protected void setUp() throws Exception { super.setUp(); @@ -47,6 +48,7 @@ public class ServletTest extends TestCase } /* ------------------------------------------------------------ */ + @Override protected void tearDown() throws Exception { tester.stop(); @@ -272,10 +274,12 @@ public class ServletTest extends TestCase { private static final long serialVersionUID=2779906630657190712L; + @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doGet(request,response); } + @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html"); @@ -289,6 +293,7 @@ public class ServletTest extends TestCase { private static final long serialVersionUID=2779906630657190712L; + @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { assertEquals("/context",request.getContextPath()); @@ -303,6 +308,7 @@ public class ServletTest extends TestCase response.getWriter().print("

Test Servlet

"); } + @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { assertEquals("/context",request.getContextPath()); @@ -321,6 +327,7 @@ public class ServletTest extends TestCase public static class ExceptServlet extends HttpServlet { + @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { if ("/http".equals(request.getPathInfo())) diff --git a/test-jetty-webapp/src/main/java/com/acme/ChatServlet.java b/test-jetty-webapp/src/main/java/com/acme/ChatServlet.java index 9a3e613c27c..432925162ca 100644 --- a/test-jetty-webapp/src/main/java/com/acme/ChatServlet.java +++ b/test-jetty-webapp/src/main/java/com/acme/ChatServlet.java @@ -47,6 +47,7 @@ public class ChatServlet extends HttpServlet // Handle Ajax calls from browser + @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // Ajax calls are form encoded @@ -171,6 +172,7 @@ public class ChatServlet extends HttpServlet // Serve the HTML with embedded CSS and Javascript. // This should be static content and should use real JS libraries. + @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { if (!request.getRequestURI().endsWith("/")) diff --git a/test-jetty-webapp/src/main/java/com/acme/CookieDump.java b/test-jetty-webapp/src/main/java/com/acme/CookieDump.java index cbd08324c8b..59a8b97a254 100644 --- a/test-jetty-webapp/src/main/java/com/acme/CookieDump.java +++ b/test-jetty-webapp/src/main/java/com/acme/CookieDump.java @@ -15,7 +15,6 @@ package com.acme; import java.io.IOException; import java.io.PrintWriter; -import javax.servlet.ServletConfig; import javax.servlet.ServletException; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServlet; @@ -32,18 +31,10 @@ public class CookieDump extends HttpServlet { int redirectCount=0; - /* ------------------------------------------------------------ */ - public void init(ServletConfig config) - throws ServletException - { - super.init(config); - } - /* ------------------------------------------------------------ */ protected void handleForm(HttpServletRequest request, HttpServletResponse response) { - String action = request.getParameter("Action"); String name = request.getParameter("Name"); String value = request.getParameter("Value"); String age = request.getParameter("Age"); @@ -58,6 +49,7 @@ public class CookieDump extends HttpServlet } /* ------------------------------------------------------------ */ + @Override public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException @@ -69,6 +61,7 @@ public class CookieDump extends HttpServlet } /* ------------------------------------------------------------ */ + @Override public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException @@ -98,6 +91,7 @@ public class CookieDump extends HttpServlet } /* ------------------------------------------------------------ */ + @Override public String getServletInfo() { return "Session Dump Servlet"; } diff --git a/test-jetty-webapp/src/main/java/com/acme/DispatchServlet.java b/test-jetty-webapp/src/main/java/com/acme/DispatchServlet.java index d353d414819..e35c1c09c61 100644 --- a/test-jetty-webapp/src/main/java/com/acme/DispatchServlet.java +++ b/test-jetty-webapp/src/main/java/com/acme/DispatchServlet.java @@ -17,7 +17,6 @@ import java.io.OutputStream; import java.io.PrintWriter; import javax.servlet.RequestDispatcher; -import javax.servlet.ServletConfig; import javax.servlet.ServletContext; import javax.servlet.ServletException; import javax.servlet.ServletOutputStream; @@ -41,18 +40,14 @@ public class DispatchServlet extends HttpServlet String pageType; /* ------------------------------------------------------------ */ - public void init(ServletConfig config) throws ServletException - { - super.init(config); - } - - /* ------------------------------------------------------------ */ + @Override public void doPost(HttpServletRequest sreq, HttpServletResponse sres) throws ServletException, IOException { doGet(sreq, sres); } /* ------------------------------------------------------------ */ + @Override public void doGet(HttpServletRequest sreq, HttpServletResponse sres) throws ServletException, IOException { if (sreq.getParameter("wrap") != null) @@ -264,12 +259,14 @@ public class DispatchServlet extends HttpServlet } /* ------------------------------------------------------------ */ + @Override public String getServletInfo() { return "Include Servlet"; } /* ------------------------------------------------------------ */ + @Override public synchronized void destroy() { } diff --git a/test-jetty-webapp/src/main/java/com/acme/Dump.java b/test-jetty-webapp/src/main/java/com/acme/Dump.java index 3a28ccfa11c..98247193218 100644 --- a/test-jetty-webapp/src/main/java/com/acme/Dump.java +++ b/test-jetty-webapp/src/main/java/com/acme/Dump.java @@ -65,12 +65,14 @@ public class Dump extends HttpServlet } /* ------------------------------------------------------------ */ + @Override public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doGet(request, response); } /* ------------------------------------------------------------ */ + @Override public void doGet(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException { if(request.getPathInfo()!=null && request.getPathInfo().toLowerCase().indexOf("script")!=-1) @@ -796,12 +798,14 @@ public class Dump extends HttpServlet } /* ------------------------------------------------------------ */ + @Override public String getServletInfo() { return "Dump Servlet"; } /* ------------------------------------------------------------ */ + @Override public synchronized void destroy() { } diff --git a/test-jetty-webapp/src/main/java/com/acme/RewriteServlet.java b/test-jetty-webapp/src/main/java/com/acme/RewriteServlet.java index 7d4415d1e55..b7f219dd5b9 100644 --- a/test-jetty-webapp/src/main/java/com/acme/RewriteServlet.java +++ b/test-jetty-webapp/src/main/java/com/acme/RewriteServlet.java @@ -13,22 +13,13 @@ package com.acme; import java.io.IOException; -import java.io.OutputStream; -import java.io.PrintWriter; -import javax.servlet.RequestDispatcher; -import javax.servlet.ServletConfig; -import javax.servlet.ServletContext; import javax.servlet.ServletException; import javax.servlet.ServletOutputStream; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletRequestWrapper; import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpServletResponseWrapper; - -import org.eclipse.jetty.util.log.Log; /* ------------------------------------------------------------ */ @@ -39,12 +30,14 @@ import org.eclipse.jetty.util.log.Log; public class RewriteServlet extends HttpServlet { /* ------------------------------------------------------------ */ + @Override public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { doGet(req, res); } /* ------------------------------------------------------------ */ + @Override public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { ServletOutputStream out = res.getOutputStream(); diff --git a/test-jetty-webapp/src/main/java/com/acme/SecureModeServlet.java b/test-jetty-webapp/src/main/java/com/acme/SecureModeServlet.java index fc1b4f64f3d..6a714dc2828 100644 --- a/test-jetty-webapp/src/main/java/com/acme/SecureModeServlet.java +++ b/test-jetty-webapp/src/main/java/com/acme/SecureModeServlet.java @@ -93,13 +93,12 @@ public class SecureModeServlet extends HttpServlet out.println("

Checking Classloader Setup

"); out.println("

"); - String userDir = System.getProperty("user.dir"); + System.getProperty("user.dir"); try { out.println("check ability to create classloader
"); URL url = new URL("http://not.going.to.work"); - URLClassLoader cl = new URLClassLoader(new URL[] - { url }); + new URLClassLoader(new URL[] { url }); out.println("status: SUCCESS - unexpected
"); } catch (SecurityException e) @@ -282,7 +281,7 @@ public class SecureModeServlet extends HttpServlet try { out.println("check read permission for __ALLOWED_READ_PROPERTY
"); - String value = System.getProperty("__ALLOWED_READ_PROPERTY"); + System.getProperty("__ALLOWED_READ_PROPERTY"); out.println("status: SUCCESS - expected
"); } catch (SecurityException e) @@ -314,7 +313,7 @@ public class SecureModeServlet extends HttpServlet try { out.println("check read permission for __ALLOWED_WRITE_PROPERTY
"); - String value = System.getProperty("__ALLOWED_WRITE_PROPERTY"); + System.getProperty("__ALLOWED_WRITE_PROPERTY"); out.println("Status: SUCCESS - expected
"); } catch (SecurityException e) @@ -349,7 +348,7 @@ public class SecureModeServlet extends HttpServlet try { out.println("check read permission for __UNDECLARED_PROPERTY:
"); - String value = System.getProperty("__UNDECLARED_PROPERTY"); + System.getProperty("__UNDECLARED_PROPERTY"); out.println("status: SUCCESS - expected
"); } catch (SecurityException e) diff --git a/test-jetty-webapp/src/main/java/com/acme/SessionDump.java b/test-jetty-webapp/src/main/java/com/acme/SessionDump.java index 8395c9b58be..939edeb0e97 100644 --- a/test-jetty-webapp/src/main/java/com/acme/SessionDump.java +++ b/test-jetty-webapp/src/main/java/com/acme/SessionDump.java @@ -38,6 +38,7 @@ public class SessionDump extends HttpServlet String pageType; /* ------------------------------------------------------------ */ + @Override public void init(ServletConfig config) throws ServletException { @@ -73,6 +74,7 @@ public class SessionDump extends HttpServlet } /* ------------------------------------------------------------ */ + @Override public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException @@ -84,6 +86,7 @@ public class SessionDump extends HttpServlet } /* ------------------------------------------------------------ */ + @Override public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException @@ -160,6 +163,7 @@ public class SessionDump extends HttpServlet } /* ------------------------------------------------------------ */ + @Override public String getServletInfo() { return "Session Dump Servlet"; } diff --git a/test-jetty-webapp/src/main/java/com/acme/TestListener.java b/test-jetty-webapp/src/main/java/com/acme/TestListener.java index bc5d48b05e6..69841e645cb 100644 --- a/test-jetty-webapp/src/main/java/com/acme/TestListener.java +++ b/test-jetty-webapp/src/main/java/com/acme/TestListener.java @@ -13,7 +13,6 @@ package com.acme; -import javax.servlet.ServletContext; import javax.servlet.ServletContextAttributeEvent; import javax.servlet.ServletContextAttributeListener; import javax.servlet.ServletContextEvent; @@ -57,9 +56,7 @@ public class TestListener implements HttpSessionListener, HttpSessionAttributeL } public void contextInitialized(ServletContextEvent sce) - { - ServletContext context=sce.getServletContext(); - + { /* TODO for servlet 3.0 * FilterRegistration registration=context.addFilter("TestFilter",TestFilter.class.getName()); diff --git a/test-jetty-webapp/src/test/java/org/eclipse/jetty/DemoServer.java b/test-jetty-webapp/src/test/java/org/eclipse/jetty/DemoServer.java index 5a259db6548..ef1d2452969 100644 --- a/test-jetty-webapp/src/test/java/org/eclipse/jetty/DemoServer.java +++ b/test-jetty-webapp/src/test/java/org/eclipse/jetty/DemoServer.java @@ -8,10 +8,8 @@ import org.eclipse.jetty.http.security.Password; import org.eclipse.jetty.jmx.MBeanContainer; import org.eclipse.jetty.security.HashLoginService; import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.server.handler.ContextHandler; import org.eclipse.jetty.server.handler.ContextHandlerCollection; import org.eclipse.jetty.server.nio.SelectChannelConnector; -import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.webapp.WebAppContext; public class DemoServer diff --git a/tests/test-integration/src/test/java/org/eclipse/jetty/test/support/rawhttp/HttpResponseTesterTest.java b/tests/test-integration/src/test/java/org/eclipse/jetty/test/support/rawhttp/HttpResponseTesterTest.java index f06bd70ca88..be22a94b730 100644 --- a/tests/test-integration/src/test/java/org/eclipse/jetty/test/support/rawhttp/HttpResponseTesterTest.java +++ b/tests/test-integration/src/test/java/org/eclipse/jetty/test/support/rawhttp/HttpResponseTesterTest.java @@ -16,12 +16,14 @@ package org.eclipse.jetty.test.support.rawhttp; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.CoreMatchers.not; +import static org.junit.Assert.assertThat; + import java.io.IOException; import java.util.List; import org.eclipse.jetty.test.AbstractJettyTestCase; -import static org.junit.Assert.*; -import static org.hamcrest.CoreMatchers.*; import org.junit.Test; public class HttpResponseTesterTest extends AbstractJettyTestCase diff --git a/tests/test-integration/src/test/java/org/eclipse/jetty/test/support/rawhttp/HttpTesting.java b/tests/test-integration/src/test/java/org/eclipse/jetty/test/support/rawhttp/HttpTesting.java index 5205927944a..27d58e426b0 100644 --- a/tests/test-integration/src/test/java/org/eclipse/jetty/test/support/rawhttp/HttpTesting.java +++ b/tests/test-integration/src/test/java/org/eclipse/jetty/test/support/rawhttp/HttpTesting.java @@ -27,7 +27,6 @@ import java.net.SocketTimeoutException; import java.net.UnknownHostException; import java.util.List; -import org.eclipse.jetty.test.StringAssert; import org.eclipse.jetty.test.support.StringUtil; import org.eclipse.jetty.util.IO;