--- old/test/com/sun/javadoc/5093723/T5093723.java 2014-03-05 11:36:02.000000000 -0800 +++ new/test/com/sun/javadoc/5093723/T5093723.java 2014-03-05 11:36:02.000000000 -0800 @@ -36,7 +36,7 @@ private static final String BUG_ID = "5093723"; private static final String[] ARGS = new String[] { - "-d", BUG_ID + ".out", "-source", "5", "-Xdoclint:none", + "-d", BUG_ID + ".out", "-Xdoclint:none", SRC_DIR + "/DocumentedClass.java", SRC_DIR + "/UndocumentedClass.java" }; --- old/test/com/sun/javadoc/testAnnotationOptional/TestAnnotationOptional.java 2014-03-05 11:36:02.000000000 -0800 +++ new/test/com/sun/javadoc/testAnnotationOptional/TestAnnotationOptional.java 2014-03-05 11:36:02.000000000 -0800 @@ -40,7 +40,7 @@ //Javadoc arguments. private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, "-source", "1.5", "pkg" + "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg" }; //Input for string search tests. --- old/test/com/sun/javadoc/testAnnotationTypes/TestAnnotationTypes.java 2014-03-05 11:36:03.000000000 -0800 +++ new/test/com/sun/javadoc/testAnnotationTypes/TestAnnotationTypes.java 2014-03-05 11:36:03.000000000 -0800 @@ -39,7 +39,7 @@ //Javadoc arguments. private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-sourcepath", SRC_DIR, "-source", "1.5", "pkg" + "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg" }; //Input for string search tests. --- old/test/com/sun/javadoc/testClassTree/TestClassTree.java 2014-03-05 11:36:03.000000000 -0800 +++ new/test/com/sun/javadoc/testClassTree/TestClassTree.java 2014-03-05 11:36:03.000000000 -0800 @@ -42,7 +42,7 @@ //Javadoc arguments. private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-source", "1.5","-sourcepath", SRC_DIR, "pkg" + "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg" }; //Input for string search tests. --- old/test/com/sun/javadoc/testDeprecatedDocs/TestDeprecatedDocs.java 2014-03-05 11:36:03.000000000 -0800 +++ new/test/com/sun/javadoc/testDeprecatedDocs/TestDeprecatedDocs.java 2014-03-05 11:36:03.000000000 -0800 @@ -38,7 +38,7 @@ //Javadoc arguments. private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-source", "1.5", "-sourcepath", SRC_DIR, "pkg" + "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg" }; private static final String TARGET_FILE = --- old/test/com/sun/javadoc/testHref/TestHref.java 2014-03-05 11:36:04.000000000 -0800 +++ new/test/com/sun/javadoc/testHref/TestHref.java 2014-03-05 11:36:04.000000000 -0800 @@ -38,7 +38,7 @@ //Javadoc arguments. private static final String[] ARGS = new String[] { - "-d", BUG_ID, "-source", "1.5", "-sourcepath", SRC_DIR, "-linkoffline", + "-d", BUG_ID, "-sourcepath", SRC_DIR, "-linkoffline", "http://java.sun.com/j2se/1.4/docs/api/", SRC_DIR, "pkg" }; --- old/test/com/sun/javadoc/testLambdaFeature/TestLambdaFeature.java 2014-03-05 11:36:04.000000000 -0800 +++ new/test/com/sun/javadoc/testLambdaFeature/TestLambdaFeature.java 2014-03-05 11:36:04.000000000 -0800 @@ -32,6 +32,12 @@ * @run main TestLambdaFeature */ +/* + * NOTE : This test should be elided when version 1.7 support is removed from the JDK + * or the negative part of the test showing 1.7's non-support should be + * removed [ 8022738 ] + */ + public class TestLambdaFeature extends JavadocTester { //Test information. @@ -43,7 +49,7 @@ }; private static final String[] ARGS_1 = new String[] { - "-d", BUG_ID + "-2", "-sourcepath", SRC_DIR, "-source", "1.5", "pkg1" + "-d", BUG_ID + "-2", "-sourcepath", SRC_DIR, "-source", "1.7", "pkg1" }; //Input for string search tests. --- old/test/com/sun/javadoc/testNestedGenerics/TestNestedGenerics.java 2014-03-05 11:36:05.000000000 -0800 +++ new/test/com/sun/javadoc/testNestedGenerics/TestNestedGenerics.java 2014-03-05 11:36:05.000000000 -0800 @@ -38,7 +38,7 @@ //Javadoc arguments. private static final String[] ARGS = new String[]{ - "-d", BUG_ID, "-source", "1.5", "-sourcepath", SRC_DIR, + "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg" }; --- old/test/com/sun/javadoc/testNewLanguageFeatures/TestNewLanguageFeatures.java 2014-03-05 11:36:05.000000000 -0800 +++ new/test/com/sun/javadoc/testNewLanguageFeatures/TestNewLanguageFeatures.java 2014-03-05 11:36:05.000000000 -0800 @@ -40,7 +40,7 @@ //Javadoc arguments. private static final String[] ARGS = new String[] { - "-Xdoclint:none", "-d", BUG_ID, "-use", "-source", "1.5", "-sourcepath", SRC_DIR, "pkg", "pkg1", "pkg2" + "-Xdoclint:none", "-d", BUG_ID, "-use", "-sourcepath", SRC_DIR, "pkg", "pkg1", "pkg2" }; //Input for string search tests. --- old/test/com/sun/javadoc/testPackageDeprecation/TestPackageDeprecation.java 2014-03-05 11:36:05.000000000 -0800 +++ new/test/com/sun/javadoc/testPackageDeprecation/TestPackageDeprecation.java 2014-03-05 11:36:05.000000000 -0800 @@ -38,11 +38,11 @@ //Javadoc arguments. private static final String[] ARGS1 = new String[]{ - "-d", BUG_ID + "-1", "-source", "1.5", "-sourcepath", SRC_DIR, "-use", "pkg", "pkg1", + "-d", BUG_ID + "-1", "-sourcepath", SRC_DIR, "-use", "pkg", "pkg1", SRC_DIR + FS + "C2.java", SRC_DIR + FS + "FooDepr.java" }; private static final String[] ARGS2 = new String[]{ - "-d", BUG_ID + "-2", "-source", "1.5", "-sourcepath", SRC_DIR, "-use", "-nodeprecated", + "-d", BUG_ID + "-2", "-sourcepath", SRC_DIR, "-use", "-nodeprecated", "pkg", "pkg1", SRC_DIR + FS + "C2.java", SRC_DIR + FS + "FooDepr.java" }; --- old/test/com/sun/javadoc/testPrivateClasses/TestPrivateClasses.java 2014-03-05 11:36:06.000000000 -0800 +++ new/test/com/sun/javadoc/testPrivateClasses/TestPrivateClasses.java 2014-03-05 11:36:06.000000000 -0800 @@ -49,11 +49,11 @@ //Javadoc arguments. private static final String[] ARGS1 = new String[] { - "-d", BUG_ID + "-1", "-sourcepath", SRC_DIR, "-source", "1.5", "pkg", "pkg2" + "-d", BUG_ID + "-1", "-sourcepath", SRC_DIR, "pkg", "pkg2" }; private static final String[] ARGS2 = new String[] { "-d", BUG_ID + "-2", "-sourcepath", SRC_DIR, "-private", - "-source", "1.5", "pkg", "pkg2" + "pkg", "pkg2" }; // Test output when -private flag is not used. --- old/test/com/sun/javadoc/testTypeParams/TestTypeParameters.java 2014-03-05 11:36:06.000000000 -0800 +++ new/test/com/sun/javadoc/testTypeParams/TestTypeParameters.java 2014-03-05 11:36:06.000000000 -0800 @@ -42,11 +42,11 @@ //Javadoc arguments. private static final String[] ARGS1 = new String[]{ - "-d", BUG_ID, "-use", "-source", "1.5", "-sourcepath", SRC_DIR, + "-d", BUG_ID, "-use", "-sourcepath", SRC_DIR, "pkg" }; private static final String[] ARGS2 = new String[]{ - "-d", BUG_ID, "-linksource", "-source", "1.5", "-sourcepath", SRC_DIR, + "-d", BUG_ID, "-linksource", "-sourcepath", SRC_DIR, "pkg" }; --- old/test/tools/javadoc/6964914/JavacWarning.java 2014-03-05 11:36:07.000000000 -0800 +++ new/test/tools/javadoc/6964914/JavacWarning.java 2014-03-05 11:36:07.000000000 -0800 @@ -22,5 +22,5 @@ */ public class JavacWarning { - int enum; // warning in source 1.4 + String _ = null; // this will cause a warning. It may be deprecated in JDK8 } --- old/test/tools/javadoc/6964914/Test.java 2014-03-05 11:36:07.000000000 -0800 +++ new/test/tools/javadoc/6964914/Test.java 2014-03-05 11:36:07.000000000 -0800 @@ -46,7 +46,6 @@ File testSrc = new File(System.getProperty("test.src")); String[] args = { "-Xdoclint:none", - "-source", "1.4", // enables certain Parser warnings "-bootclasspath", System.getProperty("sun.boot.class.path"), "-classpath", ".", "-package", --- old/test/tools/javadoc/LangVers.java 2014-03-05 11:36:07.000000000 -0800 +++ new/test/tools/javadoc/LangVers.java 2014-03-05 11:36:07.000000000 -0800 @@ -42,7 +42,7 @@ "javadoc", "LangVers", LangVers.class.getClassLoader(), - new String[] {"-source", "1.5", thisFile}) != 0) + new String[] {thisFile}) != 0) throw new Error("Javadoc encountered warnings or errors."); } --- old/test/tools/javadoc/sourceOption/SourceOption.java 2014-03-05 11:36:08.000000000 -0800 +++ new/test/tools/javadoc/sourceOption/SourceOption.java 2014-03-05 11:36:08.000000000 -0800 @@ -26,6 +26,31 @@ * @bug 6507179 * @summary Ensure that "-source" option isn't ignored. * @author Scott Seligman + * @run main/fail SourceOption 7 + * @run main SourceOption 9 + * @run main SourceOption + */ + +/* + * TEST NOTE + * With JDK9, this test has been transformed into a NEGATIVE test. + * + * Generally speaking, this test should check a feature not in at least + * one of the currently supported previous versions. In this manner, + * a failure of the -source option to be honored would mean a pass of + * the test, and therefore a failure of the -source option. + * + * For JDK9 and JDK10, both support 1.7, which did not support javac's + * lambda construct. So we set "-source 1.7" to compile a .java file + * containing the lambda construct. javac should fail, thus showing + * -source to be working. Thus the test passes. + * + * The second jtreg @run command checks to make sure that the source + * provided is valid for the current release of the JDK. + * + * fixVersion: JDK11 + * replace ./p/LambdaConstructTest.java with a missing from + * JDK8, JDK9, or JDK10. Set -source below appropriately. */ import com.sun.javadoc.*; @@ -33,12 +58,22 @@ public class SourceOption extends Doclet { public static void main(String[] args) { + String[] params; + if ((args == null) || (args.length==0)) { + params = new String[]{"p"}; + System.out.println("NOTE : -source not provided, default taken"); + } else { + params = new String[]{"-source", args[0], "p"}; + System.out.println("NOTE : -source will be: " + args[0]); + } + if (com.sun.tools.javadoc.Main.execute( "javadoc", "SourceOption", SourceOption.class.getClassLoader(), - new String[] {"-source", "1.3", "p"}) != 0) - throw new Error("Javadoc encountered warnings or errors."); + params) != 0) + throw new Error("Javadoc encountered warnings or errors."); + } public static boolean start(RootDoc root) { @@ -46,3 +81,4 @@ return true; } } + --- /dev/null 2014-03-05 05:52:19.953160210 -0800 +++ new/test/tools/javadoc/sourceOption/p/LambdaConstructTest.java 2014-03-05 11:36:08.000000000 -0800 @@ -0,0 +1,16 @@ + + +public class LambdaConstructTest { + public static void main(String[] args) { + + System.out.println("=== LambdaConstructTest ==="); + + // Lambda Runnable + Runnable lambda = () -> System.out.println("it's a Lambda world!"); + + // Run it! + lambda.run(); + + } +} + --- old/test/tools/javadoc/sourceOption/p/A.java 2014-03-05 11:36:09.000000000 -0800 +++ /dev/null 2014-03-05 05:52:19.953160210 -0800 @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2004, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package p; - -public class A { - boolean assert; // illegal since 1.4 - boolean enum; // illegal since 5 -}