You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by gg...@apache.org on 2016/06/23 20:13:53 UTC

svn commit: r1750010 - in /httpcomponents/httpcore/branches/4.4.x: httpcore-nio/src/main/java/org/apache/http/impl/nio/ httpcore-nio/src/main/java/org/apache/http/impl/nio/bootstrap/ httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/ httpcore...

Author: ggregory
Date: Thu Jun 23 20:13:52 2016
New Revision: 1750010

URL: http://svn.apache.org/viewvc?rev=1750010&view=rev
Log:
Add final modifier to local variables.

Modified:
    httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/main/java/org/apache/http/impl/nio/SSLContextUtils.java
    httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/main/java/org/apache/http/impl/nio/bootstrap/HttpServer.java
    httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/main/java/org/apache/http/impl/nio/bootstrap/ServerBootstrap.java
    httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/DefaultConnectingIOReactor.java
    httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncRequester.java
    httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncService.java
    httpcomponents/httpcore/branches/4.4.x/httpcore-osgi/src/test/java/org/apache/http/osgi/Common.java
    httpcomponents/httpcore/branches/4.4.x/httpcore/src/main/java/org/apache/http/HttpHost.java
    httpcomponents/httpcore/branches/4.4.x/httpcore/src/main/java/org/apache/http/entity/ContentType.java
    httpcomponents/httpcore/branches/4.4.x/httpcore/src/main/java/org/apache/http/impl/BHttpConnectionBase.java
    httpcomponents/httpcore/branches/4.4.x/httpcore/src/main/java/org/apache/http/impl/bootstrap/HttpServer.java
    httpcomponents/httpcore/branches/4.4.x/httpcore/src/main/java/org/apache/http/impl/bootstrap/RequestListener.java
    httpcomponents/httpcore/branches/4.4.x/httpcore/src/main/java/org/apache/http/impl/bootstrap/ServerBootstrap.java
    httpcomponents/httpcore/branches/4.4.x/httpcore/src/main/java/org/apache/http/impl/bootstrap/Worker.java
    httpcomponents/httpcore/branches/4.4.x/httpcore/src/main/java/org/apache/http/impl/io/ChunkedInputStream.java
    httpcomponents/httpcore/branches/4.4.x/httpcore/src/main/java/org/apache/http/message/BasicHeaderValueParser.java

Modified: httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/main/java/org/apache/http/impl/nio/SSLContextUtils.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/main/java/org/apache/http/impl/nio/SSLContextUtils.java?rev=1750010&r1=1750009&r2=1750010&view=diff
==============================================================================
--- httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/main/java/org/apache/http/impl/nio/SSLContextUtils.java (original)
+++ httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/main/java/org/apache/http/impl/nio/SSLContextUtils.java Thu Jun 23 20:13:52 2016
@@ -37,7 +37,7 @@ class SSLContextUtils {
         try {
             try {
                 sslcontext = SSLContext.getInstance("Default");
-            }  catch (NoSuchAlgorithmException ex) {
+            }  catch (final NoSuchAlgorithmException ex) {
                 sslcontext = SSLContext.getInstance("TLS");
             }
             sslcontext.init(null, null, null);

Modified: httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/main/java/org/apache/http/impl/nio/bootstrap/HttpServer.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/main/java/org/apache/http/impl/nio/bootstrap/HttpServer.java?rev=1750010&r1=1750009&r2=1750010&view=diff
==============================================================================
--- httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/main/java/org/apache/http/impl/nio/bootstrap/HttpServer.java (original)
+++ httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/main/java/org/apache/http/impl/nio/bootstrap/HttpServer.java Thu Jun 23 20:13:52 2016
@@ -86,7 +86,7 @@ public class HttpServer {
             this.ioReactor = new DefaultListeningIOReactor(
                     this.ioReactorConfig,
                     new ThreadFactoryImpl("I/O-dispatch", this.dispatchThreads));
-        } catch (IOReactorException ex) {
+        } catch (final IOReactorException ex) {
             throw new IllegalStateException(ex);
         }
         this.ioReactor.setExceptionHandler(new IOReactorExceptionHandler() {
@@ -120,7 +120,7 @@ public class HttpServer {
                 public void run() {
                     try {
                         ioReactor.execute(ioEventDispatch);
-                    } catch (Exception ex) {
+                    } catch (final Exception ex) {
                         exceptionLogger.log(ex);
                     }
                 }
@@ -137,7 +137,7 @@ public class HttpServer {
         if (this.status.compareAndSet(Status.ACTIVE, Status.STOPPING)) {
             try {
                 this.ioReactor.shutdown(timeUnit.toMillis(gracePeriod));
-            } catch (IOException ex) {
+            } catch (final IOException ex) {
                 this.exceptionLogger.log(ex);
             }
             this.listenerExecutorService.shutdown();

Modified: httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/main/java/org/apache/http/impl/nio/bootstrap/ServerBootstrap.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/main/java/org/apache/http/impl/nio/bootstrap/ServerBootstrap.java?rev=1750010&r1=1750009&r2=1750010&view=diff
==============================================================================
--- httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/main/java/org/apache/http/impl/nio/bootstrap/ServerBootstrap.java (original)
+++ httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/main/java/org/apache/http/impl/nio/bootstrap/ServerBootstrap.java Thu Jun 23 20:13:52 2016
@@ -349,7 +349,7 @@ public class ServerBootstrap {
         if (handlerMapperCopy == null) {
             final UriHttpAsyncRequestHandlerMapper reqistry = new UriHttpAsyncRequestHandlerMapper();
             if (handlerMap != null) {
-                for (Map.Entry<String, HttpAsyncRequestHandler<?>> entry: handlerMap.entrySet()) {
+                for (final Map.Entry<String, HttpAsyncRequestHandler<?>> entry: handlerMap.entrySet()) {
                     reqistry.register(entry.getKey(), entry.getValue());
                 }
             }

Modified: httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/DefaultConnectingIOReactor.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/DefaultConnectingIOReactor.java?rev=1750010&r1=1750009&r2=1750010&view=diff
==============================================================================
--- httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/DefaultConnectingIOReactor.java (original)
+++ httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/DefaultConnectingIOReactor.java Thu Jun 23 20:13:52 2016
@@ -179,7 +179,7 @@ public class DefaultConnectingIOReactor
                 } else {
                     try {
                         channel.close();
-                    } catch (IOException ignore) {
+                    } catch (final IOException ignore) {
                     }
                 }
             }

Modified: httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncRequester.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncRequester.java?rev=1750010&r1=1750009&r2=1750010&view=diff
==============================================================================
--- httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncRequester.java (original)
+++ httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncRequester.java Thu Jun 23 20:13:52 2016
@@ -491,7 +491,7 @@ public class HttpAsyncRequester {
         public void failed(final Exception ex) {
             try {
                 try {
-                    for (HttpAsyncResponseConsumer<T> responseConsumer: this.responseConsumers) {
+                    for (final HttpAsyncResponseConsumer<T> responseConsumer: this.responseConsumers) {
                         responseConsumer.failed(ex);
                     }
                 } finally {
@@ -506,7 +506,7 @@ public class HttpAsyncRequester {
         public void cancelled() {
             try {
                 try {
-                    for (HttpAsyncResponseConsumer<T> responseConsumer: this.responseConsumers) {
+                    for (final HttpAsyncResponseConsumer<T> responseConsumer: this.responseConsumers) {
                         responseConsumer.cancel();
                     }
                 } finally {
@@ -518,10 +518,10 @@ public class HttpAsyncRequester {
         }
 
         public void releaseResources() {
-            for (HttpAsyncRequestProducer requestProducer: this.requestProducers) {
+            for (final HttpAsyncRequestProducer requestProducer: this.requestProducers) {
                 close(requestProducer);
             }
-            for (HttpAsyncResponseConsumer<T> responseConsumer: this.responseConsumers) {
+            for (final HttpAsyncResponseConsumer<T> responseConsumer: this.responseConsumers) {
                 close(responseConsumer);
             }
         }
@@ -588,7 +588,7 @@ public class HttpAsyncRequester {
     private void close(final Closeable closeable) {
         try {
             closeable.close();
-        } catch (IOException ex) {
+        } catch (final IOException ex) {
             log(ex);
         }
     }

Modified: httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncService.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncService.java?rev=1750010&r1=1750009&r2=1750010&view=diff
==============================================================================
--- httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncService.java (original)
+++ httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncService.java Thu Jun 23 20:13:52 2016
@@ -447,9 +447,9 @@ public class HttpAsyncService implements
                     conn.suspendOutput();
                     try {
                         handler.handle(result, httpExchange, context);
-                    } catch (RuntimeException ex) {
+                    } catch (final RuntimeException ex) {
                         throw ex;
-                    } catch (Exception ex) {
+                    } catch (final Exception ex) {
                         pipeline.add(new PipelineEntry(
                             request,
                             null,

Modified: httpcomponents/httpcore/branches/4.4.x/httpcore-osgi/src/test/java/org/apache/http/osgi/Common.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/branches/4.4.x/httpcore-osgi/src/test/java/org/apache/http/osgi/Common.java?rev=1750010&r1=1750009&r2=1750010&view=diff
==============================================================================
--- httpcomponents/httpcore/branches/4.4.x/httpcore-osgi/src/test/java/org/apache/http/osgi/Common.java (original)
+++ httpcomponents/httpcore/branches/4.4.x/httpcore-osgi/src/test/java/org/apache/http/osgi/Common.java Thu Jun 23 20:13:52 2016
@@ -58,7 +58,7 @@ public class Common {
         final Properties depProps = new Properties();
         try {
             depProps.load(depPropsUrl.openStream());
-        } catch (IOException e) {
+        } catch (final IOException e) {
             throw new RuntimeException(e);
         }
         String ver = (String) depProps.get(String.format("%s/%s/version", groupId, artifactId));

Modified: httpcomponents/httpcore/branches/4.4.x/httpcore/src/main/java/org/apache/http/HttpHost.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/branches/4.4.x/httpcore/src/main/java/org/apache/http/HttpHost.java?rev=1750010&r1=1750009&r2=1750010&view=diff
==============================================================================
--- httpcomponents/httpcore/branches/4.4.x/httpcore/src/main/java/org/apache/http/HttpHost.java (original)
+++ httpcomponents/httpcore/branches/4.4.x/httpcore/src/main/java/org/apache/http/HttpHost.java Thu Jun 23 20:13:52 2016
@@ -119,7 +119,7 @@ public final class HttpHost implements C
         if (portIdx > 0) {
             try {
                 port = Integer.parseInt(text.substring(portIdx + 1));
-            } catch (NumberFormatException ex) {
+            } catch (final NumberFormatException ex) {
                 throw new IllegalArgumentException("Invalid HTTP host: " + text);
             }
             text = text.substring(0, portIdx);

Modified: httpcomponents/httpcore/branches/4.4.x/httpcore/src/main/java/org/apache/http/entity/ContentType.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/branches/4.4.x/httpcore/src/main/java/org/apache/http/entity/ContentType.java?rev=1750010&r1=1750009&r2=1750010&view=diff
==============================================================================
--- httpcomponents/httpcore/branches/4.4.x/httpcore/src/main/java/org/apache/http/entity/ContentType.java (original)
+++ httpcomponents/httpcore/branches/4.4.x/httpcore/src/main/java/org/apache/http/entity/ContentType.java Thu Jun 23 20:13:52 2016
@@ -222,7 +222,7 @@ public final class ContentType implement
                 if (!TextUtils.isBlank(s)) {
                     try {
                         charset =  Charset.forName(s);
-                    } catch (UnsupportedCharsetException ex) {
+                    } catch (final UnsupportedCharsetException ex) {
                         if (strict) {
                             throw ex;
                         }
@@ -323,7 +323,7 @@ public final class ContentType implement
                 if (elements.length > 0) {
                     return create(elements[0], false);
                 }
-            } catch (ParseException ex) {
+            } catch (final ParseException ex) {
                 return null;
             }
         }
@@ -400,18 +400,18 @@ public final class ContentType implement
         }
         final Map<String, String> paramMap = new LinkedHashMap<String, String>();
         if (this.params != null) {
-            for (NameValuePair param: this.params) {
+            for (final NameValuePair param: this.params) {
                 paramMap.put(param.getName(), param.getValue());
             }
         }
-        for (NameValuePair param: params) {
+        for (final NameValuePair param: params) {
             paramMap.put(param.getName(), param.getValue());
         }
         final List<NameValuePair> newParams = new ArrayList<NameValuePair>(paramMap.size() + 1);
         if (this.charset != null && !paramMap.containsKey("charset")) {
             newParams.add(new BasicNameValuePair("charset", this.charset.name()));
         }
-        for (Map.Entry<String, String> entry: paramMap.entrySet()) {
+        for (final Map.Entry<String, String> entry: paramMap.entrySet()) {
             newParams.add(new BasicNameValuePair(entry.getKey(), entry.getValue()));
         }
         return create(this.getMimeType(), newParams.toArray(new NameValuePair[newParams.size()]), true);

Modified: httpcomponents/httpcore/branches/4.4.x/httpcore/src/main/java/org/apache/http/impl/BHttpConnectionBase.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/branches/4.4.x/httpcore/src/main/java/org/apache/http/impl/BHttpConnectionBase.java?rev=1750010&r1=1750009&r2=1750010&view=diff
==============================================================================
--- httpcomponents/httpcore/branches/4.4.x/httpcore/src/main/java/org/apache/http/impl/BHttpConnectionBase.java (original)
+++ httpcomponents/httpcore/branches/4.4.x/httpcore/src/main/java/org/apache/http/impl/BHttpConnectionBase.java Thu Jun 23 20:13:52 2016
@@ -304,7 +304,7 @@ public class BHttpConnectionBase impleme
             // force abortive close (RST)
             try {
                 socket.setSoLinger(true, 0);
-            } catch (IOException ex) {
+            } catch (final IOException ex) {
             } finally {
                 socket.close();
             }

Modified: httpcomponents/httpcore/branches/4.4.x/httpcore/src/main/java/org/apache/http/impl/bootstrap/HttpServer.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/branches/4.4.x/httpcore/src/main/java/org/apache/http/impl/bootstrap/HttpServer.java?rev=1750010&r1=1750009&r2=1750010&view=diff
==============================================================================
--- httpcomponents/httpcore/branches/4.4.x/httpcore/src/main/java/org/apache/http/impl/bootstrap/HttpServer.java (original)
+++ httpcomponents/httpcore/branches/4.4.x/httpcore/src/main/java/org/apache/http/impl/bootstrap/HttpServer.java Thu Jun 23 20:13:52 2016
@@ -145,7 +145,7 @@ public class HttpServer {
             if (local != null) {
                 try {
                     local.terminate();
-                } catch (IOException ex) {
+                } catch (final IOException ex) {
                     this.exceptionLogger.log(ex);
                 }
             }
@@ -162,16 +162,16 @@ public class HttpServer {
         if (gracePeriod > 0) {
             try {
                 awaitTermination(gracePeriod, timeUnit);
-            } catch (InterruptedException ex) {
+            } catch (final InterruptedException ex) {
                 Thread.currentThread().interrupt();
             }
         }
         final Set<Worker> workers = this.workerExecutorService.getWorkers();
-        for (Worker worker: workers) {
+        for (final Worker worker: workers) {
             final HttpServerConnection conn = worker.getConnection();
             try {
                 conn.shutdown();
-            } catch (IOException ex) {
+            } catch (final IOException ex) {
                 this.exceptionLogger.log(ex);
             }
         }

Modified: httpcomponents/httpcore/branches/4.4.x/httpcore/src/main/java/org/apache/http/impl/bootstrap/RequestListener.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/branches/4.4.x/httpcore/src/main/java/org/apache/http/impl/bootstrap/RequestListener.java?rev=1750010&r1=1750009&r2=1750010&view=diff
==============================================================================
--- httpcomponents/httpcore/branches/4.4.x/httpcore/src/main/java/org/apache/http/impl/bootstrap/RequestListener.java (original)
+++ httpcomponents/httpcore/branches/4.4.x/httpcore/src/main/java/org/apache/http/impl/bootstrap/RequestListener.java Thu Jun 23 20:13:52 2016
@@ -88,7 +88,7 @@ class RequestListener implements Runnabl
                 final Worker worker = new Worker(this.httpService, conn, this.exceptionLogger);
                 this.executorService.execute(worker);
             }
-        } catch (Exception ex) {
+        } catch (final Exception ex) {
             this.exceptionLogger.log(ex);
         }
     }

Modified: httpcomponents/httpcore/branches/4.4.x/httpcore/src/main/java/org/apache/http/impl/bootstrap/ServerBootstrap.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/branches/4.4.x/httpcore/src/main/java/org/apache/http/impl/bootstrap/ServerBootstrap.java?rev=1750010&r1=1750009&r2=1750010&view=diff
==============================================================================
--- httpcomponents/httpcore/branches/4.4.x/httpcore/src/main/java/org/apache/http/impl/bootstrap/ServerBootstrap.java (original)
+++ httpcomponents/httpcore/branches/4.4.x/httpcore/src/main/java/org/apache/http/impl/bootstrap/ServerBootstrap.java Thu Jun 23 20:13:52 2016
@@ -354,7 +354,7 @@ public class ServerBootstrap {
         if (handlerMapperCopy == null) {
             final UriHttpRequestHandlerMapper reqistry = new UriHttpRequestHandlerMapper();
             if (handlerMap != null) {
-                for (Map.Entry<String, HttpRequestHandler> entry: handlerMap.entrySet()) {
+                for (final Map.Entry<String, HttpRequestHandler> entry: handlerMap.entrySet()) {
                     reqistry.register(entry.getKey(), entry.getValue());
                 }
             }

Modified: httpcomponents/httpcore/branches/4.4.x/httpcore/src/main/java/org/apache/http/impl/bootstrap/Worker.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/branches/4.4.x/httpcore/src/main/java/org/apache/http/impl/bootstrap/Worker.java?rev=1750010&r1=1750009&r2=1750010&view=diff
==============================================================================
--- httpcomponents/httpcore/branches/4.4.x/httpcore/src/main/java/org/apache/http/impl/bootstrap/Worker.java (original)
+++ httpcomponents/httpcore/branches/4.4.x/httpcore/src/main/java/org/apache/http/impl/bootstrap/Worker.java Thu Jun 23 20:13:52 2016
@@ -67,12 +67,12 @@ class Worker implements Runnable {
                 localContext.clear();
             }
             this.conn.close();
-        } catch (Exception ex) {
+        } catch (final Exception ex) {
             this.exceptionLogger.log(ex);
         } finally {
             try {
                 this.conn.shutdown();
-            } catch (IOException ex) {
+            } catch (final IOException ex) {
                 this.exceptionLogger.log(ex);
             }
         }

Modified: httpcomponents/httpcore/branches/4.4.x/httpcore/src/main/java/org/apache/http/impl/io/ChunkedInputStream.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/branches/4.4.x/httpcore/src/main/java/org/apache/http/impl/io/ChunkedInputStream.java?rev=1750010&r1=1750009&r2=1750010&view=diff
==============================================================================
--- httpcomponents/httpcore/branches/4.4.x/httpcore/src/main/java/org/apache/http/impl/io/ChunkedInputStream.java (original)
+++ httpcomponents/httpcore/branches/4.4.x/httpcore/src/main/java/org/apache/http/impl/io/ChunkedInputStream.java Thu Jun 23 20:13:52 2016
@@ -232,7 +232,7 @@ public class ChunkedInputStream extends
                 eof = true;
                 parseTrailerHeaders();
             }
-        } catch (MalformedChunkCodingException ex) {
+        } catch (final MalformedChunkCodingException ex) {
             state = CHUNK_INVALID;
             throw ex;
         }

Modified: httpcomponents/httpcore/branches/4.4.x/httpcore/src/main/java/org/apache/http/message/BasicHeaderValueParser.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/branches/4.4.x/httpcore/src/main/java/org/apache/http/message/BasicHeaderValueParser.java?rev=1750010&r1=1750009&r2=1750010&view=diff
==============================================================================
--- httpcomponents/httpcore/branches/4.4.x/httpcore/src/main/java/org/apache/http/message/BasicHeaderValueParser.java (original)
+++ httpcomponents/httpcore/branches/4.4.x/httpcore/src/main/java/org/apache/http/message/BasicHeaderValueParser.java Thu Jun 23 20:13:52 2016
@@ -265,7 +265,7 @@ public class BasicHeaderValueParser impl
 
         final BitSet delimSet = new BitSet();
         if (delimiters != null) {
-            for (char delimiter: delimiters) {
+            for (final char delimiter: delimiters) {
                 delimSet.set(delimiter);
             }
         }