aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Vicente Romero <vromero@openjdk.org> 2021-04-15 19:07:11 +0000
committerGravatar Vicente Romero <vromero@openjdk.org> 2021-04-15 19:07:11 +0000
commit0b1b5c8d0b2b69e06916d0fed09d181115c1d685 (patch)
treeb6784ebba8cde4a9445478d11f7024c3b9ae151d
parentc7da64a4880a31710dedf0cbf06bb1f9b34d621f (diff)
downloadjdk-0b1b5c8d0b2b69e06916d0fed09d181115c1d685.tar.gz
jdk-0b1b5c8d0b2b69e06916d0fed09d181115c1d685.zip
8264373: javac hangs when annotation is declared with sealed public modifier
Reviewed-by: jlahoda
-rw-r--r--src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeInfo.java2
-rw-r--r--test/langtools/tools/javac/sealed/SealedCompilationTests.java3
2 files changed, 3 insertions, 2 deletions
diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeInfo.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeInfo.java
index 6430d122198..d19a0b7bbaf 100644
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeInfo.java
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeInfo.java
@@ -1032,7 +1032,7 @@ public class TreeInfo {
*/
public static long firstFlag(long flags) {
long flag = 1;
- while ((flag & flags & ExtendedStandardFlags) == 0)
+ while ((flag & flags) == 0)
flag = flag << 1;
return flag;
}
diff --git a/test/langtools/tools/javac/sealed/SealedCompilationTests.java b/test/langtools/tools/javac/sealed/SealedCompilationTests.java
index 0c549caa604..f31c433002f 100644
--- a/test/langtools/tools/javac/sealed/SealedCompilationTests.java
+++ b/test/langtools/tools/javac/sealed/SealedCompilationTests.java
@@ -366,7 +366,8 @@ public class SealedCompilationTests extends CompilationTestCase {
"class SealedTest {\n" +
" sealed class Super {}\n" +
" sealed non-sealed class Sub extends Super {}\n" +
- "}"))
+ "}",
+ "sealed public @interface SealedTest { }"))
assertFail("compiler.err.illegal.combination.of.modifiers", s);
}