Wed, 19 Feb 2014 15:07:47 +0400
8033686: Internal error for zero indent
Reviewed-by: ksrini
src/share/classes/com/sun/tools/javap/JavapTask.java | file | annotate | diff | comparison | revisions | |
src/share/classes/com/sun/tools/javap/Options.java | file | annotate | diff | comparison | revisions |
1.1 --- a/src/share/classes/com/sun/tools/javap/JavapTask.java Tue Feb 18 19:27:19 2014 +0400 1.2 +++ b/src/share/classes/com/sun/tools/javap/JavapTask.java Wed Feb 19 15:07:47 2014 +0400 1.3 @@ -309,7 +309,9 @@ 1.4 void process(JavapTask task, String opt, String arg) throws BadArgs { 1.5 int sep = opt.indexOf(":"); 1.6 try { 1.7 - task.options.indentWidth = Integer.valueOf(opt.substring(sep + 1)); 1.8 + int i = Integer.valueOf(opt.substring(sep + 1)); 1.9 + if (i > 0) // silently ignore invalid values 1.10 + task.options.indentWidth = i; 1.11 } catch (NumberFormatException e) { 1.12 } 1.13 } 1.14 @@ -325,7 +327,9 @@ 1.15 void process(JavapTask task, String opt, String arg) throws BadArgs { 1.16 int sep = opt.indexOf(":"); 1.17 try { 1.18 - task.options.tabColumn = Integer.valueOf(opt.substring(sep + 1)); 1.19 + int i = Integer.valueOf(opt.substring(sep + 1)); 1.20 + if (i > 0) // silently ignore invalid values 1.21 + task.options.tabColumn = i; 1.22 } catch (NumberFormatException e) { 1.23 } 1.24 }
2.1 --- a/src/share/classes/com/sun/tools/javap/Options.java Tue Feb 18 19:27:19 2014 +0400 2.2 +++ b/src/share/classes/com/sun/tools/javap/Options.java Wed Feb 19 15:07:47 2014 +0400 2.3 @@ -86,8 +86,8 @@ 2.4 public boolean showConstants; 2.5 public boolean sysInfo; 2.6 public boolean showInnerClasses; 2.7 - public int indentWidth = 2; // #spaces per indentWidth level 2.8 - public int tabColumn = 40; // column number for comments 2.9 + public int indentWidth = 2; // #spaces per indentWidth level; must be > 0 2.10 + public int tabColumn = 40; // column number for comments; must be > 0 2.11 2.12 public boolean compat; // bug-for-bug compatibility mode with old javap 2.13 }