cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject cxf git commit: Fix warnings in undertow and udp transports
Date Thu, 09 Feb 2017 20:48:37 GMT
Repository: cxf
Updated Branches:
  refs/heads/master c903d27ec -> ce6cdcff2


Fix warnings in undertow and udp transports


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/ce6cdcff
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/ce6cdcff
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/ce6cdcff

Branch: refs/heads/master
Commit: ce6cdcff2bee46194baa3e3b63b93616fcaea9c8
Parents: c903d27
Author: Daniel Kulp <dkulp@apache.org>
Authored: Thu Feb 9 15:47:40 2017 -0500
Committer: Daniel Kulp <dkulp@apache.org>
Committed: Thu Feb 9 15:47:40 2017 -0500

----------------------------------------------------------------------
 .../apache/cxf/transport/http_undertow/CxfUndertowServlet.java   | 1 +
 .../org/apache/cxf/transport/http_undertow/NotFoundHandler.java  | 2 +-
 .../cxf/transport/http_undertow/UndertowHTTPDestination.java     | 2 +-
 .../apache/cxf/transport/http_undertow/UndertowHTTPHandler.java  | 2 +-
 .../cxf/transport/http_undertow/UndertowHTTPTestHandler.java     | 2 +-
 .../java/org/apache/cxf/transport/udp/IoSessionOutputStream.java | 4 +++-
 .../src/main/java/org/apache/cxf/transport/udp/UDPConduit.java   | 4 ++--
 .../main/java/org/apache/cxf/transport/udp/UDPDestination.java   | 2 +-
 8 files changed, 11 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/ce6cdcff/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/CxfUndertowServlet.java
----------------------------------------------------------------------
diff --git a/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/CxfUndertowServlet.java
b/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/CxfUndertowServlet.java
index 85a10c7..2677f5e 100644
--- a/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/CxfUndertowServlet.java
+++ b/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/CxfUndertowServlet.java
@@ -31,6 +31,7 @@ import org.apache.cxf.Bus;
 import org.apache.cxf.transport.servlet.AbstractHTTPServlet;
 
 public class CxfUndertowServlet extends AbstractHTTPServlet {
+    private static final long serialVersionUID = 1L;
 
     @Override
     public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)

http://git-wip-us.apache.org/repos/asf/cxf/blob/ce6cdcff/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/NotFoundHandler.java
----------------------------------------------------------------------
diff --git a/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/NotFoundHandler.java
b/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/NotFoundHandler.java
index 72a1cb2..349ded0 100644
--- a/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/NotFoundHandler.java
+++ b/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/NotFoundHandler.java
@@ -27,7 +27,7 @@ public class NotFoundHandler implements HttpHandler {
     
     @Override
     public void handleRequest(HttpServerExchange exchange) throws Exception {
-        exchange.setResponseCode(404);
+        exchange.setStatusCode(404);
         exchange.getResponseHeaders().put(Headers.CONTENT_TYPE, "text/plain");
         exchange.getResponseSender().send("Problem accessing " + exchange.getRequestPath());
     }

http://git-wip-us.apache.org/repos/asf/cxf/blob/ce6cdcff/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/UndertowHTTPDestination.java
----------------------------------------------------------------------
diff --git a/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/UndertowHTTPDestination.java
b/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/UndertowHTTPDestination.java
index 7b6ae3e..023f057 100644
--- a/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/UndertowHTTPDestination.java
+++ b/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/UndertowHTTPDestination.java
@@ -239,7 +239,7 @@ public class UndertowHTTPDestination extends ServletDestination {
     }
     
       
-    protected String getAddress(EndpointInfo endpointInfo) {
+    protected final String getAddress(EndpointInfo endpointInfo) {
         return endpointInfo.getAddress();
     }
     

http://git-wip-us.apache.org/repos/asf/cxf/blob/ce6cdcff/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/UndertowHTTPHandler.java
----------------------------------------------------------------------
diff --git a/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/UndertowHTTPHandler.java
b/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/UndertowHTTPHandler.java
index 303bf14..167e9e5 100644
--- a/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/UndertowHTTPHandler.java
+++ b/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/UndertowHTTPHandler.java
@@ -114,7 +114,7 @@ public class UndertowHTTPHandler implements HttpHandler {
         } catch (Throwable t) {
             t.printStackTrace();
             if (undertowExchange.isResponseChannelAvailable()) {
-                undertowExchange.setResponseCode(500);
+                undertowExchange.setStatusCode(500);
                 final String errorPage = "<html><head><title>Error</title>"
                     + "</head><body>Internal Error 500" + t.getMessage()
                     + "</body></html>";

http://git-wip-us.apache.org/repos/asf/cxf/blob/ce6cdcff/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/UndertowHTTPTestHandler.java
----------------------------------------------------------------------
diff --git a/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/UndertowHTTPTestHandler.java
b/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/UndertowHTTPTestHandler.java
index 00101f9..3b5229d 100644
--- a/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/UndertowHTTPTestHandler.java
+++ b/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/UndertowHTTPTestHandler.java
@@ -60,7 +60,7 @@ public class UndertowHTTPTestHandler extends UndertowHTTPHandler {
         } catch (Throwable t) {
             t.printStackTrace();
             if (undertowExchange.isResponseChannelAvailable()) {
-                undertowExchange.setResponseCode(500);
+                undertowExchange.setStatusCode(500);
                 final String errorPage = "<html><head><title>Error</title>"
                     + "</head><body>Internal Error 500" + t.getMessage()
                     + "</body></html>";

http://git-wip-us.apache.org/repos/asf/cxf/blob/ce6cdcff/rt/transports/udp/src/main/java/org/apache/cxf/transport/udp/IoSessionOutputStream.java
----------------------------------------------------------------------
diff --git a/rt/transports/udp/src/main/java/org/apache/cxf/transport/udp/IoSessionOutputStream.java
b/rt/transports/udp/src/main/java/org/apache/cxf/transport/udp/IoSessionOutputStream.java
index db16a14..0def0cb 100644
--- a/rt/transports/udp/src/main/java/org/apache/cxf/transport/udp/IoSessionOutputStream.java
+++ b/rt/transports/udp/src/main/java/org/apache/cxf/transport/udp/IoSessionOutputStream.java
@@ -23,6 +23,7 @@ import java.io.IOException;
 import java.io.OutputStream;
 
 import org.apache.mina.core.buffer.IoBuffer;
+import org.apache.mina.core.future.CloseFuture;
 import org.apache.mina.core.future.WriteFuture;
 import org.apache.mina.core.session.IoSession;
 
@@ -40,7 +41,8 @@ class IoSessionOutputStream extends OutputStream {
         try {
             flush();
         } finally {
-            session.close(true).awaitUninterruptibly();
+            CloseFuture future = session.closeOnFlush();
+            future.awaitUninterruptibly();
         }
     }
 

http://git-wip-us.apache.org/repos/asf/cxf/blob/ce6cdcff/rt/transports/udp/src/main/java/org/apache/cxf/transport/udp/UDPConduit.java
----------------------------------------------------------------------
diff --git a/rt/transports/udp/src/main/java/org/apache/cxf/transport/udp/UDPConduit.java
b/rt/transports/udp/src/main/java/org/apache/cxf/transport/udp/UDPConduit.java
index 4df1900..c4a2aeb 100644
--- a/rt/transports/udp/src/main/java/org/apache/cxf/transport/udp/UDPConduit.java
+++ b/rt/transports/udp/src/main/java/org/apache/cxf/transport/udp/UDPConduit.java
@@ -149,7 +149,7 @@ public class UDPConduit extends AbstractConduit {
                     q = connections.get(s);
                 }
                 if (!q.offer(c)) {
-                    c.getSession().close(false);
+                    c.getSession().closeOnFlush();
                 }
             }
         }
@@ -158,7 +158,7 @@ public class UDPConduit extends AbstractConduit {
         super.close();
         for (Queue<ConnectFuture> f : connections.values()) {
             for (ConnectFuture cf : f) {
-                cf.getSession().close(false);
+                cf.getSession().closeOnFlush();
             }
         }
         connections.clear();

http://git-wip-us.apache.org/repos/asf/cxf/blob/ce6cdcff/rt/transports/udp/src/main/java/org/apache/cxf/transport/udp/UDPDestination.java
----------------------------------------------------------------------
diff --git a/rt/transports/udp/src/main/java/org/apache/cxf/transport/udp/UDPDestination.java
b/rt/transports/udp/src/main/java/org/apache/cxf/transport/udp/UDPDestination.java
index 8f8dfd8..8a8b353 100644
--- a/rt/transports/udp/src/main/java/org/apache/cxf/transport/udp/UDPDestination.java
+++ b/rt/transports/udp/src/main/java/org/apache/cxf/transport/udp/UDPDestination.java
@@ -311,7 +311,7 @@ public class UDPDestination extends AbstractDestination {
             if (e != null && in != null) {
                 in.throwException(e);
             } else {
-                session.close(true);
+                session.closeOnFlush().awaitUninterruptibly();
             }
         }
         public void sessionIdle(IoSession session, IdleStatus status) {


Mime
View raw message