CXF-5616 clean up the code

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

Branch: refs/heads/master
Commit: c5421983e06778b38dfdcca0dbe27c08060197b6
Parents: 1ef40fc
Author: Willem Jiang <willem.ji...@gmail.com>
Authored: Fri Apr 4 15:52:25 2014 +0800
Committer: Willem Jiang <willem.ji...@gmail.com>
Committed: Fri Apr 4 15:52:25 2014 +0800

----------------------------------------------------------------------
 .../http/netty/server/NettyHttpServerEngine.java      |  7 +------
 .../http/netty/server/NettyHttpServerEngineTest.java  | 14 --------------
 2 files changed, 1 insertion(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/c5421983/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/NettyHttpServerEngine.java
----------------------------------------------------------------------
diff --git 
a/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/NettyHttpServerEngine.java
 
b/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/NettyHttpServerEngine.java
index 17fa9da..ee77148 100644
--- 
a/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/NettyHttpServerEngine.java
+++ 
b/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/NettyHttpServerEngine.java
@@ -34,7 +34,6 @@ import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.configuration.jsse.TLSServerParameters;
 import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.transport.HttpUriMapper;
-import org.apache.cxf.transport.http.HttpUrlUtil;
 import io.netty.bootstrap.ServerBootstrap;
 import io.netty.channel.Channel;
 import io.netty.channel.ChannelOption;
@@ -184,14 +183,10 @@ public class NettyHttpServerEngine implements 
ServerEngine {
     protected void checkRegistedContext(URL url) {
         String path = url.getPath();
         for (String registedPath : registedPaths) {
-            if (path.equals(registedPath)
-                    || HttpUrlUtil.checkContextPath(registedPath, path)) {
+            if (path.equals(registedPath)) {
                 // Throw the address is already used exception
                 throw new Fault(new Message("ADD_HANDLER_CONTEXT_IS_USED_MSG", 
LOG, url, registedPath));
             }
-            if (HttpUrlUtil.checkContextPath(path, registedPath)) {
-                throw new Fault(new 
Message("ADD_HANDLER_CONTEXT_CONFILICT_MSG", LOG, url, registedPath));
-            }
         }
 
     }

http://git-wip-us.apache.org/repos/asf/cxf/blob/c5421983/rt/transports/http-netty/netty-server/src/test/java/org/apache/cxf/transport/http/netty/server/NettyHttpServerEngineTest.java
----------------------------------------------------------------------
diff --git 
a/rt/transports/http-netty/netty-server/src/test/java/org/apache/cxf/transport/http/netty/server/NettyHttpServerEngineTest.java
 
b/rt/transports/http-netty/netty-server/src/test/java/org/apache/cxf/transport/http/netty/server/NettyHttpServerEngineTest.java
index aba3908..1c82680 100644
--- 
a/rt/transports/http-netty/netty-server/src/test/java/org/apache/cxf/transport/http/netty/server/NettyHttpServerEngineTest.java
+++ 
b/rt/transports/http-netty/netty-server/src/test/java/org/apache/cxf/transport/http/netty/server/NettyHttpServerEngineTest.java
@@ -98,20 +98,6 @@ public class NettyHttpServerEngineTest extends Assert {
             assertTrue("Get a wrong exception message", 
ex.getMessage().indexOf("hello/test") > 0);
         }
 
-        try {
-            engine.addServant(new URL(urlStr + "/test"), handler2);
-            fail("We don't support to publish the two service at the same 
context path");
-        } catch (Exception ex) {
-            assertTrue("Get a wrong exception message", 
ex.getMessage().indexOf("hello/test/test") > 0);
-        }
-
-        try {
-            engine.addServant(new URL("http://localhost:"; + PORT1 + "/hello"), 
handler2);
-            fail("We don't support to publish the two service at the same 
context path");
-        } catch (Exception ex) {
-            assertTrue("Get a wrong exception message", 
ex.getMessage().indexOf("hello") > 0);
-        }
-
         engine.addServant(new URL(urlStr2), handler2);
 
         engine.removeServant(new URL(urlStr));

Reply via email to