Author: kkolinko
Date: Sun Apr 27 15:07:15 2014
New Revision: 1590403

URL: http://svn.apache.org/r1590403
Log:
Review of r1590378:
Simplify: instanceof operator does not-null check

Modified:
    tomcat/trunk/java/org/apache/coyote/http11/InternalNio2InputBuffer.java
    tomcat/trunk/java/org/apache/coyote/http11/InternalNio2OutputBuffer.java
    
tomcat/trunk/java/org/apache/coyote/http11/upgrade/Nio2ServletInputStream.java
    
tomcat/trunk/java/org/apache/coyote/http11/upgrade/Nio2ServletOutputStream.java

Modified: 
tomcat/trunk/java/org/apache/coyote/http11/InternalNio2InputBuffer.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/InternalNio2InputBuffer.java?rev=1590403&r1=1590402&r2=1590403&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/InternalNio2InputBuffer.java 
(original)
+++ tomcat/trunk/java/org/apache/coyote/http11/InternalNio2InputBuffer.java Sun 
Apr 27 15:07:15 2014
@@ -220,7 +220,7 @@ public class InternalNio2InputBuffer ext
                     nRead = socket.getSocket().read(byteBuffer)
                             .get(socket.getTimeout(), 
TimeUnit.MILLISECONDS).intValue();
                 } catch (ExecutionException e) {
-                    if (e.getCause() != null && e.getCause() instanceof 
IOException) {
+                    if (e.getCause() instanceof IOException) {
                         throw (IOException) e.getCause();
                     } else {
                         throw new IOException(e);

Modified: 
tomcat/trunk/java/org/apache/coyote/http11/InternalNio2OutputBuffer.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/InternalNio2OutputBuffer.java?rev=1590403&r1=1590402&r2=1590403&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/InternalNio2OutputBuffer.java 
(original)
+++ tomcat/trunk/java/org/apache/coyote/http11/InternalNio2OutputBuffer.java 
Sun Apr 27 15:07:15 2014
@@ -400,7 +400,7 @@ public class InternalNio2OutputBuffer ex
                     }
                 }
             } catch (ExecutionException e) {
-                if (e.getCause() != null && e.getCause() instanceof 
IOException) {
+                if (e.getCause() instanceof IOException) {
                     throw (IOException) e.getCause();
                 } else {
                     throw new IOException(e);

Modified: 
tomcat/trunk/java/org/apache/coyote/http11/upgrade/Nio2ServletInputStream.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/upgrade/Nio2ServletInputStream.java?rev=1590403&r1=1590402&r2=1590403&view=diff
==============================================================================
--- 
tomcat/trunk/java/org/apache/coyote/http11/upgrade/Nio2ServletInputStream.java 
(original)
+++ 
tomcat/trunk/java/org/apache/coyote/http11/upgrade/Nio2ServletInputStream.java 
Sun Apr 27 15:07:15 2014
@@ -207,7 +207,7 @@ public class Nio2ServletInputStream exte
                         .get(wrapper.getTimeout(), 
TimeUnit.MILLISECONDS).intValue();
                 readPending = false;
             } catch (ExecutionException e) {
-                if (e.getCause() != null && e.getCause() instanceof 
IOException) {
+                if (e.getCause() instanceof IOException) {
                     onError(e.getCause());
                     throw (IOException) e.getCause();
                 } else {

Modified: 
tomcat/trunk/java/org/apache/coyote/http11/upgrade/Nio2ServletOutputStream.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/upgrade/Nio2ServletOutputStream.java?rev=1590403&r1=1590402&r2=1590403&view=diff
==============================================================================
--- 
tomcat/trunk/java/org/apache/coyote/http11/upgrade/Nio2ServletOutputStream.java 
(original)
+++ 
tomcat/trunk/java/org/apache/coyote/http11/upgrade/Nio2ServletOutputStream.java 
Sun Apr 27 15:07:15 2014
@@ -130,7 +130,7 @@ public class Nio2ServletOutputStream ext
             try {
                 written = 
channel.write(buffer).get(socketWrapper.getTimeout(), 
TimeUnit.MILLISECONDS).intValue();
             } catch (ExecutionException e) {
-                if (e.getCause() != null && e.getCause() instanceof 
IOException) {
+                if (e.getCause() instanceof IOException) {
                     onError(e.getCause());
                     throw (IOException) e.getCause();
                 } else {
@@ -170,7 +170,7 @@ public class Nio2ServletOutputStream ext
                 throw new TimeoutException();
             }
         } catch (ExecutionException e) {
-            if (e.getCause() != null && e.getCause() instanceof IOException) {
+            if (e.getCause() instanceof IOException) {
                 onError(e.getCause());
                 throw (IOException) e.getCause();
             } else {



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to