--- old/test/langtools/tools/javac/processing/model/TestSourceVersion.java 2019-10-29 09:54:15.277056000 -0700 +++ new/test/langtools/tools/javac/processing/model/TestSourceVersion.java 2019-10-29 09:54:15.040937999 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2019, 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 @@ /* * @test - * @bug 7025809 8028543 6415644 8028544 8029942 8187951 8193291 8196551 + * @bug 7025809 8028543 6415644 8028544 8029942 8187951 8193291 8196551 8233096 * @summary Test latest, latestSupported, underscore as keyword, etc. * @author Joseph D. Darcy * @modules java.compiler @@ -35,7 +35,7 @@ import static javax.lang.model.SourceVersion.*; /** - * Verify latest[Supported] behavior. + * Verify latest[Supported] behavior and other methods. */ public class TestSourceVersion { public static void main(String... args) { @@ -43,6 +43,7 @@ testVersionVaryingKeywords(); testRestrictedKeywords(); testVar(); + testYield(); } private static void testLatestSupported() { @@ -107,7 +108,6 @@ } private static void testVar() { - for(SourceVersion version : SourceVersion.values()) { check(false, isKeyword("var", version), "keyword", version); check(false, isKeyword("foo.var", version), "keyword", version); @@ -119,6 +119,18 @@ } } + private static void testYield() { + for(SourceVersion version : SourceVersion.values()) { + check(false, isKeyword("yield", version), "keyword", version); + check(false, isKeyword("foo.yield", version), "keyword", version); + check(false, isKeyword("yield.foo", version), "keyword", version); + + check(true, isName("yield", version), "name", version); + check(true, isName("foo.yield", version), "name", version); + check(true, isName("yield.foo", version), "name", version); + } + } + private static void check(boolean result, boolean expected, String message, SourceVersion version) { if (result != expected) {