From cd7ae20778e04d4efd1d0cf2bf67d369b000f081 Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Mon, 30 Jan 2012 10:01:13 -0700 Subject: [PATCH] 370120 - jvm arguments added via start.ini and --exec are missing spaces + Allow jetty.version to be overridden via jetty.version system property. --- .../java/org/eclipse/jetty/start/Config.java | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/jetty-start/src/main/java/org/eclipse/jetty/start/Config.java b/jetty-start/src/main/java/org/eclipse/jetty/start/Config.java index 0f79283d2a1..62c388f35a2 100644 --- a/jetty-start/src/main/java/org/eclipse/jetty/start/Config.java +++ b/jetty-start/src/main/java/org/eclipse/jetty/start/Config.java @@ -24,10 +24,7 @@ import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; import java.io.StringReader; -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; import java.net.URL; -import java.security.Policy; import java.text.CollationKey; import java.text.Collator; import java.util.ArrayList; @@ -148,13 +145,23 @@ public class Config public static final String DEFAULT_SECTION = ""; static { - Package pkg = Config.class.getPackage(); - if (pkg != null && - "Eclipse.org - Jetty".equals(pkg.getImplementationVendor()) && - (pkg.getImplementationVersion() != null)) - _version = pkg.getImplementationVersion(); - else - _version = System.getProperty("jetty.version","Unknown"); + String ver = System.getProperty("jetty.version", null); + + if(ver == null) { + Package pkg = Config.class.getPackage(); + if (pkg != null && + "Eclipse.org - Jetty".equals(pkg.getImplementationVendor()) && + (pkg.getImplementationVersion() != null)) + { + ver = pkg.getImplementationVersion(); + } + } + + if (ver == null) + { + ver = "Unknown"; + } + _version = ver; } /** @@ -177,7 +184,6 @@ public class Config private static final Map __properties = new HashMap(); private final Map _classpaths = new HashMap(); private final List _xml = new ArrayList(); - private String _policyDirectory = null; private String _classname = null; private int argCount = 0;