You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2017/04/05 14:45:54 UTC

svn commit: r1790281 - /tomcat/trunk/java/org/apache/catalina/connector/CoyoteInputStream.java

Author: markt
Date: Wed Apr  5 14:45:54 2017
New Revision: 1790281

URL: http://svn.apache.org/viewvc?rev=1790281&view=rev
Log:
Simplify. Reduce code duplication.

Modified:
    tomcat/trunk/java/org/apache/catalina/connector/CoyoteInputStream.java

Modified: tomcat/trunk/java/org/apache/catalina/connector/CoyoteInputStream.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/CoyoteInputStream.java?rev=1790281&r1=1790280&r2=1790281&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/connector/CoyoteInputStream.java (original)
+++ tomcat/trunk/java/org/apache/catalina/connector/CoyoteInputStream.java Wed Apr  5 14:45:54 2017
@@ -125,32 +125,7 @@ public class CoyoteInputStream extends S
 
     @Override
     public int read(final byte[] b) throws IOException {
-        checkNonBlockingRead();
-
-        if (SecurityUtil.isPackageProtectionEnabled()) {
-            try {
-                Integer result = AccessController
-                        .doPrivileged(new PrivilegedExceptionAction<Integer>() {
-
-                            @Override
-                            public Integer run() throws IOException {
-                                Integer integer = Integer.valueOf(ib.read(b, 0, b.length));
-                                return integer;
-                            }
-
-                        });
-                return result.intValue();
-            } catch (PrivilegedActionException pae) {
-                Exception e = pae.getException();
-                if (e instanceof IOException) {
-                    throw (IOException) e;
-                } else {
-                    throw new RuntimeException(e.getMessage(), e);
-                }
-            }
-        } else {
-            return ib.read(b, 0, b.length);
-        }
+        return read(b, 0, b.length);
     }
 
 



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