8153407: javac, fold debug options
authorvromero
Fri, 08 Jul 2016 16:47:13 -0700
changeset 39599 3c7da4996d8c
parent 39598 cfe9d74c11eb
child 39600 83ea7c12c164
8153407: javac, fold debug options Reviewed-by: mcimadamore, jjg
langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Infer.java
langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java
langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java
langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassWriter.java
langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java
langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Main.java
langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Option.java
langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/util/Dependencies.java
langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/options/Options.java
langtools/test/tools/javac/ClassFileModifiers/ClassModifiers.java
langtools/test/tools/javac/ClassFileModifiers/MemberModifiers.java
langtools/test/tools/javac/completionDeps/DepsAndAnno.java
langtools/test/tools/javac/completionDeps/DepsAndDocLint.java
langtools/test/tools/javac/diags/CheckResourceKeys.java
langtools/test/tools/javac/diags/examples/ApplicableMethodFound.java
langtools/test/tools/javac/diags/examples/ApplicableMethodFound1.java
langtools/test/tools/javac/diags/examples/DeferredMethodInst.java
langtools/test/tools/javac/diags/examples/LambdaStat.java
langtools/test/tools/javac/diags/examples/MrefStat.java
langtools/test/tools/javac/diags/examples/MrefStat1.java
langtools/test/tools/javac/diags/examples/NotApplicableMethodFound.java
langtools/test/tools/javac/diags/examples/PartialInstSig.java
langtools/test/tools/javac/diags/examples/VerboseResolveMulti.java
langtools/test/tools/javac/diags/examples/VerboseResolveMulti1.java
langtools/test/tools/javac/generics/inference/8158355/T8158355.java
langtools/test/tools/javac/lambda/MostSpecific09.java
langtools/test/tools/javac/lambda/MostSpecific09.out
langtools/test/tools/javac/lambda/TestLambdaToMethodStats.java
langtools/test/tools/javac/lambda/XDdumpLambdaToMethodStats.java
langtools/test/tools/javac/lambda/bridge/TestMetafactoryBridges.java
langtools/test/tools/javac/lambda/mostSpecific/StructuralMostSpecificTest.java
langtools/test/tools/javac/resolve/ResolveHarness.java
langtools/test/tools/sjavac/JavacOptionPrep.java
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Infer.java	Fri Jul 08 09:28:52 2016 -0700
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Infer.java	Fri Jul 08 16:47:13 2016 -0700
@@ -62,6 +62,8 @@
 import java.util.function.BiFunction;
 import java.util.function.BiPredicate;
 
+import com.sun.tools.javac.main.Option;
+
 import static com.sun.tools.javac.code.TypeTag.*;
 
 /** Helper class for type parameter inference, used by the attribution phase.
@@ -87,7 +89,7 @@
     /**
      * 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.
@@ -114,7 +116,7 @@
         Options options = Options.instance(context);
         allowGraphInference = Source.instance(context).allowGraphInference()
                 && options.isUnset("useLegacyInference");
-        dependenciesFolder = options.get("dumpInferenceGraphsTo");
+        dependenciesFolder = options.get("debug.dumpInferenceGraphsTo");
         pendingGraphs = List.nil();
 
         emptyContext = new InferenceContext(this, List.<Type>nil());
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java	Fri Jul 08 09:28:52 2016 -0700
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java	Fri Jul 08 16:47:13 2016 -0700
@@ -68,6 +68,8 @@
 import javax.lang.model.element.ElementKind;
 import javax.lang.model.type.TypeKind;
 
+import com.sun.tools.javac.main.Option;
+
 /**
  * This pass desugars lambda expressions into static methods
  *
@@ -104,7 +106,7 @@
     private KlassInfo kInfo;
 
     /** dump statistics about lambda code generation */
-    private boolean dumpLambdaToMethodStats;
+    private final boolean dumpLambdaToMethodStats;
 
     /** force serializable representation, for stress testing **/
     private final boolean forceSerializable;
@@ -142,7 +144,7 @@
         transTypes = TransTypes.instance(context);
         analyzer = new LambdaAnalyzerPreprocessor();
         Options options = Options.instance(context);
-        dumpLambdaToMethodStats = options.isSet("dumpLambdaToMethodStats");
+        dumpLambdaToMethodStats = options.isSet("debug.dumpLambdaToMethodStats");
         attr = Attr.instance(context);
         forceSerializable = options.isSet("forceSerializable");
     }
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java	Fri Jul 08 09:28:52 2016 -0700
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java	Fri Jul 08 16:47:13 2016 -0700
@@ -180,7 +180,7 @@
         }
 
         static EnumSet<VerboseResolutionMode> getVerboseResolutionMode(Options opts) {
-            String s = opts.get("verboseResolution");
+            String s = opts.get("debug.verboseResolution");
             EnumSet<VerboseResolutionMode> res = EnumSet.noneOf(VerboseResolutionMode.class);
             if (s == null) return res;
             if (s.contains("all")) {
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassWriter.java	Fri Jul 08 09:28:52 2016 -0700
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassWriter.java	Fri Jul 08 16:47:13 2016 -0700
@@ -47,6 +47,7 @@
 import com.sun.tools.javac.jvm.Pool.Method;
 import com.sun.tools.javac.jvm.Pool.MethodHandle;
 import com.sun.tools.javac.jvm.Pool.Variable;
+import com.sun.tools.javac.main.Option;
 import com.sun.tools.javac.util.*;
 
 import static com.sun.tools.javac.code.Flags.*;
@@ -84,7 +85,7 @@
 
     /** Switch: describe the generated stackmap.
      */
-    boolean debugstackmap;
+    private boolean debugstackmap;
 
     /**
      * Target class version.
@@ -181,20 +182,18 @@
 
         verbose        = options.isSet(VERBOSE);
         genCrt         = options.isSet(XJCOV);
-        debugstackmap  = options.isSet("debugstackmap");
+        debugstackmap = options.isSet("debug.stackmap");
 
         emitSourceFile = options.isUnset(G_CUSTOM) ||
                             options.isSet(G_CUSTOM, "source");
 
-        String dumpModFlags = options.get("dumpmodifiers");
-        dumpClassModifiers =
-            (dumpModFlags != null && dumpModFlags.indexOf('c') != -1);
-        dumpFieldModifiers =
-            (dumpModFlags != null && dumpModFlags.indexOf('f') != -1);
-        dumpInnerClassModifiers =
-            (dumpModFlags != null && dumpModFlags.indexOf('i') != -1);
-        dumpMethodModifiers =
-            (dumpModFlags != null && dumpModFlags.indexOf('m') != -1);
+        String modifierFlags = options.get("debug.dumpmodifiers");
+        if (modifierFlags != null) {
+            dumpClassModifiers = modifierFlags.indexOf('c') != -1;
+            dumpFieldModifiers = modifierFlags.indexOf('f') != -1;
+            dumpInnerClassModifiers = modifierFlags.indexOf('i') != -1;
+            dumpMethodModifiers = modifierFlags.indexOf('m') != -1;
+        }
     }
 
 /******************************************************************
@@ -210,10 +209,10 @@
      *  For example, to dump everything:
      *    javac -XDdumpmodifiers=cifm MyProg.java
      */
-    private final boolean dumpClassModifiers; // -XDdumpmodifiers=c
-    private final boolean dumpFieldModifiers; // -XDdumpmodifiers=f
-    private final boolean dumpInnerClassModifiers; // -XDdumpmodifiers=i
-    private final boolean dumpMethodModifiers; // -XDdumpmodifiers=m
+    private boolean dumpClassModifiers; // -XDdumpmodifiers=c
+    private boolean dumpFieldModifiers; // -XDdumpmodifiers=f
+    private boolean dumpInnerClassModifiers; // -XDdumpmodifiers=i
+    private boolean dumpMethodModifiers; // -XDdumpmodifiers=m
 
 
     /** Return flags as a string, separated by " ".
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java	Fri Jul 08 09:28:52 2016 -0700
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java	Fri Jul 08 16:47:13 2016 -0700
@@ -38,6 +38,7 @@
 import com.sun.tools.javac.code.Type.*;
 import com.sun.tools.javac.jvm.Code.*;
 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.JCTree.*;
 
@@ -124,7 +125,7 @@
             ? options.isSet(G)
             : options.isSet(G_CUSTOM, "vars");
         genCrt = options.isSet(XJCOV);
-        debugCode = options.isSet("debugcode");
+        debugCode = options.isSet("debug.code");
         allowBetterNullChecks = target.hasObjects();
         pool = new Pool(types);
 
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Main.java	Fri Jul 08 09:28:52 2016 -0700
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Main.java	Fri Jul 08 16:47:13 2016 -0700
@@ -243,7 +243,7 @@
             return Result.OK;
 
         // init Dependencies
-        if (options.isSet("completionDeps")) {
+        if (options.isSet("debug.completionDeps")) {
             Dependencies.GraphDependencies.preRegister(context);
         }
 
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Option.java	Fri Jul 08 09:28:52 2016 -0700
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Option.java	Fri Jul 08 16:47:13 2016 -0700
@@ -517,15 +517,32 @@
         }
         @Override
         public boolean process(OptionHelper helper, String option) {
-            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);
+            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) {
+        @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) {
         @Override
         public boolean process(OptionHelper helper, String option) {
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/util/Dependencies.java	Fri Jul 08 09:28:52 2016 -0700
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/util/Dependencies.java	Fri Jul 08 16:47:13 2016 -0700
@@ -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.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -47,8 +47,6 @@
 import java.util.Map;
 import java.util.Properties;
 import java.util.Stack;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
 
 import javax.tools.JavaFileObject;
 
@@ -126,9 +124,9 @@
          */
         GraphDependencies(Context context) {
             super(context);
+            //fetch filename
             Options options = Options.instance(context);
-            //fetch filename
-            String[] modes = options.get("completionDeps").split(",");
+            String[] modes = options.get("debug.completionDeps").split(",");
             for (String mode : modes) {
                 if (mode.startsWith("file=")) {
                     dependenciesFile = mode.substring(5);
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/options/Options.java	Fri Jul 08 09:28:52 2016 -0700
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/options/Options.java	Fri Jul 08 16:47:13 2016 -0700
@@ -313,7 +313,7 @@
         }
 
         // 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.
         args.add("-implicit:" + implicitPolicy);
--- a/langtools/test/tools/javac/ClassFileModifiers/ClassModifiers.java	Fri Jul 08 09:28:52 2016 -0700
+++ b/langtools/test/tools/javac/ClassFileModifiers/ClassModifiers.java	Fri Jul 08 16:47:13 2016 -0700
@@ -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.
  *
  * 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.
  * @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
  *
  */
 
--- a/langtools/test/tools/javac/ClassFileModifiers/MemberModifiers.java	Fri Jul 08 09:28:52 2016 -0700
+++ b/langtools/test/tools/javac/ClassFileModifiers/MemberModifiers.java	Fri Jul 08 16:47:13 2016 -0700
@@ -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.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
  * @bug 4249112 4785453
  * @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.
--- a/langtools/test/tools/javac/completionDeps/DepsAndAnno.java	Fri Jul 08 09:28:52 2016 -0700
+++ b/langtools/test/tools/javac/completionDeps/DepsAndAnno.java	Fri Jul 08 16:47:13 2016 -0700
@@ -47,7 +47,7 @@
     public static void main(String[] args) {
         ToolBox toolBox = new ToolBox();
         new JavacTask(toolBox, Task.Mode.CMDLINE)
-               .options("-XDcompletionDeps")
+               .options("-Xdebug:completionDeps")
                .outdir(".")
                .files(ToolBox.testSrc + "/DepsAndAnno.java")
                .run();
--- a/langtools/test/tools/javac/completionDeps/DepsAndDocLint.java	Fri Jul 08 09:28:52 2016 -0700
+++ b/langtools/test/tools/javac/completionDeps/DepsAndDocLint.java	Fri Jul 08 16:47:13 2016 -0700
@@ -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.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
  * @test
  * @bug 8078389
  * @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 {
--- a/langtools/test/tools/javac/diags/CheckResourceKeys.java	Fri Jul 08 09:28:52 2016 -0700
+++ b/langtools/test/tools/javac/diags/CheckResourceKeys.java	Fri Jul 08 16:47:13 2016 -0700
@@ -257,6 +257,9 @@
                 // ignore package and class names
                 if (cs.matches("(com|java|javax|jdk|sun)\\.[A-Za-z.]+"))
                     continue;
+                // ignore debug flag names
+                if (cs.startsWith("debug."))
+                    continue;
                 // explicit known exceptions
                 if (noResourceRequired.contains(cs))
                     continue;
--- a/langtools/test/tools/javac/diags/examples/ApplicableMethodFound.java	Fri Jul 08 09:28:52 2016 -0700
+++ b/langtools/test/tools/javac/diags/examples/ApplicableMethodFound.java	Fri Jul 08 16:47:13 2016 -0700
@@ -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.
  *
  * 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.note.verbose.resolve.multi
-// options: -XDverboseResolution=applicable,success
+// options: -Xdebug:verboseResolution=applicable,success
 
 class ApplicableMethodFound {
 
--- a/langtools/test/tools/javac/diags/examples/ApplicableMethodFound1.java	Fri Jul 08 09:28:52 2016 -0700
+++ b/langtools/test/tools/javac/diags/examples/ApplicableMethodFound1.java	Fri Jul 08 16:47:13 2016 -0700
@@ -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.
  *
  * 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.note.verbose.resolve.multi
 // key: compiler.misc.partial.inst.sig
-// options: -XDverboseResolution=applicable,success
+// options: -Xdebug:verboseResolution=applicable,success
 
 class ApplicableMethodFound1 {
 
--- a/langtools/test/tools/javac/diags/examples/DeferredMethodInst.java	Fri Jul 08 09:28:52 2016 -0700
+++ b/langtools/test/tools/javac/diags/examples/DeferredMethodInst.java	Fri Jul 08 16:47:13 2016 -0700
@@ -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.
  *
  * 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.deferred.method.inst
 // key: compiler.misc.partial.inst.sig
-// options: -XDverboseResolution=applicable,success,deferred-inference
+// options: -Xdebug:verboseResolution=applicable,success,deferred-inference
 
 class DeferredMethodInst {
 
--- a/langtools/test/tools/javac/diags/examples/LambdaStat.java	Fri Jul 08 09:28:52 2016 -0700
+++ b/langtools/test/tools/javac/diags/examples/LambdaStat.java	Fri Jul 08 16:47:13 2016 -0700
@@ -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.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,7 @@
  */
 
 // key: compiler.note.lambda.stat
-// options: -XDdumpLambdaToMethodStats
+// options: -Xdebug:dumpLambdaToMethodStats
 
 class LambdaStat {
     Runnable r = ()->{};
--- a/langtools/test/tools/javac/diags/examples/MrefStat.java	Fri Jul 08 09:28:52 2016 -0700
+++ b/langtools/test/tools/javac/diags/examples/MrefStat.java	Fri Jul 08 16:47:13 2016 -0700
@@ -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.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,7 @@
  */
 
 // key: compiler.note.mref.stat
-// options: -XDdumpLambdaToMethodStats
+// options: -Xdebug:dumpLambdaToMethodStats
 
 class MrefStat {
     Runnable r = MrefStat::m;
--- a/langtools/test/tools/javac/diags/examples/MrefStat1.java	Fri Jul 08 09:28:52 2016 -0700
+++ b/langtools/test/tools/javac/diags/examples/MrefStat1.java	Fri Jul 08 16:47:13 2016 -0700
@@ -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.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,7 @@
  */
 
 // key: compiler.note.mref.stat.1
-// options: -XDdumpLambdaToMethodStats
+// options: -Xdebug:dumpLambdaToMethodStats
 
 class MrefStat1 {
 
--- a/langtools/test/tools/javac/diags/examples/NotApplicableMethodFound.java	Fri Jul 08 09:28:52 2016 -0700
+++ b/langtools/test/tools/javac/diags/examples/NotApplicableMethodFound.java	Fri Jul 08 16:47:13 2016 -0700
@@ -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.
  *
  * 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.misc.no.conforming.assignment.exists
 // key: compiler.misc.inconvertible.types
-// options: -XDverboseResolution=inapplicable,failure
+// options: -Xdebug:verboseResolution=inapplicable,failure
 
 class NotApplicableMethodFound {
 
--- a/langtools/test/tools/javac/diags/examples/PartialInstSig.java	Fri Jul 08 09:28:52 2016 -0700
+++ b/langtools/test/tools/javac/diags/examples/PartialInstSig.java	Fri Jul 08 16:47:13 2016 -0700
@@ -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.
  *
  * 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.note.verbose.resolve.multi
 // key: compiler.misc.partial.inst.sig
-// options: -XDverboseResolution=applicable,success
+// options: -Xdebug:verboseResolution=applicable,success
 
 class PartialInstSig {
 
--- a/langtools/test/tools/javac/diags/examples/VerboseResolveMulti.java	Fri Jul 08 09:28:52 2016 -0700
+++ b/langtools/test/tools/javac/diags/examples/VerboseResolveMulti.java	Fri Jul 08 16:47:13 2016 -0700
@@ -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.
  *
  * 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.note.verbose.resolve.multi
-// options: -XDverboseResolution=applicable,success
+// options: -Xdebug:verboseResolution=applicable,success
 
 class VerboseResolveMulti {
 
--- a/langtools/test/tools/javac/diags/examples/VerboseResolveMulti1.java	Fri Jul 08 09:28:52 2016 -0700
+++ b/langtools/test/tools/javac/diags/examples/VerboseResolveMulti1.java	Fri Jul 08 16:47:13 2016 -0700
@@ -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.
  *
  * 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.misc.no.conforming.assignment.exists
 // key: compiler.misc.inconvertible.types
-// options: -XDverboseResolution=inapplicable,failure
+// options: -Xdebug:verboseResolution=inapplicable,failure
 
 class VerboseResolveMulti1 {
 
--- a/langtools/test/tools/javac/generics/inference/8158355/T8158355.java	Fri Jul 08 09:28:52 2016 -0700
+++ b/langtools/test/tools/javac/generics/inference/8158355/T8158355.java	Fri Jul 08 16:47:13 2016 -0700
@@ -27,7 +27,7 @@
  * @test
  * @bug 8158355
  * @summary Inference graph dot support broken
- * @compile -XDdumpInferenceGraphsTo=. T8158355.java
+ * @compile -Xdebug:dumpInferenceGraphsTo=. T8158355.java
  */
 import java.util.List;
 
--- a/langtools/test/tools/javac/lambda/MostSpecific09.java	Fri Jul 08 09:28:52 2016 -0700
+++ b/langtools/test/tools/javac/lambda/MostSpecific09.java	Fri Jul 08 16:47:13 2016 -0700
@@ -2,7 +2,7 @@
  * @test /nodynamiccopyright/
  * @bug 8029718
  * @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 {
--- a/langtools/test/tools/javac/lambda/MostSpecific09.out	Fri Jul 08 09:28:52 2016 -0700
+++ b/langtools/test/tools/javac/lambda/MostSpecific09.out	Fri Jul 08 16:47:13 2016 -0700
@@ -3,7 +3,7 @@
 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: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: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)}
@@ -11,7 +11,7 @@
 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: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: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)}
--- a/langtools/test/tools/javac/lambda/TestLambdaToMethodStats.java	Fri Jul 08 09:28:52 2016 -0700
+++ b/langtools/test/tools/javac/lambda/TestLambdaToMethodStats.java	Fri Jul 08 16:47:13 2016 -0700
@@ -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.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -122,7 +122,7 @@
     @Override
     public void doWork() throws IOException {
         check(newCompilationTask()
-                .withOption("-XDdumpLambdaToMethodStats")
+                .withOption("-Xdebug:dumpLambdaToMethodStats")
                 .withSourceFromTemplate(template)
                 .generate());
     }
--- a/langtools/test/tools/javac/lambda/XDdumpLambdaToMethodStats.java	Fri Jul 08 09:28:52 2016 -0700
+++ b/langtools/test/tools/javac/lambda/XDdumpLambdaToMethodStats.java	Fri Jul 08 16:47:13 2016 -0700
@@ -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.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
  * @test
  * @bug 8143217
  * @summary javac throws NPE when printing diagnostics for Lambda expressions
- * @compile XDdumpLambdaToMethodStats.java -XDdumpLambdaToMethodStats
+ * @compile XDdumpLambdaToMethodStats.java -Xdebug:dumpLambdaToMethodStats
  *
  */
 
--- a/langtools/test/tools/javac/lambda/bridge/TestMetafactoryBridges.java	Fri Jul 08 09:28:52 2016 -0700
+++ b/langtools/test/tools/javac/lambda/bridge/TestMetafactoryBridges.java	Fri Jul 08 16:47:13 2016 -0700
@@ -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.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -274,7 +274,7 @@
             sourcefiles.add(new JavaSource(ck));
         }
         JavacTask ct = (JavacTask)tool.getTask(debugWriter, null, diagChecker,
-                    Arrays.asList("-XDdumpLambdaToMethodStats", "-d", outDir.getAbsolutePath(),
+                    Arrays.asList("-Xdebug:dumpLambdaToMethodStats", "-d", outDir.getAbsolutePath(),
                                   "-sourcepath", srcDir.getAbsolutePath(),
                                   "-classpath", classesDir.getAbsolutePath(),
                                   pp.preferOpt), null, sourcefiles);
--- a/langtools/test/tools/javac/lambda/mostSpecific/StructuralMostSpecificTest.java	Fri Jul 08 09:28:52 2016 -0700
+++ b/langtools/test/tools/javac/lambda/mostSpecific/StructuralMostSpecificTest.java	Fri Jul 08 16:47:13 2016 -0700
@@ -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.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -210,7 +210,7 @@
     public void doWork() throws Throwable {
         check(newCompilationTask()
                 .withSourceFromTemplate(sourceTemplate)
-                .withOption("-XDverboseResolution=all,-predef,-internal,-object-init")
+                .withOption("-Xdebug:verboseResolution=all,-predef,-internal,-object-init")
                 .analyze());
     }
 
--- a/langtools/test/tools/javac/resolve/ResolveHarness.java	Fri Jul 08 09:28:52 2016 -0700
+++ b/langtools/test/tools/javac/resolve/ResolveHarness.java	Fri Jul 08 16:47:13 2016 -0700
@@ -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.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -133,7 +133,7 @@
     protected void check() throws Exception {
         String[] options = {
             "-XDshouldStopPolicy=ATTR",
-            "-XDverboseResolution=success,failure,applicable,inapplicable,deferred-inference,predef"
+            "-Xdebug:verboseResolution=success,failure,applicable,inapplicable,deferred-inference,predef"
         };
 
         AbstractProcessor[] processors = { new ResolveCandidateFinder(), null };
--- a/langtools/test/tools/sjavac/JavacOptionPrep.java	Fri Jul 08 09:28:52 2016 -0700
+++ b/langtools/test/tools/sjavac/JavacOptionPrep.java	Fri Jul 08 16:47:13 2016 -0700
@@ -96,7 +96,7 @@
 
             // Ignore this option for now. When the file=... requirement goes
             // away, this will be easier to handle.
-            if (option.startsWith("-XDcompletionDeps"))
+            if (option.startsWith("-Xdebug:completionDeps"))
                 continue;
 
             switch (option) {