You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2008/08/29 20:35:30 UTC

svn commit: r690361 - in /httpcomponents/httpcore/trunk/module-nio/src: main/java/org/apache/http/nio/protocol/ main/java/org/apache/http/nio/util/ test/java/org/apache/http/nio/protocol/

Author: olegk
Date: Fri Aug 29 11:35:29 2008
New Revision: 690361

URL: http://svn.apache.org/viewvc?rev=690361&view=rev
Log:
Changed #close method() of the Shared*Buffer classes to not throw IOException

Modified:
    httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/protocol/ThrottlingHttpClientHandler.java
    httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/protocol/ThrottlingHttpServiceHandler.java
    httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/util/SharedInputBuffer.java
    httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/util/SharedOutputBuffer.java
    httpcomponents/httpcore/trunk/module-nio/src/test/java/org/apache/http/nio/protocol/TestThrottlingNHttpHandlers.java

Modified: httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/protocol/ThrottlingHttpClientHandler.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/protocol/ThrottlingHttpClientHandler.java?rev=690361&r1=690360&r2=690361&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/protocol/ThrottlingHttpClientHandler.java (original)
+++ httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/protocol/ThrottlingHttpClientHandler.java Fri Aug 29 11:35:29 2008
@@ -637,14 +637,8 @@
         }
 
         public void close() {
-            try {
-                this.inbuffer.close();
-            } catch (IOException ignore) {
-            }
-            try {
-                this.outbuffer.close();
-            } catch (IOException ignore) {
-            }
+            this.inbuffer.close();
+            this.outbuffer.close();
             this.inputState = SHUTDOWN;
             this.outputState = SHUTDOWN;
         }

Modified: httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/protocol/ThrottlingHttpServiceHandler.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/protocol/ThrottlingHttpServiceHandler.java?rev=690361&r1=690360&r2=690361&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/protocol/ThrottlingHttpServiceHandler.java (original)
+++ httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/protocol/ThrottlingHttpServiceHandler.java Fri Aug 29 11:35:29 2008
@@ -688,14 +688,8 @@
         }
 
         public void close() {
-            try {
-                this.inbuffer.close();
-            } catch (IOException ignore) {
-            }
-            try {
-                this.outbuffer.close();
-            } catch (IOException ignore) {
-            }
+            this.inbuffer.close();
+            this.outbuffer.close();
             this.inputState = SHUTDOWN;
             this.outputState = SHUTDOWN;
         }

Modified: httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/util/SharedInputBuffer.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/util/SharedInputBuffer.java?rev=690361&r1=690360&r2=690361&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/util/SharedInputBuffer.java (original)
+++ httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/util/SharedInputBuffer.java Fri Aug 29 11:35:29 2008
@@ -110,7 +110,7 @@
         }
     }
 
-    public void close() throws IOException {
+    public void close() {
         if (this.shutdown) {
             return;
         }

Modified: httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/util/SharedOutputBuffer.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/util/SharedOutputBuffer.java?rev=690361&r1=690360&r2=690361&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/util/SharedOutputBuffer.java (original)
+++ httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/util/SharedOutputBuffer.java Fri Aug 29 11:35:29 2008
@@ -93,11 +93,15 @@
         }
     }
     
-    public void close() throws IOException {
+    public void close() {
         if (this.shutdown) {
             return;
         }
-        writeCompleted();
+        try {
+            writeCompleted();
+        } catch (IOException ignore) {
+            // should never happen
+        }
     }
 
     public void shutdown() {

Modified: httpcomponents/httpcore/trunk/module-nio/src/test/java/org/apache/http/nio/protocol/TestThrottlingNHttpHandlers.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/module-nio/src/test/java/org/apache/http/nio/protocol/TestThrottlingNHttpHandlers.java?rev=690361&r1=690360&r2=690361&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/module-nio/src/test/java/org/apache/http/nio/protocol/TestThrottlingNHttpHandlers.java (original)
+++ httpcomponents/httpcore/trunk/module-nio/src/test/java/org/apache/http/nio/protocol/TestThrottlingNHttpHandlers.java Fri Aug 29 11:35:29 2008
@@ -32,7 +32,6 @@
 
 import java.io.IOException;
 import java.io.InputStream;
-import java.io.InterruptedIOException;
 import java.io.PipedInputStream;
 import java.io.PipedOutputStream;
 import java.net.InetSocketAddress;