414635 Modular start.d and jetty.base property

Fixed NPE from XmlConfiguration
reordered so command line comes after start.ini and start.d
This commit is contained in:
Greg Wilkins 2013-08-19 12:30:53 +10:00
parent 3c28bf8c60
commit 84df81c288
2 changed files with 14 additions and 7 deletions

View File

@ -166,7 +166,7 @@ public class Config
{
ver = "Unknown";
}
_version = ver;
__version = ver;
}
/**
@ -184,8 +184,9 @@ public class Config
}
};
private static final String _version;
private static final String __version;
private static boolean DEBUG = false;
private static Config __instance;
private final Map<String, String> _properties = new HashMap<String, String>();
private final Map<String, Classpath> _classpaths = new HashMap<String, Classpath>();
private final List<String> _xml = new ArrayList<String>();
@ -193,6 +194,11 @@ public class Config
private int argCount = 0;
public Config()
{
__instance=this;
}
private final Set<String> _options = new TreeSet<String>(new Comparator<String>()
{
// Make sure "*" is always at the end of the list
@ -431,7 +437,8 @@ public class Config
_properties.clear();
}
public Properties getProperties()
/* This method is static so it can be accessed by XmlConfiguration */
public static Properties getProperties()
{
Properties properties = new Properties();
// Add System Properties First
@ -441,8 +448,8 @@ public class Config
properties.put(name, System.getProperty(name));
}
// Add Config Properties Next (overwriting any System Properties that exist)
for (String key : _properties.keySet()) {
properties.put(key,_properties.get(key));
for (String key : __instance._properties.keySet()) {
properties.put(key,__instance._properties.get(key));
}
return properties;
}
@ -450,7 +457,7 @@ public class Config
public String getProperty(String name)
{
if ("version".equalsIgnoreCase(name)) {
return _version;
return __version;
}
// Search Config Properties First
if (_properties.containsKey(name)) {

View File

@ -127,7 +127,7 @@ public class Main
if (arg.startsWith("--ini=") || arg.equals("--ini"))
ini = true;
if (!ini)
arguments.add("--ini=start.ini");
arguments.add(0,"--ini=start.ini");
// The XML Configuration Files to initialize with
List<String> xmls = new ArrayList<String>();