tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1383624 - in /tomcat/trunk/java/org/apache: coyote/spdy/ tomcat/jni/socket/ tomcat/spdy/ tomcat/util/digester/
Date Tue, 11 Sep 2012 21:34:16 GMT
Author: markt
Date: Tue Sep 11 21:34:16 2012
New Revision: 1383624

URL: http://svn.apache.org/viewvc?rev=1383624&view=rev
Log:
Remove unnecessary throws declarations and a few catch blocks that are no longer required.

Modified:
    tomcat/trunk/java/org/apache/coyote/spdy/SpdyAprNpnHandler.java
    tomcat/trunk/java/org/apache/coyote/spdy/SpdyProcessor.java
    tomcat/trunk/java/org/apache/coyote/spdy/SpdyProxyProtocol.java
    tomcat/trunk/java/org/apache/tomcat/jni/socket/AprSocket.java
    tomcat/trunk/java/org/apache/tomcat/jni/socket/AprSocketContext.java
    tomcat/trunk/java/org/apache/tomcat/spdy/NetSupportOpenSSL.java
    tomcat/trunk/java/org/apache/tomcat/spdy/NetSupportSocket.java
    tomcat/trunk/java/org/apache/tomcat/spdy/SpdyConnection.java
    tomcat/trunk/java/org/apache/tomcat/spdy/SpdyContext.java
    tomcat/trunk/java/org/apache/tomcat/spdy/SpdyStream.java
    tomcat/trunk/java/org/apache/tomcat/util/digester/XercesParser.java

Modified: tomcat/trunk/java/org/apache/coyote/spdy/SpdyAprNpnHandler.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/spdy/SpdyAprNpnHandler.java?rev=1383624&r1=1383623&r2=1383624&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/spdy/SpdyAprNpnHandler.java (original)
+++ tomcat/trunk/java/org/apache/coyote/spdy/SpdyAprNpnHandler.java Tue Sep 11 21:34:16 2012
@@ -99,10 +99,8 @@ public class SpdyAprNpnHandler implement
             return SocketState.OPEN;
         }
 
-        try {
-            ((NetSupportOpenSSL) spdyContext.getNetSupport()).onAcceptLong(socket);
-        } catch (IOException e) {
-        }
+        ((NetSupportOpenSSL) spdyContext.getNetSupport()).onAcceptLong(socket);
+
         // No need to keep tomcat thread busy - but socket will be handled by apr socket
context.
         return SocketState.LONG;
     }

Modified: tomcat/trunk/java/org/apache/coyote/spdy/SpdyProcessor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/spdy/SpdyProcessor.java?rev=1383624&r1=1383623&r2=1383624&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/spdy/SpdyProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/spdy/SpdyProcessor.java Tue Sep 11 21:34:16 2012
@@ -213,14 +213,7 @@ public class SpdyProcessor extends Abstr
         }
         if (!response.isCommitted()) {
             // Validate and write response headers
-            try {
-                sendSynReply();
-            } catch (IOException e) {
-                e.printStackTrace();
-                // Set error flag
-                error = true;
-                return;
-            }
+            sendSynReply();
         }
     }
 
@@ -259,13 +252,7 @@ public class SpdyProcessor extends Abstr
             // transactions with the client
             maybeCommit();
 
-            try {
-                spdyStream.sendDataFrame(EMPTY, 0, 0, true);
-            } catch (IOException e) {
-                // Set error flag
-                e.printStackTrace();
-                error = true;
-            }
+            spdyStream.sendDataFrame(EMPTY, 0, 0, true);
 
         } else if (actionCode == ActionCode.REQ_SSL_ATTRIBUTE) {
 
@@ -401,7 +388,7 @@ public class SpdyProcessor extends Abstr
      * When committing the response, we have to validate the set of headers, as
      * well as setup the response filters.
      */
-    protected void sendSynReply() throws IOException {
+    protected void sendSynReply() {
 
         response.setCommitted(true);
 
@@ -423,7 +410,7 @@ public class SpdyProcessor extends Abstr
         sendResponseHead();
     }
 
-    private void sendResponseHead() throws IOException {
+    private void sendResponseHead() {
         SpdyFrame rframe = spdy.getFrame(SpdyConnection.TYPE_SYN_REPLY);
         rframe.associated = 0;
 

Modified: tomcat/trunk/java/org/apache/coyote/spdy/SpdyProxyProtocol.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/spdy/SpdyProxyProtocol.java?rev=1383624&r1=1383623&r2=1383624&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/spdy/SpdyProxyProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/spdy/SpdyProxyProtocol.java Tue Sep 11 21:34:16 2012
@@ -114,11 +114,8 @@ public class SpdyProxyProtocol extends A
         @Override
         public SocketState process(SocketWrapper<Socket> socket,
                 SocketStatus status) {
-            try {
-                spdyContext.getNetSupport().onAccept(socket.getSocket());
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
+
+            spdyContext.getNetSupport().onAccept(socket.getSocket());
             return SocketState.CLOSED;
         }
 

Modified: tomcat/trunk/java/org/apache/tomcat/jni/socket/AprSocket.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/jni/socket/AprSocket.java?rev=1383624&r1=1383623&r2=1383624&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/jni/socket/AprSocket.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/jni/socket/AprSocket.java Tue Sep 11 21:34:16 2012
@@ -363,7 +363,7 @@ public class AprSocket implements Runnab
 
      */
 
-    public void close() throws IOException {
+    public void close() {
         synchronized (this) {
             if ((status & CLOSED) != 0 || socket == 0) {
                 return;
@@ -442,11 +442,7 @@ public class AprSocket implements Runnab
      */
     public void reset() {
         setStatus(ERROR);
-        try {
-            close();
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
+        close();
     }
 
 

Modified: tomcat/trunk/java/org/apache/tomcat/jni/socket/AprSocketContext.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/jni/socket/AprSocketContext.java?rev=1383624&r1=1383623&r2=1383624&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/jni/socket/AprSocketContext.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/jni/socket/AprSocketContext.java Tue Sep 11 21:34:16
2012
@@ -338,8 +338,7 @@ public class AprSocketContext {
     /**
      * Set certificate, will also enable TLS mode.
      */
-    public AprSocketContext setKeys(String certPemFile, String keyDerFile)
-            throws IOException {
+    public AprSocketContext setKeys(String certPemFile, String keyDerFile) {
         this.sslMode = true;
         setTls();
         certFile = certPemFile;
@@ -403,18 +402,18 @@ public class AprSocketContext {
     /**
      * Get a socket for connectiong to host:port.
      */
-    public AprSocket socket(String host, int port, boolean ssl) throws IOException {
+    public AprSocket socket(String host, int port, boolean ssl) {
         HostInfo hi = getHostInfo(host, port, ssl);
         return socket(hi);
     }
 
-    public AprSocket socket(HostInfo hi) throws IOException {
+    public AprSocket socket(HostInfo hi) {
         AprSocket sock = newSocket(this);
         sock.setHost(hi);
         return sock;
     }
 
-    public AprSocket socket(long socket) throws IOException {
+    public AprSocket socket(long socket) {
         AprSocket sock = newSocket(this);
         // Tomcat doesn't set this
         SSLExt.sslSetMode(socket, SSLExt.SSL_MODE_ENABLE_PARTIAL_WRITE |
@@ -502,7 +501,7 @@ public class AprSocketContext {
         }
     }
 
-    AprSocket newSocket(AprSocketContext context) throws IOException {
+    AprSocket newSocket(AprSocketContext context) {
         return new AprSocket(context);
     }
 
@@ -524,7 +523,7 @@ public class AprSocketContext {
     }
 
 
-    public void stop() throws IOException {
+    public void stop() {
         synchronized (pollers) {
             if (!running) {
                 return;
@@ -742,7 +741,7 @@ public class AprSocketContext {
      * Called on each accepted socket ( for servers ) or after connection (client)
      * after handshake.
      */
-    protected void onSocket(AprSocket s) throws IOException {
+    protected void onSocket(AprSocket s) {
 
     }
 
@@ -1304,7 +1303,7 @@ public class AprSocketContext {
          * Called only from IO thread. Remove from Poll and channels,
          * set POLL bit to false.
          */
-        private void removeSafe(AprSocket up) throws IOException {
+        private void removeSafe(AprSocket up) {
             int rv = Status.APR_EGENERAL;
             if (running && serverPollset != 0 && up.socket != 0
                     && !up.isClosed()) {

Modified: tomcat/trunk/java/org/apache/tomcat/spdy/NetSupportOpenSSL.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/spdy/NetSupportOpenSSL.java?rev=1383624&r1=1383623&r2=1383624&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/spdy/NetSupportOpenSSL.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/spdy/NetSupportOpenSSL.java Tue Sep 11 21:34:16 2012
@@ -48,7 +48,7 @@ public class NetSupportOpenSSL extends S
     @Override
     public boolean isSpdy(Object socketW) {
         byte[] proto = new byte[32];
-        int len = SSLExt.getNPN((Long) socketW, proto);
+        int len = SSLExt.getNPN(((Long) socketW).longValue(), proto);
         return len == 6; // todo: check spdy/2
     }
 
@@ -75,11 +75,11 @@ public class NetSupportOpenSSL extends S
     }
 
     @Override
-    public void onAccept(Object socket) throws IOException {
-        onAcceptLong((Long) socket);
+    public void onAccept(Object socket) {
+        onAcceptLong(((Long) socket).longValue());
     }
 
-    public void onAcceptLong(long socket) throws IOException {
+    public void onAcceptLong(long socket) {
         SpdyConnectionAprSocket spdy = new SpdyConnectionAprSocket(ctx);
         AprSocket s = con.socket(socket);
         spdy.setSocket(s);
@@ -98,7 +98,7 @@ public class NetSupportOpenSSL extends S
     public void listen(final int port, String cert, String key) throws IOException {
         con = new AprSocketContext() {
             @Override
-            protected void onSocket(AprSocket s) throws IOException {
+            protected void onSocket(AprSocket s) {
                 SpdyConnectionAprSocket spdy = new SpdyConnectionAprSocket(ctx);
                 spdy.setSocket(s);
 

Modified: tomcat/trunk/java/org/apache/tomcat/spdy/NetSupportSocket.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/spdy/NetSupportSocket.java?rev=1383624&r1=1383623&r2=1383624&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/spdy/NetSupportSocket.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/spdy/NetSupportSocket.java Tue Sep 11 21:34:16 2012
@@ -29,10 +29,6 @@ import javax.net.ssl.SSLSocket;
 public class NetSupportSocket extends SpdyContext.NetSupport {
 
     @Override
-    public void onCreateEngine(Object engine) {
-    }
-
-    @Override
     public boolean isSpdy(Object socketW) {
         return false;
     }

Modified: tomcat/trunk/java/org/apache/tomcat/spdy/SpdyConnection.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/spdy/SpdyConnection.java?rev=1383624&r1=1383623&r2=1383624&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/spdy/SpdyConnection.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/spdy/SpdyConnection.java Tue Sep 11 21:34:16 2012
@@ -305,8 +305,7 @@ public abstract class SpdyConnection { /
      *
      * With a nb transport it should call drain directly.
      */
-    public void nonBlockingSend(SpdyFrame oframe, SpdyStream proc)
-            throws IOException {
+    public void nonBlockingSend(SpdyFrame oframe, SpdyStream proc) {
         queueFrame(oframe, proc, oframe.pri == 0 ? outQueue : prioriyQueue);
         getSpdyContext().getExecutor().execute(nbDrain);
     }
@@ -324,14 +323,13 @@ public abstract class SpdyConnection { /
      * Add the frame to the queue and send until the queue is empty.
      *
      */
-    public void send(SpdyFrame oframe, SpdyStream proc)
-            throws IOException {
+    public void send(SpdyFrame oframe, SpdyStream proc) {
         queueFrame(oframe, proc, oframe.pri == 0 ? outQueue : prioriyQueue);
         drain();
     }
 
     private void queueFrame(SpdyFrame oframe, SpdyStream proc,
-            LinkedList<SpdyFrame> queue) throws IOException {
+            LinkedList<SpdyFrame> queue) {
 
         oframe.endData = oframe.off;
         oframe.off = 0;
@@ -663,7 +661,7 @@ public abstract class SpdyConnection { /
         return spdyContext;
     }
 
-    public SpdyStream get(String host, String url) throws IOException {
+    public SpdyStream get(String host, String url) {
         SpdyStream sch = new SpdyStream(this);
         sch.getRequest().addHeader("host", host);
         sch.getRequest().addHeader("url", url);

Modified: tomcat/trunk/java/org/apache/tomcat/spdy/SpdyContext.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/spdy/SpdyContext.java?rev=1383624&r1=1383623&r2=1383624&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/spdy/SpdyContext.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/spdy/SpdyContext.java Tue Sep 11 21:34:16 2012
@@ -64,24 +64,17 @@ public final class SpdyContext {
             this.ctx = ctx;
         }
 
-        public abstract SpdyConnection getConnection(String host, int port) throws IOException;
+        public abstract SpdyConnection getConnection(String host, int port)
+                throws IOException;
 
-        public void onCreateEngine(Object engine) {
-        }
-
-        public boolean isSpdy(Object socketW) {
-            return false;
-        }
+        public abstract boolean isSpdy(Object socketW);
 
-        public void onAccept(Object socket) throws IOException {
-        }
+        public abstract void onAccept(Object socket);
 
-        public void listen(int port, String cert, String key)
-                throws IOException {
-        }
+        public abstract void listen(int port, String cert, String key)
+                throws IOException;
 
-        public void stop() throws IOException {
-        }
+        public abstract void stop() throws IOException;
     }
 
     public SpdyContext() {

Modified: tomcat/trunk/java/org/apache/tomcat/spdy/SpdyStream.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/spdy/SpdyStream.java?rev=1383624&r1=1383623&r2=1383624&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/spdy/SpdyStream.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/spdy/SpdyStream.java Tue Sep 11 21:34:16 2012
@@ -102,7 +102,7 @@ public class SpdyStream implements Runna
      * The base method is for client implementation - servers need to override
      * and process the frame as a request.
      */
-    public void onCtlFrame(SpdyFrame frame) throws IOException {
+    public void onCtlFrame(SpdyFrame frame) {
         // TODO: handle RST
         if (frame.type == SpdyConnection.TYPE_SYN_STREAM) {
             reqFrame = frame;
@@ -157,7 +157,7 @@ public class SpdyStream implements Runna
      *
      * First frame will be the control frame
      */
-    public SpdyFrame getFrame(long to) throws IOException {
+    public SpdyFrame getFrame(long to) {
         SpdyFrame in;
         try {
             synchronized (this) {
@@ -202,7 +202,7 @@ public class SpdyStream implements Runna
     }
 
     public synchronized void sendDataFrame(byte[] data, int start,
-            int length, boolean close) throws IOException {
+            int length, boolean close) {
 
         SpdyFrame oframe = spdy.getDataFrame();
 
@@ -222,18 +222,18 @@ public class SpdyStream implements Runna
         spdy.send(oframe, this);
     }
 
-    public void send() throws IOException {
+    public void send() {
         send("http", "GET");
     }
 
-    public void send(String host, String url, String scheme, String method) throws IOException
{
+    public void send(String host, String url, String scheme, String method) {
         getRequest().addHeader("host", host);
         getRequest().addHeader("url", url);
 
         send(scheme, method);
     }
 
-    public void send(String scheme, String method) throws IOException {
+    public void send(String scheme, String method) {
         getRequest();
         if ("GET".equalsIgnoreCase(method)) {
             // TODO: add the others
@@ -268,7 +268,7 @@ public class SpdyStream implements Runna
         long to = 10000; // TODO
         int pos = 0;
 
-        private void fill() throws IOException {
+        private void fill() {
             if (current == null || current.off == current.endData) {
                 if (current != null) {
                     spdy.spdyContext.releaseFrame(current);

Modified: tomcat/trunk/java/org/apache/tomcat/util/digester/XercesParser.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/digester/XercesParser.java?rev=1383624&r1=1383623&r2=1383624&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/digester/XercesParser.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/digester/XercesParser.java Tue Sep 11 21:34:16
2012
@@ -153,8 +153,7 @@ public class XercesParser{
      */
     private static void configureOldXerces(SAXParser parser,
                                            Properties properties)
-            throws ParserConfigurationException,
-                   SAXNotSupportedException {
+            throws SAXNotSupportedException {
 
         String schemaLocation = (String)properties.get("schemaLocation");
         String schemaLanguage = (String)properties.get("schemaLanguage");



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


Mime
View raw message