8161019: javac, fold formatter options

Reviewed-by: mcimadamore, jjg
This commit is contained in:
Vicente Romero 2016-07-26 07:45:29 -07:00
parent ecbab04648
commit 8480651475
32 changed files with 128 additions and 107 deletions

View File

@ -449,7 +449,7 @@ public class JavaCompiler {
? CompileState.valueOf(options.get("shouldstop.ifNoError")) ? CompileState.valueOf(options.get("shouldstop.ifNoError"))
: CompileState.GENERATE; : CompileState.GENERATE;
if (options.isUnset("oldDiags")) if (options.isUnset("diags.legacy"))
log.setDiagnosticFormatter(RichDiagnosticFormatter.instance(context)); log.setDiagnosticFormatter(RichDiagnosticFormatter.instance(context));
PlatformDescription platformProvider = context.get(PlatformDescription.class); PlatformDescription platformProvider = context.get(PlatformDescription.class);

View File

@ -346,21 +346,6 @@ public enum Option {
} }
}, },
DIAGS("-XDdiags=", null, HIDDEN, INFO) {
@Override
public boolean process(OptionHelper helper, String option) {
option = option.substring(option.indexOf('=') + 1);
String diagsOption = option.contains("%") ?
"-XDdiagsFormat=" :
"-XDdiags=";
diagsOption += option;
if (XD.matches(diagsOption))
return XD.process(helper, diagsOption);
else
return false;
}
},
HELP("-help", "opt.help", STANDARD, INFO) { HELP("-help", "opt.help", STANDARD, INFO) {
@Override @Override
public boolean process(OptionHelper helper, String option) { public boolean process(OptionHelper helper, String option) {
@ -506,30 +491,6 @@ public enum Option {
XDIAGS("-Xdiags:", "opt.diags", EXTENDED, BASIC, ONEOF, "compact", "verbose"), XDIAGS("-Xdiags:", "opt.diags", EXTENDED, BASIC, ONEOF, "compact", "verbose"),
/* This is a back door to the compiler's option table.
* -XDx=y sets the option x to the value y.
* -XDx sets the option x to the value x.
*/
XD("-XD", null, HIDDEN, BASIC) {
@Override
public boolean matches(String s) {
return s.startsWith(text);
}
@Override
public boolean process(OptionHelper helper, String option) {
return process(helper, option, option.substring(text.length()));
}
@Override
public boolean process(OptionHelper helper, String option, String arg) {
int eq = arg.indexOf('=');
String key = (eq < 0) ? arg : arg.substring(0, eq);
String value = (eq < 0) ? arg : arg.substring(eq+1);
helper.put(key, value);
return false;
}
},
XDEBUG("-Xdebug:", null, HIDDEN, BASIC) { XDEBUG("-Xdebug:", null, HIDDEN, BASIC) {
@Override @Override
public boolean process(OptionHelper helper, String option) { public boolean process(OptionHelper helper, String option) {
@ -556,6 +517,37 @@ public enum Option {
} }
}, },
DIAGS("-diags:", null, HIDDEN, BASIC, true) {
@Override
public boolean process(OptionHelper helper, String option) {
return HiddenGroup.DIAGS.process(helper, option);
}
},
/* This is a back door to the compiler's option table.
* -XDx=y sets the option x to the value y.
* -XDx sets the option x to the value x.
*/
XD("-XD", null, HIDDEN, BASIC) {
@Override
public boolean matches(String s) {
return s.startsWith(text);
}
@Override
public boolean process(OptionHelper helper, String option) {
return process(helper, option, option.substring(text.length()));
}
@Override
public boolean process(OptionHelper helper, String option, String arg) {
int eq = arg.indexOf('=');
String key = (eq < 0) ? arg : arg.substring(0, eq);
String value = (eq < 0) ? arg : arg.substring(eq+1);
helper.put(key, value);
return false;
}
},
XADDEXPORTS("-XaddExports:", "opt.arg.addExports", "opt.addExports", EXTENDED, BASIC) { XADDEXPORTS("-XaddExports:", "opt.arg.addExports", "opt.addExports", EXTENDED, BASIC) {
@Override @Override
public boolean process(OptionHelper helper, String option) { public boolean process(OptionHelper helper, String option) {
@ -672,6 +664,26 @@ public enum Option {
ANYOF ANYOF
} }
enum HiddenGroup {
DIAGS("diags");
final String text;
HiddenGroup(String text) {
this.text = text;
}
public boolean process(OptionHelper helper, String option) {
String p = option.substring(option.indexOf(':') + 1).trim();
String[] subOptions = p.split(";");
for (String subOption : subOptions) {
subOption = text + "." + subOption.trim();
XD.process(helper, subOption, subOption);
}
return false;
}
}
public final String text; public final String text;
final OptionKind kind; final OptionKind kind;
@ -705,6 +717,12 @@ public enum Option {
this(text, null, descrKey, kind, group, null, null, false); this(text, null, descrKey, kind, group, null, null, false);
} }
Option(String text, String descrKey,
OptionKind kind, OptionGroup group,
boolean doHasSuffix) {
this(text, null, descrKey, kind, group, null, null, doHasSuffix);
}
Option(String text, String argsNameKey, String descrKey, Option(String text, String argsNameKey, String descrKey,
OptionKind kind, OptionGroup group) { OptionKind kind, OptionGroup group) {
this(text, argsNameKey, descrKey, kind, group, null, null, false); this(text, argsNameKey, descrKey, kind, group, null, null, false);

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -403,13 +403,13 @@ public abstract class AbstractDiagnosticFormatter implements DiagnosticFormatter
public SimpleConfiguration(Options options, Set<DiagnosticPart> parts) { public SimpleConfiguration(Options options, Set<DiagnosticPart> parts) {
this(parts); this(parts);
String showSource = null; String showSource = null;
if ((showSource = options.get("showSource")) != null) { if ((showSource = options.get("diags.showSource")) != null) {
if (showSource.equals("true")) if (showSource.equals("true"))
setVisiblePart(DiagnosticPart.SOURCE, true); setVisiblePart(DiagnosticPart.SOURCE, true);
else if (showSource.equals("false")) else if (showSource.equals("false"))
setVisiblePart(DiagnosticPart.SOURCE, false); setVisiblePart(DiagnosticPart.SOURCE, false);
} }
String diagOpts = options.get("diags"); String diagOpts = options.get("diags.formatterOptions");
if (diagOpts != null) {//override -XDshowSource if (diagOpts != null) {//override -XDshowSource
Collection<String> args = Arrays.asList(diagOpts.split(",")); Collection<String> args = Arrays.asList(diagOpts.split(","));
if (args.contains("short")) { if (args.contains("short")) {
@ -422,7 +422,7 @@ public abstract class AbstractDiagnosticFormatter implements DiagnosticFormatter
setVisiblePart(DiagnosticPart.SOURCE, false); setVisiblePart(DiagnosticPart.SOURCE, false);
} }
String multiPolicy = null; String multiPolicy = null;
if ((multiPolicy = options.get("multilinePolicy")) != null) { if ((multiPolicy = options.get("diags.multilinePolicy")) != null) {
if (multiPolicy.equals("disabled")) if (multiPolicy.equals("disabled"))
setVisiblePart(DiagnosticPart.SUBDIAGNOSTICS, false); setVisiblePart(DiagnosticPart.SUBDIAGNOSTICS, false);
else if (multiPolicy.startsWith("limit:")) { else if (multiPolicy.startsWith("limit:")) {
@ -447,7 +447,7 @@ public abstract class AbstractDiagnosticFormatter implements DiagnosticFormatter
} }
} }
String showCaret = null; String showCaret = null;
if (((showCaret = options.get("showCaret")) != null) && if (((showCaret = options.get("diags.showCaret")) != null) &&
showCaret.equals("false")) showCaret.equals("false"))
setCaretEnabled(false); setCaretEnabled(false);
else else

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -229,9 +229,9 @@ public class BasicDiagnosticFormatter extends AbstractDiagnosticFormatter {
DiagnosticPart.SOURCE)); DiagnosticPart.SOURCE));
initFormat(); initFormat();
initIndentation(); initIndentation();
if (options.isSet("oldDiags")) if (options.isSet("diags.legacy"))
initOldFormat(); initOldFormat();
String fmt = options.get("diagsFormat"); String fmt = options.get("diags.layout");
if (fmt != null) { if (fmt != null) {
if (fmt.equals("OLD")) if (fmt.equals("OLD"))
initOldFormat(); initOldFormat();
@ -239,12 +239,12 @@ public class BasicDiagnosticFormatter extends AbstractDiagnosticFormatter {
initFormats(fmt); initFormats(fmt);
} }
String srcPos = null; String srcPos = null;
if ((((srcPos = options.get("sourcePosition")) != null)) && if ((((srcPos = options.get("diags.sourcePosition")) != null)) &&
srcPos.equals("bottom")) srcPos.equals("bottom"))
setSourcePosition(SourcePosition.BOTTOM); setSourcePosition(SourcePosition.BOTTOM);
else else
setSourcePosition(SourcePosition.AFTER_SUMMARY); setSourcePosition(SourcePosition.AFTER_SUMMARY);
String indent = options.get("diagsIndentation"); String indent = options.get("diags.indent");
if (indent != null) { if (indent != null) {
String[] levels = indent.split("\\|"); String[] levels = indent.split("\\|");
try { try {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -644,7 +644,7 @@ public class RichDiagnosticFormatter extends
EnumSet.of(RichFormatterFeature.SIMPLE_NAMES, EnumSet.of(RichFormatterFeature.SIMPLE_NAMES,
RichFormatterFeature.WHERE_CLAUSES, RichFormatterFeature.WHERE_CLAUSES,
RichFormatterFeature.UNIQUE_TYPEVAR_NAMES); RichFormatterFeature.UNIQUE_TYPEVAR_NAMES);
String diagOpts = options.get("diags"); String diagOpts = options.get("diags.formatterOptions");
if (diagOpts != null) { if (diagOpts != null) {
for (String args: diagOpts.split(",")) { for (String args: diagOpts.split(",")) {
if (args.equals("-where")) { if (args.equals("-where")) {

View File

@ -3,8 +3,8 @@
* @bug 6722234 * @bug 6722234
* @summary javac diagnostics need better integration with the type-system * @summary javac diagnostics need better integration with the type-system
* @author mcimadamore * @author mcimadamore
* @compile/fail/ref=T6722234a_1.out -XDrawDiagnostics -XDdiags=disambiguateTvars T6722234a.java * @compile/fail/ref=T6722234a_1.out -XDrawDiagnostics -diags:formatterOptions=disambiguateTvars T6722234a.java
* @compile/fail/ref=T6722234a_2.out -XDrawDiagnostics -XDdiags=disambiguateTvars,where T6722234a.java * @compile/fail/ref=T6722234a_2.out -XDrawDiagnostics -diags:formatterOptions=disambiguateTvars,where T6722234a.java
*/ */
class T6722234a<T extends String> { class T6722234a<T extends String> {

View File

@ -3,8 +3,8 @@
* @bug 6722234 8078024 * @bug 6722234 8078024
* @summary javac diagnostics need better integration with the type-system * @summary javac diagnostics need better integration with the type-system
* @author mcimadamore * @author mcimadamore
* @compile/fail/ref=T6722234b_1.out -XDrawDiagnostics -XDdiags=simpleNames T6722234b.java * @compile/fail/ref=T6722234b_1.out -XDrawDiagnostics -diags:formatterOptions=simpleNames T6722234b.java
* @compile/fail/ref=T6722234b_2.out -XDrawDiagnostics -XDdiags=simpleNames,where T6722234b.java * @compile/fail/ref=T6722234b_2.out -XDrawDiagnostics -diags:formatterOptions=simpleNames,where T6722234b.java
*/ */
import java.util.*; import java.util.*;

View File

@ -3,7 +3,7 @@
* @bug 6722234 * @bug 6722234
* @summary javac diagnostics need better integration with the type-system * @summary javac diagnostics need better integration with the type-system
* @author mcimadamore * @author mcimadamore
* @compile/fail/ref=T6722234c.out -XDrawDiagnostics -XDdiags=simpleNames T6722234c.java * @compile/fail/ref=T6722234c.out -XDrawDiagnostics -diags:formatterOptions=simpleNames T6722234c.java
*/ */
class T6722234c { class T6722234c {

View File

@ -3,8 +3,8 @@
* @bug 6722234 8078024 * @bug 6722234 8078024
* @summary javac diagnostics need better integration with the type-system * @summary javac diagnostics need better integration with the type-system
* @author mcimadamore * @author mcimadamore
* @compile/fail/ref=T6722234d_1.out -XDrawDiagnostics -XDdiags=where T6722234d.java * @compile/fail/ref=T6722234d_1.out -XDrawDiagnostics -diags:formatterOptions=where T6722234d.java
* @compile/fail/ref=T6722234d_2.out -XDrawDiagnostics -XDdiags=where,simpleNames T6722234d.java * @compile/fail/ref=T6722234d_2.out -XDrawDiagnostics -diags:formatterOptions=where,simpleNames T6722234d.java
*/ */
class T6722234d { class T6722234d {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -59,8 +59,8 @@ public class T6769027 {
enum CaretKind { enum CaretKind {
DEFAULT("", ""), DEFAULT("", ""),
SHOW("showCaret","true"), SHOW("diags.showCaret","true"),
HIDE("showCaret","false"); HIDE("diags.showCaret","false");
String key; String key;
String value; String value;
@ -81,8 +81,8 @@ public class T6769027 {
enum SourceLineKind { enum SourceLineKind {
DEFAULT("", ""), DEFAULT("", ""),
AFTER_SUMMARY("sourcePosition", "top"), AFTER_SUMMARY("diags.sourcePosition", "top"),
BOTTOM("sourcePosition", "bottom"); BOTTOM("diags.sourcePosition", "bottom");
String key; String key;
String value; String value;
@ -110,9 +110,9 @@ public class T6769027 {
void init(Options opts) { void init(Options opts) {
if (this != DEFAULT) { if (this != DEFAULT) {
String flags = opts.get("diags"); String flags = opts.get("diags.formatterOptions");
flags = flags == null ? flag : flags + "," + flag; flags = flags == null ? flag : flags + "," + flag;
opts.put("diags", flags); opts.put("diags.formatterOptions", flags);
} }
} }
@ -136,9 +136,9 @@ public class T6769027 {
void init(Options opts) { void init(Options opts) {
if (this != DEFAULT) { if (this != DEFAULT) {
String flags = opts.get("diags"); String flags = opts.get("diags.formatterOptions");
flags = flags == null ? flag : flags + "," + flag; flags = flags == null ? flag : flags + "," + flag;
opts.put("diags", flags); opts.put("diags.formatterOptions", flags);
} }
} }
@ -243,11 +243,11 @@ public class T6769027 {
} }
enum MultilinePolicy { enum MultilinePolicy {
ENABLED(0, "multilinePolicy", "enabled"), ENABLED(0, "diags.multilinePolicy", "enabled"),
DISABLED(1, "multilinePolicy", "disabled"), DISABLED(1, "diags.multilinePolicy", "disabled"),
LIMIT_LENGTH(2, "multilinePolicy", "limit:1:*"), LIMIT_LENGTH(2, "diags.multilinePolicy", "limit:1:*"),
LIMIT_DEPTH(3, "multilinePolicy", "limit:*:1"), LIMIT_DEPTH(3, "diags.multilinePolicy", "limit:*:1"),
LIMIT_BOTH(4, "multilinePolicy", "limit:1:1"); LIMIT_BOTH(4, "diags.multilinePolicy", "limit:1:1");
String name; String name;
String value; String value;
@ -371,7 +371,7 @@ public class T6769027 {
indentString += (detailsIndent == IndentKind.CUSTOM) ? "|3" : "|0"; indentString += (detailsIndent == IndentKind.CUSTOM) ? "|3" : "|0";
indentString += (sourceIndent == IndentKind.CUSTOM) ? "|3" : "|0"; indentString += (sourceIndent == IndentKind.CUSTOM) ? "|3" : "|0";
indentString += (subdiagsIndent == IndentKind.CUSTOM) ? "|3" : "|0"; indentString += (subdiagsIndent == IndentKind.CUSTOM) ? "|3" : "|0";
options.put("diagsIndentation", indentString); options.put("diags.indent", indentString);
MyLog log = new MyLog(ctx); MyLog log = new MyLog(ctx);
JavacMessages messages = JavacMessages.instance(ctx); JavacMessages messages = JavacMessages.instance(ctx);
messages.add(locale -> ResourceBundle.getBundle("tester", locale)); messages.add(locale -> ResourceBundle.getBundle("tester", locale));

View File

@ -3,7 +3,7 @@
* @bug 6862608 * @bug 6862608
* @summary rich diagnostic sometimes contain wrong type variable numbering * @summary rich diagnostic sometimes contain wrong type variable numbering
* @author mcimadamore * @author mcimadamore
* @compile/fail/ref=T6862608a.out -XDrawDiagnostics -XDdiags=disambiguateTvars,where T6862608a.java * @compile/fail/ref=T6862608a.out -XDrawDiagnostics -diags:formatterOptions=disambiguateTvars,where T6862608a.java
*/ */

View File

@ -3,7 +3,7 @@
* @bug 6862608 * @bug 6862608
* @summary rich diagnostic sometimes contain wrong type variable numbering * @summary rich diagnostic sometimes contain wrong type variable numbering
* @author mcimadamore * @author mcimadamore
* @compile/fail/ref=T6862608b.out -XDrawDiagnostics -XDdiags=disambiguateTvars,where T6862608b.java * @compile/fail/ref=T6862608b.out -XDrawDiagnostics -diags:formatterOptions=disambiguateTvars,where T6862608b.java
*/ */
class T66862608b<T extends String, S> { class T66862608b<T extends String, S> {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -46,9 +46,9 @@ public class Test {
try { try {
test(Arrays.<String>asList(), test(Arrays.<String>asList(),
"myfo://test:1: error: cannot find symbol"); "myfo://test:1: error: cannot find symbol");
test(Arrays.asList("-XDdiagsFormat=OLD"), test(Arrays.asList("-diags:layout=OLD"),
"myfo://test:1: cannot find symbol"); "myfo://test:1: cannot find symbol");
test(Arrays.asList("-XDoldDiags"), test(Arrays.asList("-diags:legacy"),
"myfo://test:1: cannot find symbol"); "myfo://test:1: cannot find symbol");
} finally { } finally {
Locale.setDefault(prev); Locale.setDefault(prev);

View File

@ -2,7 +2,7 @@
* @test /nodynamiccopyright/ * @test /nodynamiccopyright/
* @bug 8010387 * @bug 8010387
* @summary rich diagnostic sometimes contain wrong type variable numbering * @summary rich diagnostic sometimes contain wrong type variable numbering
* @compile/fail/ref=T8010387.out -XDrawDiagnostics -XDdiags=disambiguateTvars,where T8010387.java * @compile/fail/ref=T8010387.out -XDrawDiagnostics -diags:formatterOptions=disambiguateTvars,where T8010387.java
*/ */
abstract class T8010387<X> { abstract class T8010387<X> {

View File

@ -4,7 +4,7 @@
* @summary Verify that invalid access modifiers on interface members don't cause crash. * @summary Verify that invalid access modifiers on interface members don't cause crash.
* @author maddox * @author maddox
* *
* @compile/fail/ref=InterfaceMemberClassModifiers.out -XDdiags=%b:%l:%_%m InterfaceMemberClassModifiers.java * @compile/fail/ref=InterfaceMemberClassModifiers.out -diags:layout=%b:%l:%_%m InterfaceMemberClassModifiers.java
*/ */
public interface InterfaceMemberClassModifiers { public interface InterfaceMemberClassModifiers {

View File

@ -3,7 +3,7 @@
* @bug 5003235 * @bug 5003235
* @summary Private inner class accessible from subclasses * @summary Private inner class accessible from subclasses
* @author Peter von der Ah\u00e9 * @author Peter von der Ah\u00e9
* @compile/fail/ref=T5003235a.out -XDdiags=%b:%l:%_%m T5003235a.java * @compile/fail/ref=T5003235a.out -diags:layout=%b:%l:%_%m T5003235a.java
*/ */
class Super { class Super {

View File

@ -3,7 +3,7 @@
* @bug 5003235 * @bug 5003235
* @summary Accessibility of private inner class * @summary Accessibility of private inner class
* @author Peter von der Ah\u00e9 * @author Peter von der Ah\u00e9
* @compile/fail/ref=T5003235b.out -XDdiags=%b:%l:%_%m T5003235b.java * @compile/fail/ref=T5003235b.out -diags:layout=%b:%l:%_%m T5003235b.java
*/ */
class Outer { class Outer {

View File

@ -2,8 +2,8 @@
* @test /nodynamiccopyright/ * @test /nodynamiccopyright/
* @bug 6214885 * @bug 6214885
* @summary This test exercises features provided by the new internal Diagnostics API * @summary This test exercises features provided by the new internal Diagnostics API
* @compile/fail/ref=T6214885a.out -XDdiags=%b:%l%_%t%m|%p%m T6214885.java * @compile/fail/ref=T6214885a.out -diags:layout=%b:%l%_%t%m|%p%m T6214885.java
* @compile/fail/ref=T6214885b.out -XDdiags=%b:%l:%c%_%t%m|%p%m T6214885.java * @compile/fail/ref=T6214885b.out -diags:layout=%b:%l:%c%_%t%m|%p%m T6214885.java
*/ */
class T6214885 class T6214885
{ {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -62,8 +62,8 @@ public class T6731573 extends ToolTester {
enum SourceLine { enum SourceLine {
STANDARD(null), STANDARD(null),
ENABLED("-XDshowSource=true"), ENABLED("-diags:showSource=true"),
DISABLED("-XDshowSource=false"); DISABLED("-diags:showSource=false");
String optValue; String optValue;

View File

@ -263,6 +263,9 @@ public class CheckResourceKeys {
// ignore shouldstop flag names // ignore shouldstop flag names
if (cs.startsWith("shouldstop.")) if (cs.startsWith("shouldstop."))
continue; continue;
// ignore diagsformat flag names
if (cs.startsWith("diags."))
continue;
// explicit known exceptions // explicit known exceptions
if (noResourceRequired.contains(cs)) if (noResourceRequired.contains(cs))
continue; continue;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -28,7 +28,7 @@
// key: compiler.err.cant.apply.symbol // key: compiler.err.cant.apply.symbol
// key: compiler.misc.incompatible.eq.bounds // key: compiler.misc.incompatible.eq.bounds
// key: compiler.misc.captured.type // key: compiler.misc.captured.type
// options: -XDdiags=where,simpleNames // options: -diags:formatterOptions=where,simpleNames
// run: simple // run: simple
import java.util.*; import java.util.*;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -29,7 +29,7 @@
// key: compiler.misc.incompatible.eq.bounds // key: compiler.misc.incompatible.eq.bounds
// key: compiler.misc.captured.type // key: compiler.misc.captured.type
// key: compiler.misc.type.null // key: compiler.misc.type.null
// options: -XDdiags=where,simpleNames // options: -diags:formatterOptions=where,simpleNames
// run: simple // run: simple
import java.util.*; import java.util.*;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -25,7 +25,7 @@
// key: compiler.misc.where.description.typevar // key: compiler.misc.where.description.typevar
// key: compiler.err.prob.found.req // key: compiler.err.prob.found.req
// key: compiler.misc.inconvertible.types // key: compiler.misc.inconvertible.types
// options: -XDdiags=where,simpleNames // options: -diags:formatterOptions=where,simpleNames
// run: simple // run: simple
import java.util.*; import java.util.*;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -26,7 +26,7 @@
// key: compiler.misc.where.description.intersection.1 // key: compiler.misc.where.description.intersection.1
// key: compiler.misc.where.intersection // key: compiler.misc.where.intersection
// key: compiler.err.prob.found.req // key: compiler.err.prob.found.req
// options: -XDdiags=where // options: -diags:formatterOptions=where
// run: simple // run: simple
class WhereIntersection { class WhereIntersection {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -29,7 +29,7 @@
// key: compiler.misc.where.description.intersection // key: compiler.misc.where.description.intersection
// key: compiler.misc.where.intersection // key: compiler.misc.where.intersection
// key: compiler.err.prob.found.req // key: compiler.err.prob.found.req
// options: -XDdiags=where // options: -diags:formatterOptions=where
// run: simple // run: simple
class WhereIntersection2 { class WhereIntersection2 {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -27,7 +27,7 @@
// key: compiler.err.cant.apply.symbol // key: compiler.err.cant.apply.symbol
// key: compiler.misc.no.conforming.assignment.exists // key: compiler.misc.no.conforming.assignment.exists
// key: compiler.misc.inconvertible.types // key: compiler.misc.inconvertible.types
// options: -XDdiags=where,disambiguateTvars // options: -diags:formatterOptions=where,disambiguateTvars
// run: simple // run: simple
class WhereTypeVar<T extends String> { class WhereTypeVar<T extends String> {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -25,7 +25,7 @@
// key: compiler.misc.where.description.typevar // key: compiler.misc.where.description.typevar
// key: compiler.misc.where.typevar // key: compiler.misc.where.typevar
// key: compiler.err.prob.found.req // key: compiler.err.prob.found.req
// options: -XDdiags=where // options: -diags:formatterOptions=where
// run: simple // run: simple
class WhereTypeVar2 { class WhereTypeVar2 {

View File

@ -5,7 +5,7 @@
* class is no longer available during a subsequent compilation. * class is no longer available during a subsequent compilation.
* @author maddox * @author maddox
* @build impl * @build impl
* @compile/fail/ref=MissingSuperRecovery.out -XDdiags=%b:%l:%_%m MissingSuperRecovery.java * @compile/fail/ref=MissingSuperRecovery.out -diags:layout=%b:%l:%_%m MissingSuperRecovery.java
*/ */
// Requires "golden" class file 'impl.class', which contains // Requires "golden" class file 'impl.class', which contains

View File

@ -4,7 +4,7 @@
* @summary Verify correct implementation of JLS2e 6.6.2.1 * @summary Verify correct implementation of JLS2e 6.6.2.1
* @author maddox * @author maddox
* *
* @compile/fail/ref=ProtectedMemberAccess2.out -XDdiags=-simpleNames -XDdiagsFormat=%b:%l:%_%m ProtectedMemberAccess2.java * @compile/fail/ref=ProtectedMemberAccess2.out -diags:formatterOptions=-simpleNames;layout=%b:%l:%_%m ProtectedMemberAccess2.java
*/ */
// 71 errors expected. // 71 errors expected.

View File

@ -4,7 +4,7 @@
* @summary Verify correct implementation of JLS2e 6.6.2.1 * @summary Verify correct implementation of JLS2e 6.6.2.1
* @author maddox * @author maddox
* *
* @compile/fail/ref=ProtectedMemberAccess3.out -XDdiags=-simpleNames -XDdiagsFormat=%b:%l:%_%m ProtectedMemberAccess3.java * @compile/fail/ref=ProtectedMemberAccess3.out -diags:formatterOptions=-simpleNames;layout=%b:%l:%_%m ProtectedMemberAccess3.java
*/ */
// 46 errors expected. // 46 errors expected.

View File

@ -4,7 +4,7 @@
* @summary Verify correct implementation of JLS2e 6.6.2.1 * @summary Verify correct implementation of JLS2e 6.6.2.1
* @author maddox * @author maddox
* *
* @compile/fail/ref=ProtectedMemberAccess4.out -XDdiags=-simpleNames -XDdiagsFormat=%b:%l:%_%m ProtectedMemberAccess4.java * @compile/fail/ref=ProtectedMemberAccess4.out -diags:formatterOptions=-simpleNames;layout=%b:%l:%_%m ProtectedMemberAccess4.java
*/ */
// 33 errors expected. // 33 errors expected.

View File

@ -3,7 +3,7 @@
* @bug 4739428 4785453 * @bug 4739428 4785453
* @summary when \u000a is used, diagnostics are reported on the wrong line. * @summary when \u000a is used, diagnostics are reported on the wrong line.
* *
* @compile/fail/ref=UnicodeNewline.out -XDdiags=%b:%l:%_%m UnicodeNewline.java * @compile/fail/ref=UnicodeNewline.out -diags:layout=%b:%l:%_%m UnicodeNewline.java
*/ */
class UnicodeNewline { class UnicodeNewline {