Author: bfitzpat
Date: 2010-06-23 10:06:31 -0400 (Wed, 23 Jun 2010)
New Revision: 22949
Modified:
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/JAXRSWSTestView.java
Log:
JBIDE-6510 - fixes issue with configure monitor action creating unusable url
Modified:
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/JAXRSWSTestView.java
===================================================================
---
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/JAXRSWSTestView.java 2010-06-23
13:42:21 UTC (rev 22948)
+++
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/JAXRSWSTestView.java 2010-06-23
14:06:31 UTC (rev 22949)
@@ -585,8 +585,11 @@
int remotePort = monitor.getRemotePort();
String host = monitor.getRemoteHost();
String newUrl = null;
- if (oldUrl.contains(host + ":" + remotePort)) { //$NON-NLS-1$
- newUrl = oldUrl.replace(host + ":" + remotePort, "localhost:"
+ port); //$NON-NLS-1$ //$NON-NLS-2$
+ if (oldUrl.contains(host + ':' + remotePort)) {
+ newUrl = oldUrl.replace(host + ':' + remotePort, "localhost:" +
port); //$NON-NLS-1$
+ } else if (oldUrl.contains(host + ':' + port)) {
+ // do nothing - host/port combo is already correct
+ newUrl = oldUrl;
} else {
newUrl = oldUrl.replace(host, "localhost:" + port); //$NON-NLS-1$
}