modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/AS7CommandLine.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
New commits: commit e9c19a7698a7eef468e9e184d7e8a75a78670751 Author: Ian Springer ian.springer@redhat.com Date: Tue May 29 09:15:31 2012 -0400
[BZ 820570] fix a bug in the original fix, which caused an "IllegalArgumentException: URI is not absolute" error when trying to parse a -P option value that was a relative path (https://bugzilla.redhat.com/show_bug.cgi?id=820570)
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/AS7CommandLine.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/AS7CommandLine.java index 9f5e355..b44ceb3 100644 --- a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/AS7CommandLine.java +++ b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/AS7CommandLine.java @@ -26,7 +26,6 @@ import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.MalformedURLException; -import java.net.URI; import java.net.URL; import java.net.URLConnection; import java.util.Collections; @@ -146,7 +145,7 @@ public class AS7CommandLine extends JavaCommandLine { private URL toURL(String value) { URL propertiesURL; try { - propertiesURL = URI.create(value).toURL(); + propertiesURL = new URL(value); if (propertiesURL.getProtocol().equals("file")) { String path = propertiesURL.getPath(); File file = new File(path); @@ -156,13 +155,13 @@ public class AS7CommandLine extends JavaCommandLine { propertiesURL = absoluteFile.toURI().toURL(); } } - } catch (MalformedURLException e) { + } catch (MalformedURLException murle) { // it's probably just a path, e.g. "/opt/jboss-as-7.1.1.Final/bin/jboss-as.properties" or "jboss-as.properties" File file = new File(value); File absoluteFile = getAbsoluteFile(file); try { propertiesURL = absoluteFile.toURI().toURL(); - } catch (MalformedURLException e1) { + } catch (MalformedURLException murle2) { propertiesURL = null; log.error("Value of class option " + PROPERTIES_OPTION + " (" + value + ") is not a valid URL."); }
rhq-commits@lists.fedorahosted.org