Skip to content

Commit

Permalink
Rebuild.java dealing with null options hash from Rebuiler more gracef…
Browse files Browse the repository at this point in the history
…ully
  • Loading branch information
barmintor committed Jun 28, 2011
1 parent 9d0e779 commit 2fa0ef0
Showing 1 changed file with 31 additions and 18 deletions.
Expand Up @@ -219,31 +219,44 @@ public static Server getServer() throws InitializationException {
private static Map<String, String> getOptions(Map<String, String> descs)
throws IOException {
Map<String, String> options = new HashMap<String, String>();
Iterator<String> iter = descs.keySet().iterator();
while (iter.hasNext()) {
String name = iter.next();
String desc = descs.get(name);
options.put(name, getOptionValue(name, desc));
if (descs != null){
Iterator<String> iter = descs.keySet().iterator();
while (iter.hasNext()) {
String name = iter.next();
String desc = descs.get(name);
options.put(name, getOptionValue(name, desc));
}
}
int c = 1;

if (System.getProperty("rebuilder") == null) {
c =
getChoice("Start rebuilding with the above options?",
new String[] {"Yes",
"No, let me re-enter the options.",
"No, exit."});
if (options.size() > 0) {
c =
getChoice("Start rebuilding with the above options?",
new String[] {"Yes",
"No, let me re-enter the options.",
"No, exit."});

if (c == 0) {
return options;
}
if (c == 1) {
System.err.println();
return getOptions(descs);
}
}
else {
c =
getChoice("No options to set. Start rebuilding?",
new String[] {"Yes",
"No, exit."});
if (c == 0) {
return options;
}
}
} else {
return options;
}

if (c == 0) {
return options;
}
if (c == 1) {
System.err.println();
return getOptions(descs);
}
return null;
}

Expand Down

0 comments on commit 2fa0ef0

Please sign in to comment.