8153407: javac, fold debug options

Reviewed-by: mcimadamore, jjg
This commit is contained in:
Vicente Romero 2016-07-08 16:47:13 -07:00
parent 003244f622
commit bec16625dc
33 changed files with 96 additions and 74 deletions

View File

@ -62,6 +62,8 @@ import java.util.Set;
import java.util.function.BiFunction; import java.util.function.BiFunction;
import java.util.function.BiPredicate; import java.util.function.BiPredicate;
import com.sun.tools.javac.main.Option;
import static com.sun.tools.javac.code.TypeTag.*; import static com.sun.tools.javac.code.TypeTag.*;
/** Helper class for type parameter inference, used by the attribution phase. /** Helper class for type parameter inference, used by the attribution phase.
@ -87,7 +89,7 @@ public class Infer {
/** /**
* folder in which the inference dependency graphs should be written. * folder in which the inference dependency graphs should be written.
*/ */
final private String dependenciesFolder; private final String dependenciesFolder;
/** /**
* List of graphs awaiting to be dumped to a file. * List of graphs awaiting to be dumped to a file.
@ -114,7 +116,7 @@ public class Infer {
Options options = Options.instance(context); Options options = Options.instance(context);
allowGraphInference = Source.instance(context).allowGraphInference() allowGraphInference = Source.instance(context).allowGraphInference()
&& options.isUnset("useLegacyInference"); && options.isUnset("useLegacyInference");
dependenciesFolder = options.get("dumpInferenceGraphsTo"); dependenciesFolder = options.get("debug.dumpInferenceGraphsTo");
pendingGraphs = List.nil(); pendingGraphs = List.nil();
emptyContext = new InferenceContext(this, List.<Type>nil()); emptyContext = new InferenceContext(this, List.<Type>nil());

View File

@ -68,6 +68,8 @@ import static com.sun.tools.javac.tree.JCTree.Tag.*;
import javax.lang.model.element.ElementKind; import javax.lang.model.element.ElementKind;
import javax.lang.model.type.TypeKind; import javax.lang.model.type.TypeKind;
import com.sun.tools.javac.main.Option;
/** /**
* This pass desugars lambda expressions into static methods * This pass desugars lambda expressions into static methods
* *
@ -104,7 +106,7 @@ public class LambdaToMethod extends TreeTranslator {
private KlassInfo kInfo; private KlassInfo kInfo;
/** dump statistics about lambda code generation */ /** dump statistics about lambda code generation */
private boolean dumpLambdaToMethodStats; private final boolean dumpLambdaToMethodStats;
/** force serializable representation, for stress testing **/ /** force serializable representation, for stress testing **/
private final boolean forceSerializable; private final boolean forceSerializable;
@ -142,7 +144,7 @@ public class LambdaToMethod extends TreeTranslator {
transTypes = TransTypes.instance(context); transTypes = TransTypes.instance(context);
analyzer = new LambdaAnalyzerPreprocessor(); analyzer = new LambdaAnalyzerPreprocessor();
Options options = Options.instance(context); Options options = Options.instance(context);
dumpLambdaToMethodStats = options.isSet("dumpLambdaToMethodStats"); dumpLambdaToMethodStats = options.isSet("debug.dumpLambdaToMethodStats");
attr = Attr.instance(context); attr = Attr.instance(context);
forceSerializable = options.isSet("forceSerializable"); forceSerializable = options.isSet("forceSerializable");
} }

View File

@ -180,7 +180,7 @@ public class Resolve {
} }
static EnumSet<VerboseResolutionMode> getVerboseResolutionMode(Options opts) { static EnumSet<VerboseResolutionMode> getVerboseResolutionMode(Options opts) {
String s = opts.get("verboseResolution"); String s = opts.get("debug.verboseResolution");
EnumSet<VerboseResolutionMode> res = EnumSet.noneOf(VerboseResolutionMode.class); EnumSet<VerboseResolutionMode> res = EnumSet.noneOf(VerboseResolutionMode.class);
if (s == null) return res; if (s == null) return res;
if (s.contains("all")) { if (s.contains("all")) {

View File

@ -47,6 +47,7 @@ import com.sun.tools.javac.jvm.Pool.DynamicMethod;
import com.sun.tools.javac.jvm.Pool.Method; import com.sun.tools.javac.jvm.Pool.Method;
import com.sun.tools.javac.jvm.Pool.MethodHandle; import com.sun.tools.javac.jvm.Pool.MethodHandle;
import com.sun.tools.javac.jvm.Pool.Variable; import com.sun.tools.javac.jvm.Pool.Variable;
import com.sun.tools.javac.main.Option;
import com.sun.tools.javac.util.*; import com.sun.tools.javac.util.*;
import static com.sun.tools.javac.code.Flags.*; import static com.sun.tools.javac.code.Flags.*;
@ -84,7 +85,7 @@ public class ClassWriter extends ClassFile {
/** Switch: describe the generated stackmap. /** Switch: describe the generated stackmap.
*/ */
boolean debugstackmap; private boolean debugstackmap;
/** /**
* Target class version. * Target class version.
@ -181,20 +182,18 @@ public class ClassWriter extends ClassFile {
verbose = options.isSet(VERBOSE); verbose = options.isSet(VERBOSE);
genCrt = options.isSet(XJCOV); genCrt = options.isSet(XJCOV);
debugstackmap = options.isSet("debugstackmap"); debugstackmap = options.isSet("debug.stackmap");
emitSourceFile = options.isUnset(G_CUSTOM) || emitSourceFile = options.isUnset(G_CUSTOM) ||
options.isSet(G_CUSTOM, "source"); options.isSet(G_CUSTOM, "source");
String dumpModFlags = options.get("dumpmodifiers"); String modifierFlags = options.get("debug.dumpmodifiers");
dumpClassModifiers = if (modifierFlags != null) {
(dumpModFlags != null && dumpModFlags.indexOf('c') != -1); dumpClassModifiers = modifierFlags.indexOf('c') != -1;
dumpFieldModifiers = dumpFieldModifiers = modifierFlags.indexOf('f') != -1;
(dumpModFlags != null && dumpModFlags.indexOf('f') != -1); dumpInnerClassModifiers = modifierFlags.indexOf('i') != -1;
dumpInnerClassModifiers = dumpMethodModifiers = modifierFlags.indexOf('m') != -1;
(dumpModFlags != null && dumpModFlags.indexOf('i') != -1); }
dumpMethodModifiers =
(dumpModFlags != null && dumpModFlags.indexOf('m') != -1);
} }
/****************************************************************** /******************************************************************
@ -210,10 +209,10 @@ public class ClassWriter extends ClassFile {
* For example, to dump everything: * For example, to dump everything:
* javac -XDdumpmodifiers=cifm MyProg.java * javac -XDdumpmodifiers=cifm MyProg.java
*/ */
private final boolean dumpClassModifiers; // -XDdumpmodifiers=c private boolean dumpClassModifiers; // -XDdumpmodifiers=c
private final boolean dumpFieldModifiers; // -XDdumpmodifiers=f private boolean dumpFieldModifiers; // -XDdumpmodifiers=f
private final boolean dumpInnerClassModifiers; // -XDdumpmodifiers=i private boolean dumpInnerClassModifiers; // -XDdumpmodifiers=i
private final boolean dumpMethodModifiers; // -XDdumpmodifiers=m private boolean dumpMethodModifiers; // -XDdumpmodifiers=m
/** Return flags as a string, separated by " ". /** Return flags as a string, separated by " ".

View File

@ -38,6 +38,7 @@ import com.sun.tools.javac.code.Symbol.*;
import com.sun.tools.javac.code.Type.*; import com.sun.tools.javac.code.Type.*;
import com.sun.tools.javac.jvm.Code.*; import com.sun.tools.javac.jvm.Code.*;
import com.sun.tools.javac.jvm.Items.*; import com.sun.tools.javac.jvm.Items.*;
import com.sun.tools.javac.main.Option;
import com.sun.tools.javac.tree.EndPosTable; import com.sun.tools.javac.tree.EndPosTable;
import com.sun.tools.javac.tree.JCTree.*; import com.sun.tools.javac.tree.JCTree.*;
@ -124,7 +125,7 @@ public class Gen extends JCTree.Visitor {
? options.isSet(G) ? options.isSet(G)
: options.isSet(G_CUSTOM, "vars"); : options.isSet(G_CUSTOM, "vars");
genCrt = options.isSet(XJCOV); genCrt = options.isSet(XJCOV);
debugCode = options.isSet("debugcode"); debugCode = options.isSet("debug.code");
allowBetterNullChecks = target.hasObjects(); allowBetterNullChecks = target.hasObjects();
pool = new Pool(types); pool = new Pool(types);

View File

@ -243,7 +243,7 @@ public class Main {
return Result.OK; return Result.OK;
// init Dependencies // init Dependencies
if (options.isSet("completionDeps")) { if (options.isSet("debug.completionDeps")) {
Dependencies.GraphDependencies.preRegister(context); Dependencies.GraphDependencies.preRegister(context);
} }

View File

@ -517,15 +517,32 @@ public enum Option {
} }
@Override @Override
public boolean process(OptionHelper helper, String option) { public boolean process(OptionHelper helper, String option) {
option = option.substring(text.length()); return process(helper, option, option.substring(text.length()));
int eq = option.indexOf('='); }
String key = (eq < 0) ? option : option.substring(0, eq);
String value = (eq < 0) ? option : option.substring(eq+1); @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); helper.put(key, value);
return false; return false;
} }
}, },
XDEBUG("-Xdebug:", null, HIDDEN, BASIC) {
@Override
public boolean process(OptionHelper helper, String option) {
String p = option.substring(option.indexOf(':') + 1).trim();
String[] subOptions = p.split(";");
for (String subOption : subOptions) {
subOption = "debug." + subOption.trim();
XD.process(helper, subOption, subOption);
}
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) {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, 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
@ -47,8 +47,6 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Properties; import java.util.Properties;
import java.util.Stack; import java.util.Stack;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import javax.tools.JavaFileObject; import javax.tools.JavaFileObject;
@ -126,9 +124,9 @@ public abstract class Dependencies {
*/ */
GraphDependencies(Context context) { GraphDependencies(Context context) {
super(context); super(context);
Options options = Options.instance(context);
//fetch filename //fetch filename
String[] modes = options.get("completionDeps").split(","); Options options = Options.instance(context);
String[] modes = options.get("debug.completionDeps").split(",");
for (String mode : modes) { for (String mode : modes) {
if (mode.startsWith("file=")) { if (mode.startsWith("file=")) {
dependenciesFile = mode.substring(5); dependenciesFile = mode.substring(5);

View File

@ -313,7 +313,7 @@ public class Options {
} }
// Enable dependency generation // Enable dependency generation
args.add("-XDcompletionDeps=source,class"); args.add("-Xdebug:completionDeps=source,class");
// This can't be anything but 'none'. Enforced by sjavac main method. // This can't be anything but 'none'. Enforced by sjavac main method.
args.add("-implicit:" + implicitPolicy); args.add("-implicit:" + implicitPolicy);

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 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 @@
* file are correct, including those within InnerClasses attributes. * file are correct, including those within InnerClasses attributes.
* @author John Rose (jrose). Entered as a regression test by Bill Maddox (maddox). * @author John Rose (jrose). Entered as a regression test by Bill Maddox (maddox).
* *
* @compile/ref=ClassModifiers.out -XDdumpmodifiers=ci ClassModifiers.java * @compile/ref=ClassModifiers.out -Xdebug:dumpmodifiers=ci ClassModifiers.java
* *
*/ */

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1999, 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 @@
* @bug 4249112 4785453 * @bug 4249112 4785453
* @summary Verify that implicit member modifiers are set correctly. * @summary Verify that implicit member modifiers are set correctly.
* *
* @compile/ref=MemberModifiers.out -XDdumpmodifiers=cfm MemberModifiers.java * @compile/ref=MemberModifiers.out -Xdebug:dumpmodifiers=cfm MemberModifiers.java
*/ */
// Currently, we check only that members of final classes are not final. // Currently, we check only that members of final classes are not final.

View File

@ -47,7 +47,7 @@ public class DepsAndAnno {
public static void main(String[] args) { public static void main(String[] args) {
ToolBox toolBox = new ToolBox(); ToolBox toolBox = new ToolBox();
new JavacTask(toolBox, Task.Mode.CMDLINE) new JavacTask(toolBox, Task.Mode.CMDLINE)
.options("-XDcompletionDeps") .options("-Xdebug:completionDeps")
.outdir(".") .outdir(".")
.files(ToolBox.testSrc + "/DepsAndAnno.java") .files(ToolBox.testSrc + "/DepsAndAnno.java")
.run(); .run();

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 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 @@
* @test * @test
* @bug 8078389 * @bug 8078389
* @summary Make sure there is no interference between completionDeps and doclint * @summary Make sure there is no interference between completionDeps and doclint
* @compile -XDcompletionDeps -Xdoclint DepsAndDocLint.java * @compile -Xdebug:completionDeps -Xdoclint DepsAndDocLint.java
*/ */
public class DepsAndDocLint { public class DepsAndDocLint {

View File

@ -257,6 +257,9 @@ public class CheckResourceKeys {
// ignore package and class names // ignore package and class names
if (cs.matches("(com|java|javax|jdk|sun)\\.[A-Za-z.]+")) if (cs.matches("(com|java|javax|jdk|sun)\\.[A-Za-z.]+"))
continue; continue;
// ignore debug flag names
if (cs.startsWith("debug."))
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) 2011, 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
@ -23,7 +23,7 @@
// key: compiler.misc.applicable.method.found // key: compiler.misc.applicable.method.found
// key: compiler.note.verbose.resolve.multi // key: compiler.note.verbose.resolve.multi
// options: -XDverboseResolution=applicable,success // options: -Xdebug:verboseResolution=applicable,success
class ApplicableMethodFound { class ApplicableMethodFound {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2011, 2012, 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
@ -24,7 +24,7 @@
// key: compiler.misc.applicable.method.found.1 // key: compiler.misc.applicable.method.found.1
// key: compiler.note.verbose.resolve.multi // key: compiler.note.verbose.resolve.multi
// key: compiler.misc.partial.inst.sig // key: compiler.misc.partial.inst.sig
// options: -XDverboseResolution=applicable,success // options: -Xdebug:verboseResolution=applicable,success
class ApplicableMethodFound1 { class ApplicableMethodFound1 {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2011, 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
@ -25,7 +25,7 @@
// key: compiler.note.verbose.resolve.multi // key: compiler.note.verbose.resolve.multi
// key: compiler.note.deferred.method.inst // key: compiler.note.deferred.method.inst
// key: compiler.misc.partial.inst.sig // key: compiler.misc.partial.inst.sig
// options: -XDverboseResolution=applicable,success,deferred-inference // options: -Xdebug:verboseResolution=applicable,success,deferred-inference
class DeferredMethodInst { class DeferredMethodInst {

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
@ -22,7 +22,7 @@
*/ */
// key: compiler.note.lambda.stat // key: compiler.note.lambda.stat
// options: -XDdumpLambdaToMethodStats // options: -Xdebug:dumpLambdaToMethodStats
class LambdaStat { class LambdaStat {
Runnable r = ()->{}; Runnable r = ()->{};

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
@ -22,7 +22,7 @@
*/ */
// key: compiler.note.mref.stat // key: compiler.note.mref.stat
// options: -XDdumpLambdaToMethodStats // options: -Xdebug:dumpLambdaToMethodStats
class MrefStat { class MrefStat {
Runnable r = MrefStat::m; Runnable r = MrefStat::m;

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
@ -22,7 +22,7 @@
*/ */
// key: compiler.note.mref.stat.1 // key: compiler.note.mref.stat.1
// options: -XDdumpLambdaToMethodStats // options: -Xdebug:dumpLambdaToMethodStats
class MrefStat1 { class MrefStat1 {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2011, 2012, 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
@ -26,7 +26,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: -XDverboseResolution=inapplicable,failure // options: -Xdebug:verboseResolution=inapplicable,failure
class NotApplicableMethodFound { class NotApplicableMethodFound {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2011, 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
@ -24,7 +24,7 @@
// key: compiler.misc.applicable.method.found.1 // key: compiler.misc.applicable.method.found.1
// key: compiler.note.verbose.resolve.multi // key: compiler.note.verbose.resolve.multi
// key: compiler.misc.partial.inst.sig // key: compiler.misc.partial.inst.sig
// options: -XDverboseResolution=applicable,success // options: -Xdebug:verboseResolution=applicable,success
class PartialInstSig { class PartialInstSig {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2011, 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
@ -23,7 +23,7 @@
// key: compiler.misc.applicable.method.found // key: compiler.misc.applicable.method.found
// key: compiler.note.verbose.resolve.multi // key: compiler.note.verbose.resolve.multi
// options: -XDverboseResolution=applicable,success // options: -Xdebug:verboseResolution=applicable,success
class VerboseResolveMulti { class VerboseResolveMulti {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2011, 2012, 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
@ -26,7 +26,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: -XDverboseResolution=inapplicable,failure // options: -Xdebug:verboseResolution=inapplicable,failure
class VerboseResolveMulti1 { class VerboseResolveMulti1 {

View File

@ -27,7 +27,7 @@
* @test * @test
* @bug 8158355 * @bug 8158355
* @summary Inference graph dot support broken * @summary Inference graph dot support broken
* @compile -XDdumpInferenceGraphsTo=. T8158355.java * @compile -Xdebug:dumpInferenceGraphsTo=. T8158355.java
*/ */
import java.util.List; import java.util.List;

View File

@ -2,7 +2,7 @@
* @test /nodynamiccopyright/ * @test /nodynamiccopyright/
* @bug 8029718 * @bug 8029718
* @summary Should always use lambda body structure to disambiguate overload resolution * @summary Should always use lambda body structure to disambiguate overload resolution
* @compile/fail/ref=MostSpecific09.out -XDrawDiagnostics -XDshouldStopPolicy=ATTR -XDverboseResolution=applicable,success MostSpecific09.java * @compile/fail/ref=MostSpecific09.out -XDrawDiagnostics -XDshouldStopPolicy=ATTR -Xdebug:verboseResolution=applicable,success MostSpecific09.java
*/ */
class MostSpecific09 { class MostSpecific09 {

View File

@ -3,7 +3,7 @@ MostSpecific09.java:26:9: compiler.note.verbose.resolve.multi: foo, MostSpecific
MostSpecific09.java:27:9: compiler.note.verbose.resolve.multi: foo, MostSpecific09, 0, BASIC, compiler.misc.type.none, compiler.misc.no.args,{(compiler.misc.applicable.method.found: 0, foo(MostSpecific09.J), null)} MostSpecific09.java:27:9: compiler.note.verbose.resolve.multi: foo, MostSpecific09, 0, BASIC, compiler.misc.type.none, compiler.misc.no.args,{(compiler.misc.applicable.method.found: 0, foo(MostSpecific09.J), null)}
MostSpecific09.java:27:32: compiler.note.verbose.resolve.multi: println, java.io.PrintStream, 1, BASIC, java.lang.String, compiler.misc.no.args,{(compiler.misc.applicable.method.found: 0, println(java.lang.Object), null),(compiler.misc.applicable.method.found: 1, println(java.lang.String), null)} MostSpecific09.java:27:32: compiler.note.verbose.resolve.multi: println, java.io.PrintStream, 1, BASIC, java.lang.String, compiler.misc.no.args,{(compiler.misc.applicable.method.found: 0, println(java.lang.Object), null),(compiler.misc.applicable.method.found: 1, println(java.lang.String), null)}
MostSpecific09.java:28:13: compiler.err.lambda.body.neither.value.nor.void.compatible MostSpecific09.java:28:13: compiler.err.lambda.body.neither.value.nor.void.compatible
MostSpecific09.java:28:9: compiler.err.cant.apply.symbols: kindname.method, foo, @680,{(compiler.misc.inapplicable.method: kindname.method, MostSpecific09, foo(MostSpecific09.I), (compiler.misc.no.conforming.assignment.exists: (compiler.misc.incompatible.ret.type.in.lambda: (compiler.misc.missing.ret.val: java.lang.String)))),(compiler.misc.inapplicable.method: kindname.method, MostSpecific09, foo(MostSpecific09.J), (compiler.misc.no.conforming.assignment.exists: (compiler.misc.unexpected.ret.val)))} MostSpecific09.java:28:9: compiler.err.cant.apply.symbols: kindname.method, foo, @685,{(compiler.misc.inapplicable.method: kindname.method, MostSpecific09, foo(MostSpecific09.I), (compiler.misc.no.conforming.assignment.exists: (compiler.misc.incompatible.ret.type.in.lambda: (compiler.misc.missing.ret.val: java.lang.String)))),(compiler.misc.inapplicable.method: kindname.method, MostSpecific09, foo(MostSpecific09.J), (compiler.misc.no.conforming.assignment.exists: (compiler.misc.unexpected.ret.val)))}
MostSpecific09.java:28:43: compiler.note.verbose.resolve.multi: println, java.io.PrintStream, 1, BASIC, java.lang.String, compiler.misc.no.args,{(compiler.misc.applicable.method.found: 0, println(java.lang.Object), null),(compiler.misc.applicable.method.found: 1, println(java.lang.String), null)} MostSpecific09.java:28:43: compiler.note.verbose.resolve.multi: println, java.io.PrintStream, 1, BASIC, java.lang.String, compiler.misc.no.args,{(compiler.misc.applicable.method.found: 0, println(java.lang.Object), null),(compiler.misc.applicable.method.found: 1, println(java.lang.String), null)}
MostSpecific09.java:29:9: compiler.err.ref.ambiguous: foo, kindname.method, foo(MostSpecific09.I), MostSpecific09, kindname.method, foo(MostSpecific09.J), MostSpecific09 MostSpecific09.java:29:9: compiler.err.ref.ambiguous: foo, kindname.method, foo(MostSpecific09.I), MostSpecific09, kindname.method, foo(MostSpecific09.J), MostSpecific09
MostSpecific09.java:29:28: compiler.note.verbose.resolve.multi: <init>, java.lang.RuntimeException, 0, BASIC, compiler.misc.no.args, compiler.misc.no.args,{(compiler.misc.applicable.method.found: 0, java.lang.RuntimeException(), null)} MostSpecific09.java:29:28: compiler.note.verbose.resolve.multi: <init>, java.lang.RuntimeException, 0, BASIC, compiler.misc.no.args, compiler.misc.no.args,{(compiler.misc.applicable.method.found: 0, java.lang.RuntimeException(), null)}
@ -11,7 +11,7 @@ MostSpecific09.java:30:9: compiler.err.ref.ambiguous: foo, kindname.method, foo(
MostSpecific09.java:32:9: compiler.err.ref.ambiguous: foo, kindname.method, foo(MostSpecific09.I), MostSpecific09, kindname.method, foo(MostSpecific09.J), MostSpecific09 MostSpecific09.java:32:9: compiler.err.ref.ambiguous: foo, kindname.method, foo(MostSpecific09.I), MostSpecific09, kindname.method, foo(MostSpecific09.J), MostSpecific09
MostSpecific09.java:33:9: compiler.note.verbose.resolve.multi: foo, MostSpecific09, 0, BASIC, compiler.misc.type.none, compiler.misc.no.args,{(compiler.misc.applicable.method.found: 0, foo(MostSpecific09.I), null)} MostSpecific09.java:33:9: compiler.note.verbose.resolve.multi: foo, MostSpecific09, 0, BASIC, compiler.misc.type.none, compiler.misc.no.args,{(compiler.misc.applicable.method.found: 0, foo(MostSpecific09.I), null)}
MostSpecific09.java:42:13: compiler.err.lambda.body.neither.value.nor.void.compatible MostSpecific09.java:42:13: compiler.err.lambda.body.neither.value.nor.void.compatible
MostSpecific09.java:42:9: compiler.err.cant.apply.symbols: kindname.method, foo, @1129,{(compiler.misc.inapplicable.method: kindname.method, MostSpecific09, foo(MostSpecific09.I), (compiler.misc.no.conforming.assignment.exists: (compiler.misc.incompatible.ret.type.in.lambda: (compiler.misc.missing.ret.val: java.lang.String)))),(compiler.misc.inapplicable.method: kindname.method, MostSpecific09, foo(MostSpecific09.J), (compiler.misc.no.conforming.assignment.exists: (compiler.misc.unexpected.ret.val)))} MostSpecific09.java:42:9: compiler.err.cant.apply.symbols: kindname.method, foo, @1134,{(compiler.misc.inapplicable.method: kindname.method, MostSpecific09, foo(MostSpecific09.I), (compiler.misc.no.conforming.assignment.exists: (compiler.misc.incompatible.ret.type.in.lambda: (compiler.misc.missing.ret.val: java.lang.String)))),(compiler.misc.inapplicable.method: kindname.method, MostSpecific09, foo(MostSpecific09.J), (compiler.misc.no.conforming.assignment.exists: (compiler.misc.unexpected.ret.val)))}
MostSpecific09.java:46:23: compiler.note.verbose.resolve.multi: println, java.io.PrintStream, 1, BASIC, java.lang.String, compiler.misc.no.args,{(compiler.misc.applicable.method.found: 0, println(java.lang.Object), null),(compiler.misc.applicable.method.found: 1, println(java.lang.String), null)} MostSpecific09.java:46:23: compiler.note.verbose.resolve.multi: println, java.io.PrintStream, 1, BASIC, java.lang.String, compiler.misc.no.args,{(compiler.misc.applicable.method.found: 0, println(java.lang.Object), null),(compiler.misc.applicable.method.found: 1, println(java.lang.String), null)}
MostSpecific09.java:49:9: compiler.note.verbose.resolve.multi: foo, MostSpecific09, 0, BASIC, compiler.misc.type.none, compiler.misc.no.args,{(compiler.misc.applicable.method.found: 0, foo(MostSpecific09.J), null)} MostSpecific09.java:49:9: compiler.note.verbose.resolve.multi: foo, MostSpecific09, 0, BASIC, compiler.misc.type.none, compiler.misc.no.args,{(compiler.misc.applicable.method.found: 0, foo(MostSpecific09.J), null)}
MostSpecific09.java:56:25: compiler.note.verbose.resolve.multi: <init>, Bar, 0, BASIC, compiler.misc.no.args, compiler.misc.no.args,{(compiler.misc.applicable.method.found: 0, Bar(), null)} MostSpecific09.java:56:25: compiler.note.verbose.resolve.multi: <init>, Bar, 0, BASIC, compiler.misc.no.args, compiler.misc.no.args,{(compiler.misc.applicable.method.found: 0, Bar(), null)}

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2013, 2015, 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
@ -122,7 +122,7 @@ public class TestLambdaToMethodStats extends ComboInstance<TestLambdaToMethodSta
@Override @Override
public void doWork() throws IOException { public void doWork() throws IOException {
check(newCompilationTask() check(newCompilationTask()
.withOption("-XDdumpLambdaToMethodStats") .withOption("-Xdebug:dumpLambdaToMethodStats")
.withSourceFromTemplate(template) .withSourceFromTemplate(template)
.generate()); .generate());
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 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 @@
* @test * @test
* @bug 8143217 * @bug 8143217
* @summary javac throws NPE when printing diagnostics for Lambda expressions * @summary javac throws NPE when printing diagnostics for Lambda expressions
* @compile XDdumpLambdaToMethodStats.java -XDdumpLambdaToMethodStats * @compile XDdumpLambdaToMethodStats.java -Xdebug:dumpLambdaToMethodStats
* *
*/ */

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2013, 2015, 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
@ -274,7 +274,7 @@ public class TestMetafactoryBridges {
sourcefiles.add(new JavaSource(ck)); sourcefiles.add(new JavaSource(ck));
} }
JavacTask ct = (JavacTask)tool.getTask(debugWriter, null, diagChecker, JavacTask ct = (JavacTask)tool.getTask(debugWriter, null, diagChecker,
Arrays.asList("-XDdumpLambdaToMethodStats", "-d", outDir.getAbsolutePath(), Arrays.asList("-Xdebug:dumpLambdaToMethodStats", "-d", outDir.getAbsolutePath(),
"-sourcepath", srcDir.getAbsolutePath(), "-sourcepath", srcDir.getAbsolutePath(),
"-classpath", classesDir.getAbsolutePath(), "-classpath", classesDir.getAbsolutePath(),
pp.preferOpt), null, sourcefiles); pp.preferOpt), null, sourcefiles);

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 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
@ -210,7 +210,7 @@ public class StructuralMostSpecificTest extends ComboInstance<StructuralMostSpec
public void doWork() throws Throwable { public void doWork() throws Throwable {
check(newCompilationTask() check(newCompilationTask()
.withSourceFromTemplate(sourceTemplate) .withSourceFromTemplate(sourceTemplate)
.withOption("-XDverboseResolution=all,-predef,-internal,-object-init") .withOption("-Xdebug:verboseResolution=all,-predef,-internal,-object-init")
.analyze()); .analyze());
} }

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
@ -133,7 +133,7 @@ public class ResolveHarness implements javax.tools.DiagnosticListener<JavaFileOb
protected void check() throws Exception { protected void check() throws Exception {
String[] options = { String[] options = {
"-XDshouldStopPolicy=ATTR", "-XDshouldStopPolicy=ATTR",
"-XDverboseResolution=success,failure,applicable,inapplicable,deferred-inference,predef" "-Xdebug:verboseResolution=success,failure,applicable,inapplicable,deferred-inference,predef"
}; };
AbstractProcessor[] processors = { new ResolveCandidateFinder(), null }; AbstractProcessor[] processors = { new ResolveCandidateFinder(), null };

View File

@ -96,7 +96,7 @@ public class JavacOptionPrep {
// Ignore this option for now. When the file=... requirement goes // Ignore this option for now. When the file=... requirement goes
// away, this will be easier to handle. // away, this will be easier to handle.
if (option.startsWith("-XDcompletionDeps")) if (option.startsWith("-Xdebug:completionDeps"))
continue; continue;
switch (option) { switch (option) {