8160891: javac, remove unused options, step 3
authorvromero
Wed, 06 Jul 2016 09:42:27 -0700
changeset 39587 76c453568ffa
parent 39586 e35b6ab55e00
child 39588 a30039aaca6c
8160891: javac, remove unused options, step 3 Reviewed-by: mcimadamore
langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java
langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java
langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/JavaCompiler.java
langtools/src/jdk.jshell/share/classes/jdk/jshell/SourceCodeAnalysisImpl.java
langtools/test/tools/javac/MethodParametersTest.java
langtools/test/tools/javac/annotations/typeAnnotations/8047024/T8047024.java
langtools/test/tools/javac/classfiles/attributes/LocalVariableTable/T8136453/T8136453.java
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java	Tue Jul 05 13:30:40 2016 -0700
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java	Wed Jul 06 09:42:27 2016 -0700
@@ -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.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -106,9 +106,6 @@
     /** dump statistics about lambda code generation */
     private boolean dumpLambdaToMethodStats;
 
-    /** force serializable representation, for stress testing **/
-    private final boolean forceSerializable;
-
     /** Flag for alternate metafactories indicating the lambda object is intended to be serializable */
     public static final int FLAG_SERIALIZABLE = 1 << 0;
 
@@ -144,7 +141,6 @@
         Options options = Options.instance(context);
         dumpLambdaToMethodStats = options.isSet("dumpLambdaToMethodStats");
         attr = Attr.instance(context);
-        forceSerializable = options.isSet("forceSerializable");
     }
     // </editor-fold>
 
@@ -1829,9 +1825,6 @@
 
             /** does this functional expression require serialization support? */
             boolean isSerializable() {
-                if (forceSerializable) {
-                    return true;
-                }
                 for (Type target : tree.targets) {
                     if (types.asSuper(target, syms.serializableType.tsym) != null) {
                         return true;
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java	Tue Jul 05 13:30:40 2016 -0700
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java	Wed Jul 06 09:42:27 2016 -0700
@@ -242,7 +242,7 @@
         allowSimplifiedVarargs = source.allowSimplifiedVarargs();
         allowModules     = source.allowModules();
 
-        saveParameterNames = options.isSet("save-parameter-names");
+        saveParameterNames = options.isSet(PARAMETERS);
 
         profile = Profile.instance(context);
 
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/JavaCompiler.java	Tue Jul 05 13:30:40 2016 -0700
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/JavaCompiler.java	Wed Jul 06 09:42:27 2016 -0700
@@ -1108,7 +1108,7 @@
             processAnnotations = procEnvImpl.atLeastOneProcessor();
 
             if (processAnnotations) {
-                options.put("save-parameter-names", "save-parameter-names");
+                options.put("parameters", "parameters");
                 reader.saveParameterNames = true;
                 keepComments = true;
                 genEndPos = true;
--- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/SourceCodeAnalysisImpl.java	Tue Jul 05 13:30:40 2016 -0700
+++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/SourceCodeAnalysisImpl.java	Wed Jul 06 09:42:27 2016 -0700
@@ -996,7 +996,7 @@
     //tweaked by tests to disable reading parameter names from classfiles so that tests using
     //JDK's classes are stable for both release and fastdebug builds:
     private final String[] keepParameterNames = new String[] {
-        "-XDsave-parameter-names=true"
+        "-parameters"
     };
 
     private String documentationImpl(String code, int cursor) {
--- a/langtools/test/tools/javac/MethodParametersTest.java	Tue Jul 05 13:30:40 2016 -0700
+++ b/langtools/test/tools/javac/MethodParametersTest.java	Wed Jul 06 09:42:27 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
@@ -116,7 +116,7 @@
     void inspectBaz() throws Exception {
         final File Qux_java =
             writeFile(classesdir, Qux_name + ".java", Qux_contents);
-        final String[] args = { "-XDsave-parameter-names", "-d",
+        final String[] args = { "-parameters", "-d",
                                 classesdir.getPath(),
                                 "-cp", classesdir.getPath(),
                                 Qux_java.getPath() };
--- a/langtools/test/tools/javac/annotations/typeAnnotations/8047024/T8047024.java	Tue Jul 05 13:30:40 2016 -0700
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/8047024/T8047024.java	Wed Jul 06 09:42:27 2016 -0700
@@ -26,7 +26,7 @@
  * @bug 8047024
  * @summary AssertionError: exception_index already contains a bytecode offset
  * @compile T8047024_01.java
- * @compile -XDsave-parameter-names=true T8047024.java
+ * @compile -parameters T8047024.java
  */
 
 public class T8047024 {
--- a/langtools/test/tools/javac/classfiles/attributes/LocalVariableTable/T8136453/T8136453.java	Tue Jul 05 13:30:40 2016 -0700
+++ b/langtools/test/tools/javac/classfiles/attributes/LocalVariableTable/T8136453/T8136453.java	Wed Jul 06 09:42:27 2016 -0700
@@ -50,7 +50,7 @@
 
     void run() {
         JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
-        List<String> opts = Arrays.asList("-XDsave-parameter-names");
+        List<String> opts = Arrays.asList("-parameters");
         JavacTask task = (JavacTask) compiler.getTask(null, null, null, opts, null, null);
         TypeElement t = task.getElements().getTypeElement("T");
         ExecutableElement testMethod = ElementFilter.methodsIn(t.getEnclosedElements()).get(0);