Author: tveronezi
Date: Wed May 28 15:07:50 2014
New Revision: 1598034
URL: http://svn.apache.org/r1598034
Log:
removing possible NPE
Modified:
tomee/tomee/trunk/tomee/tomee-jaxrs/src/main/java/org/apache/tomee/webservices/TomcatRsRegistry.java
Modified:
tomee/tomee/trunk/tomee/tomee-jaxrs/src/main/java/org/apache/tomee/webservices/TomcatRsRegistry.java
URL:
http://svn.apache.org/viewvc/tomee/tomee/trunk/tomee/tomee-jaxrs/src/main/java/org/apache/tomee/webservices/TomcatRsRegistry.java?rev=1598034&r1=1598033&r2=1598034&view=diff
==============================================================================
---
tomee/tomee/trunk/tomee/tomee-jaxrs/src/main/java/org/apache/tomee/webservices/TomcatRsRegistry.java
(original)
+++
tomee/tomee/trunk/tomee/tomee-jaxrs/src/main/java/org/apache/tomee/webservices/TomcatRsRegistry.java
Wed May 28 15:07:50 2014
@@ -69,7 +69,7 @@ public class TomcatRsRegistry implements
}
// find the existing host (we do not auto-create hosts)
- Container host = null;
+ Container host;
Context context = null;
if (virtualHost == null) {
host = hosts.getDefault();
@@ -160,18 +160,17 @@ public class TomcatRsRegistry implements
@Override
public HttpListener removeListener(final String completePath) {
- String path = completePath;
- if (path == null) {
- return listeners.get(path);
- }
-
- // assure context root with a leading slash
- if (!path.startsWith("/") && !path.startsWith("http://") &&
!path.startsWith("https://")) {
- path = "/" + path;
- }
-
- if (listeners.containsKey(path)) {
- return listeners.remove(path);
+ if(completePath != null) {
+ String path = completePath;
+ // assure context root with a leading slash
+ if (!path.startsWith("/") && !path.startsWith("http://") &&
!path.startsWith("https://")) {
+ path = "/" + path;
+ } else {
+ path = completePath;
+ }
+ if (listeners.containsKey(path)) {
+ return listeners.remove(path);
+ }
}
return null;
}