8033686: Internal error for zero indent

Reviewed-by: ksrini
This commit is contained in:
Jonathan Gibbons 2014-02-06 10:58:51 -08:00
parent edee080e4a
commit 5b738090bd
2 changed files with 8 additions and 4 deletions

View File

@ -273,7 +273,9 @@ public class JavapTask implements DisassemblerTool.DisassemblerTask, Messages {
void process(JavapTask task, String opt, String arg) throws BadArgs {
int sep = opt.indexOf(":");
try {
task.options.indentWidth = Integer.valueOf(opt.substring(sep + 1));
int i = Integer.valueOf(opt.substring(sep + 1));
if (i > 0) // silently ignore invalid values
task.options.indentWidth = i;
} catch (NumberFormatException e) {
}
}
@ -289,7 +291,9 @@ public class JavapTask implements DisassemblerTool.DisassemblerTask, Messages {
void process(JavapTask task, String opt, String arg) throws BadArgs {
int sep = opt.indexOf(":");
try {
task.options.tabColumn = Integer.valueOf(opt.substring(sep + 1));
int i = Integer.valueOf(opt.substring(sep + 1));
if (i > 0) // silently ignore invalid values
task.options.tabColumn = i;
} catch (NumberFormatException e) {
}
}

View File

@ -86,6 +86,6 @@ public class Options {
public boolean showConstants;
public boolean sysInfo;
public boolean showInnerClasses;
public int indentWidth = 2; // #spaces per indentWidth level
public int tabColumn = 40; // column number for comments
public int indentWidth = 2; // #spaces per indentWidth level; must be > 0
public int tabColumn = 40; // column number for comments; must be > 0
}