diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Arguments.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Arguments.java index 240e6ad2a54..2af50832f96 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Arguments.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/main/Arguments.java @@ -62,10 +62,12 @@ import com.sun.tools.javac.main.OptionHelper.GrumpyHelper; import com.sun.tools.javac.platform.PlatformDescription; import com.sun.tools.javac.platform.PlatformUtils; import com.sun.tools.javac.resources.CompilerProperties.Errors; +import com.sun.tools.javac.resources.CompilerProperties.Fragments; import com.sun.tools.javac.resources.CompilerProperties.Warnings; import com.sun.tools.javac.util.Context; import com.sun.tools.javac.util.JCDiagnostic; import com.sun.tools.javac.util.JCDiagnostic.DiagnosticInfo; +import com.sun.tools.javac.util.JCDiagnostic.Fragment; import com.sun.tools.javac.util.List; import com.sun.tools.javac.util.ListBuffer; import com.sun.tools.javac.util.Log; @@ -521,9 +523,9 @@ public class Arguments { if (target.compareTo(source.requiredTarget()) < 0) { if (targetString != null) { if (sourceString == null) { - reportDiag(Warnings.TargetDefaultSourceConflict(targetString, source.requiredTarget())); + reportDiag(Errors.TargetDefaultSourceConflict(source.name, targetString)); } else { - reportDiag(Warnings.SourceTargetConflict(sourceString, source.requiredTarget())); + reportDiag(Errors.SourceTargetConflict(sourceString, targetString)); } return false; } else { @@ -569,10 +571,10 @@ public class Arguments { if (fm instanceof BaseFileManager baseFileManager) { if (source.compareTo(Source.JDK8) <= 0) { if (baseFileManager.isDefaultBootClassPath()) - log.warning(LintCategory.OPTIONS, Warnings.SourceNoBootclasspath(source.name)); + log.warning(LintCategory.OPTIONS, Warnings.SourceNoBootclasspath(source.name, releaseNote(source, targetString))); } else { if (baseFileManager.isDefaultSystemModulesPath()) - log.warning(LintCategory.OPTIONS, Warnings.SourceNoSystemModulesPath(source.name)); + log.warning(LintCategory.OPTIONS, Warnings.SourceNoSystemModulesPath(source.name, releaseNote(source, targetString))); } } } @@ -640,6 +642,22 @@ public class Arguments { return !errors && (log.nerrors == 0); } + private Fragment releaseNote(Source source, String targetString) { + if (source.compareTo(Source.JDK8) <= 0) { + if (targetString != null) { + return Fragments.SourceNoBootclasspathWithTarget(source.name, targetString); + } else { + return Fragments.SourceNoBootclasspath(source.name); + } + } else { + if (targetString != null) { + return Fragments.SourceNoSystemModulesPathWithTarget(source.name, targetString); + } else { + return Fragments.SourceNoSystemModulesPath(source.name); + } + } + } + private void validateAddExports(SourceVersion sv) { String addExports = options.get(Option.ADD_EXPORTS); if (addExports != null) { diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties b/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties index 57e31441632..30756ef6fa6 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties @@ -2119,13 +2119,33 @@ compiler.warn.static.not.qualified.by.type=\ compiler.warn.static.not.qualified.by.type2=\ static {0} should not be used as a member of an anonymous class -# 0: string +# 0: string, 1: fragment compiler.warn.source.no.bootclasspath=\ - bootstrap class path not set in conjunction with -source {0} + bootstrap class path is not set in conjunction with -source {0}\n{1} + +# 0: string, 1: fragment +compiler.warn.source.no.system.modules.path=\ + location of system modules is not set in conjunction with -source {0}\n{1} # 0: string -compiler.warn.source.no.system.modules.path=\ - system modules path not set in conjunction with -source {0} +compiler.misc.source.no.bootclasspath=\ + not setting the bootstrap class path may lead to class files that cannot run on JDK {0}\n\ + --release {0} is recommended instead of -source {0} because it sets the bootstrap class path automatically + +# 0: string +compiler.misc.source.no.system.modules.path=\ + not setting the location of system modules may lead to class files that cannot run on JDK {0}\n\ + --release {0} is recommended instead of -source {0} because it sets the location of system modules automatically + +# 0: string, 1: string +compiler.misc.source.no.bootclasspath.with.target=\ + not setting the bootstrap class path may lead to class files that cannot run on JDK 8\n\ + --release {0} is recommended instead of -source {0} -target {1} because it sets the bootstrap class path automatically + +# 0: string, 1: string +compiler.misc.source.no.system.modules.path.with.target=\ + not setting the location of system modules may lead to class files that cannot run on JDK {0}\n\ + --release {0} is recommended instead of -source {0} -target {1} because it sets the location of system modules automatically # 0: string compiler.warn.option.obsolete.source=\ @@ -3972,13 +3992,15 @@ compiler.err.error.writing.file=\ compiler.err.sourcepath.modulesourcepath.conflict=\ cannot specify both --source-path and --module-source-path -# 0: string, 1: target -compiler.warn.source.target.conflict=\ - source release {0} requires target release {1} +# 0: string, 1: string +compiler.err.source.target.conflict=\ + specified target release {1} is too old for the specified source release {0}\n\ + --release {1} is recommended when compiling code to run on JDK {1} -# 0: string, 1: target -compiler.warn.target.default.source.conflict=\ - target release {0} conflicts with default source release {1} +# 0: string, 1: string +compiler.err.target.default.source.conflict=\ + specified target release {1} is too old for the default source release {0}\n\ + --release {1} is recommended when compiling code to run on JDK {1} # 0: profile, 1: target compiler.warn.profile.target.conflict=\ diff --git a/test/langtools/tools/javac/T8222035/MinContextOpTest_A.out b/test/langtools/tools/javac/T8222035/MinContextOpTest_A.out index 2321b85909d..f5b2d806c47 100644 --- a/test/langtools/tools/javac/T8222035/MinContextOpTest_A.out +++ b/test/langtools/tools/javac/T8222035/MinContextOpTest_A.out @@ -1,4 +1,4 @@ -- compiler.warn.source.no.system.modules.path: 15 +- compiler.warn.source.no.system.modules.path: 15, (compiler.misc.source.no.system.modules.path: 15) MinContextOpTest.java:16:25: compiler.err.mod.not.allowed.here: static MinContextOpTest.java:22:25: compiler.err.mod.not.allowed.here: static MinContextOpTest.java:28:34: compiler.err.prob.found.req: (compiler.misc.infer.no.conforming.assignment.exists: T,K,V,E, (compiler.misc.inconvertible.types: java.util.function.Function<MinContextOpTest.A.T,MinContextOpTest.A.T>, java.util.function.Function<? super MinContextOpTest.A.T,? extends MinContextOpTest.A.T<?>>)) diff --git a/test/langtools/tools/javac/diags/examples.not-yet.txt b/test/langtools/tools/javac/diags/examples.not-yet.txt index 9d7d79eca16..a9ba23fa374 100644 --- a/test/langtools/tools/javac/diags/examples.not-yet.txt +++ b/test/langtools/tools/javac/diags/examples.not-yet.txt @@ -206,8 +206,8 @@ compiler.err.two.class.loaders.2 compiler.err.unmatched.quote compiler.err.unsupported.release.version compiler.warn.profile.target.conflict -compiler.warn.source.target.conflict -compiler.warn.target.default.source.conflict +compiler.err.source.target.conflict +compiler.err.target.default.source.conflict compiler.err.preview.not.latest compiler.err.preview.without.source.or.release compiler.misc.illegal.signature # the compiler can now detect more non-denotable types before class writing diff --git a/test/langtools/tools/javac/diags/examples/EnumsMustBeStatic.java b/test/langtools/tools/javac/diags/examples/EnumsMustBeStatic.java index 222f2eb2903..6b9283827d4 100644 --- a/test/langtools/tools/javac/diags/examples/EnumsMustBeStatic.java +++ b/test/langtools/tools/javac/diags/examples/EnumsMustBeStatic.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2023, 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,8 +22,7 @@ */ // key: compiler.err.static.declaration.not.allowed.in.inner.classes -// key: compiler.warn.source.no.system.modules.path -// options: -source 15 +// options: --release 15 class EnumsMustBeStatic { class Nested { diff --git a/test/langtools/tools/javac/diags/examples/Expected3.java b/test/langtools/tools/javac/diags/examples/Expected3.java index 2b1ec325618..1a527034ff3 100644 --- a/test/langtools/tools/javac/diags/examples/Expected3.java +++ b/test/langtools/tools/javac/diags/examples/Expected3.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2023, 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,6 @@ */ // key: compiler.err.expected3 -// key: compiler.warn.source.no.system.modules.path -// options: -source 15 +// options: --release 15 int Expected3; diff --git a/test/langtools/tools/javac/diags/examples/InnerClassCantHaveStatic.java b/test/langtools/tools/javac/diags/examples/InnerClassCantHaveStatic.java index b1eaad961db..abe95b8a23d 100644 --- a/test/langtools/tools/javac/diags/examples/InnerClassCantHaveStatic.java +++ b/test/langtools/tools/javac/diags/examples/InnerClassCantHaveStatic.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2023, 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,8 +22,7 @@ */ // key: compiler.err.icls.cant.have.static.decl -// key: compiler.warn.source.no.system.modules.path -// options: -source 15 +// options: --release 15 class InnerClassCantHaveStatic { class Inner { diff --git a/test/langtools/tools/javac/diags/examples/InterfaceNotAllowed.java b/test/langtools/tools/javac/diags/examples/InterfaceNotAllowed.java index a72e7ef12bd..3c5d5602aa4 100644 --- a/test/langtools/tools/javac/diags/examples/InterfaceNotAllowed.java +++ b/test/langtools/tools/javac/diags/examples/InterfaceNotAllowed.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2023, 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,8 +22,7 @@ */ // key: compiler.err.intf.not.allowed.here -// key: compiler.warn.source.no.system.modules.path -// options: -source 15 +// options: --release 15 class InterfaceNotAllowed { void m() { diff --git a/test/langtools/tools/javac/diags/examples/LocalEnum.java b/test/langtools/tools/javac/diags/examples/LocalEnum.java index fdf875c9697..a7cc2b6dc0b 100644 --- a/test/langtools/tools/javac/diags/examples/LocalEnum.java +++ b/test/langtools/tools/javac/diags/examples/LocalEnum.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2023, 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,8 +22,7 @@ */ // key: compiler.err.local.enum -// key: compiler.warn.source.no.system.modules.path -// options: -source 15 +// options: --release 15 class LocalEnum { void m() { diff --git a/test/langtools/tools/javac/diags/examples/ObsoleteSourceAndTarget.java b/test/langtools/tools/javac/diags/examples/ObsoleteSourceAndTarget.java index 5cf52f2d76a..d4a94f032b0 100644 --- a/test/langtools/tools/javac/diags/examples/ObsoleteSourceAndTarget.java +++ b/test/langtools/tools/javac/diags/examples/ObsoleteSourceAndTarget.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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,6 +25,7 @@ // key: compiler.warn.option.obsolete.target // key: compiler.warn.option.obsolete.suppression // key: compiler.warn.source.no.bootclasspath +// key: compiler.misc.source.no.bootclasspath.with.target // options: -source 1.8 -target 1.8 class ObsoleteSourceAndTarget { diff --git a/test/langtools/tools/javac/diags/examples/OptionRemovedSource.java b/test/langtools/tools/javac/diags/examples/OptionRemovedSource.java index fadc5142f0c..f40ea3225e9 100644 --- a/test/langtools/tools/javac/diags/examples/OptionRemovedSource.java +++ b/test/langtools/tools/javac/diags/examples/OptionRemovedSource.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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,6 +23,7 @@ // key: compiler.err.option.removed.source // key: compiler.warn.source.no.bootclasspath +// key: compiler.misc.source.no.bootclasspath // options: -source 1.5 class RemovedSourceAndTarget { diff --git a/test/langtools/tools/javac/diags/examples/OptionRemovedTarget.java b/test/langtools/tools/javac/diags/examples/OptionRemovedTarget.java index 81f6d8e0ee0..e38994ec532 100644 --- a/test/langtools/tools/javac/diags/examples/OptionRemovedTarget.java +++ b/test/langtools/tools/javac/diags/examples/OptionRemovedTarget.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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,6 +24,7 @@ // key: compiler.err.option.removed.source // key: compiler.err.option.removed.target // key: compiler.warn.source.no.bootclasspath +// key: compiler.misc.source.no.bootclasspath.with.target // options: -source 1.5 -target 1.5 class RemovedSourceAndTarget { diff --git a/test/langtools/tools/javac/diags/examples/Records.java b/test/langtools/tools/javac/diags/examples/Records.java index 9acc44d0f43..f356ceed599 100644 --- a/test/langtools/tools/javac/diags/examples/Records.java +++ b/test/langtools/tools/javac/diags/examples/Records.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, 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,6 @@ // key: compiler.misc.feature.records // key: compiler.err.feature.not.supported.in.source.plural -// key: compiler.warn.source.no.system.modules.path -// options: -source 15 +// options: --release 15 record R() {} diff --git a/test/langtools/tools/javac/diags/examples/SealedTypes.java b/test/langtools/tools/javac/diags/examples/SealedTypes.java index 85aca18b2af..4bd55525554 100644 --- a/test/langtools/tools/javac/diags/examples/SealedTypes.java +++ b/test/langtools/tools/javac/diags/examples/SealedTypes.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, 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,8 +23,7 @@ // key: compiler.misc.feature.sealed.classes // key: compiler.err.feature.not.supported.in.source.plural -// key: compiler.warn.source.no.system.modules.path -// options: -source 16 +// options: --release 16 sealed class Sealed {} diff --git a/test/langtools/tools/javac/diags/examples/SourceNoBootclasspath.java b/test/langtools/tools/javac/diags/examples/SourceNoBootclasspath.java index 2c30b9e1a33..5f02a437dbe 100644 --- a/test/langtools/tools/javac/diags/examples/SourceNoBootclasspath.java +++ b/test/langtools/tools/javac/diags/examples/SourceNoBootclasspath.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2023, 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,6 +22,7 @@ */ // key: compiler.warn.source.no.bootclasspath +// key: compiler.misc.source.no.bootclasspath // key: compiler.warn.option.obsolete.source // key: compiler.warn.option.obsolete.suppression // options: -source 8 diff --git a/test/langtools/tools/javac/diags/examples/SourceNoSystemModulesPath.java b/test/langtools/tools/javac/diags/examples/SourceNoSystemModulesPath.java index 915d5600a6f..5967a9b6571 100644 --- a/test/langtools/tools/javac/diags/examples/SourceNoSystemModulesPath.java +++ b/test/langtools/tools/javac/diags/examples/SourceNoSystemModulesPath.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, 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,6 +22,7 @@ */ // key: compiler.warn.source.no.system.modules.path +// key: compiler.misc.source.no.system.modules.path // options: -source 9 class SourceNoSystemModulesPath { } diff --git a/test/langtools/tools/javac/diags/examples/SourceNoSystemModulesPathWithTarget.java b/test/langtools/tools/javac/diags/examples/SourceNoSystemModulesPathWithTarget.java new file mode 100644 index 00000000000..6132c44db68 --- /dev/null +++ b/test/langtools/tools/javac/diags/examples/SourceNoSystemModulesPathWithTarget.java @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2023, 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. + */ + +// key: compiler.warn.source.no.system.modules.path +// key: compiler.misc.source.no.system.modules.path.with.target +// options: -source 9 -target 9 + +class SourceNoSystemModulesPath { } diff --git a/test/langtools/tools/javac/diags/examples/TextBlockSource.java b/test/langtools/tools/javac/diags/examples/TextBlockSource.java index f805491cd42..9fa6ecca1b8 100644 --- a/test/langtools/tools/javac/diags/examples/TextBlockSource.java +++ b/test/langtools/tools/javac/diags/examples/TextBlockSource.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, 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,8 +23,7 @@ // key: compiler.misc.feature.text.blocks // key: compiler.err.feature.not.supported.in.source.plural - // key: compiler.warn.source.no.system.modules.path - // options: -source 14 + // options: --release 14 class TextBlockSource { String m() { diff --git a/test/langtools/tools/javac/diags/examples/UnderscoreInLambdaExpression.java b/test/langtools/tools/javac/diags/examples/UnderscoreInLambdaExpression.java index dd68a2c2128..d88aa9bc127 100644 --- a/test/langtools/tools/javac/diags/examples/UnderscoreInLambdaExpression.java +++ b/test/langtools/tools/javac/diags/examples/UnderscoreInLambdaExpression.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2023, 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,8 +23,7 @@ // key: compiler.err.feature.not.supported.in.source.plural // key: compiler.misc.feature.unnamed.variables -// key: compiler.warn.source.no.system.modules.path -// options: -source 21 +// options: --release 21 public class UnderscoreInLambdaExpression { java.util.function.Function<String,String> f = _ -> "x"; diff --git a/test/langtools/tools/javac/options/BCPOrSystemNotSpecified.java b/test/langtools/tools/javac/options/BCPOrSystemNotSpecified.java index a4dea63ca36..bfe1d9d11fd 100644 --- a/test/langtools/tools/javac/options/BCPOrSystemNotSpecified.java +++ b/test/langtools/tools/javac/options/BCPOrSystemNotSpecified.java @@ -78,7 +78,7 @@ public class BCPOrSystemNotSpecified extends TestRunner { List<String> log; List<String> expected = Arrays.asList( - "- compiler.warn.source.no.bootclasspath: 8", + "- compiler.warn.source.no.bootclasspath: 8, (compiler.misc.source.no.bootclasspath: 8)", "- compiler.warn.option.obsolete.source: 8", "- compiler.warn.option.obsolete.suppression", "3 warnings" @@ -125,7 +125,7 @@ public class BCPOrSystemNotSpecified extends TestRunner { List<String> log; List<String> expected = Arrays.asList( - "- compiler.warn.source.no.system.modules.path: 9", + "- compiler.warn.source.no.system.modules.path: 9, (compiler.misc.source.no.system.modules.path: 9)", "1 warning" ); diff --git a/test/langtools/tools/javac/options/T6900037.out b/test/langtools/tools/javac/options/T6900037.out index dd5352edc7c..3e610c371c9 100644 --- a/test/langtools/tools/javac/options/T6900037.out +++ b/test/langtools/tools/javac/options/T6900037.out @@ -1,4 +1,4 @@ -- compiler.warn.source.no.bootclasspath: 8 +- compiler.warn.source.no.bootclasspath: 8, (compiler.misc.source.no.bootclasspath: 8) - compiler.warn.option.obsolete.source: 8 - compiler.warn.option.obsolete.suppression - compiler.err.warnings.and.werror diff --git a/test/langtools/tools/javac/options/smokeTests/OptionSmokeTest.java b/test/langtools/tools/javac/options/smokeTests/OptionSmokeTest.java index f128bf14f7f..0fae2fab1f0 100644 --- a/test/langtools/tools/javac/options/smokeTests/OptionSmokeTest.java +++ b/test/langtools/tools/javac/options/smokeTests/OptionSmokeTest.java @@ -139,13 +139,13 @@ public class OptionSmokeTest extends TestRunner { @Test public void sourceAndTargetMismatch(Path base) throws Exception { - doTest(base, String.format("warning: source release %s requires target release %s", Source.DEFAULT.name, Source.DEFAULT.name), + doTest(base, String.format("error: specified target release %s is too old for the specified source release %s", Source.MIN.name, Source.DEFAULT.name), String.format("-source %s -target %s", Source.DEFAULT.name, Source.MIN.name)); } @Test public void targetConflictsWithDefaultSource(Path base) throws Exception { - doTest(base, String.format("warning: target release %s conflicts with default source release %s", Source.MIN.name, Source.DEFAULT.name), + doTest(base, String.format("error: specified target release %s is too old for the default source release %s", Source.MIN.name, Source.DEFAULT.name), String.format("-target %s", Source.MIN.name)); } diff --git a/test/langtools/tools/javac/var_implicit_lambda/VarInImplicitLambdaNegTest01_source10.out b/test/langtools/tools/javac/var_implicit_lambda/VarInImplicitLambdaNegTest01_source10.out index f424f013a95..a7c5bae106b 100644 --- a/test/langtools/tools/javac/var_implicit_lambda/VarInImplicitLambdaNegTest01_source10.out +++ b/test/langtools/tools/javac/var_implicit_lambda/VarInImplicitLambdaNegTest01_source10.out @@ -1,4 +1,4 @@ -- compiler.warn.source.no.system.modules.path: 10 +- compiler.warn.source.no.system.modules.path: 10, (compiler.misc.source.no.system.modules.path: 10) VarInImplicitLambdaNegTest01.java:12:36: compiler.err.feature.not.supported.in.source.plural: (compiler.misc.feature.var.syntax.in.implicit.lambda), 10, 11 VarInImplicitLambdaNegTest01.java:15:28: compiler.err.invalid.lambda.parameter.declaration: (compiler.misc.implicit.and.explicit.not.allowed) VarInImplicitLambdaNegTest01.java:17:52: compiler.err.restricted.type.not.allowed.here: var