[trivial][comments] Primarily: Clarified the weird situation that both bit 62 and 48 indicate 'sealed'. It's a 'javac changing stuff between major versions' thing.

This commit is contained in:
Reinier Zwitserloot committed 2025-07-31 22:51:08 +02:00
1 parent 98f6b5f27f
commit 6b2af3f81f
2 files changed
+3 -3

No files matched your search

@@ -1033,7 +1033,7 @@ public class PrettyPrinter extends JCTree.Visitor {
if ((v & NATIVE) != 0) print("native ");
if ((v & ABSTRACT) != 0) print("abstract ");
if ((v & SEALED) != 0) print("sealed ");
if ((v & NON_SEALED) != 0) print("non-sealed ");
if ((v & NON_SEALED) != 0) print("non-sealed "); // Yes, this is a real keyword.
if ((v & STRICTFP) != 0) print("strictfp ");
if ((v & DEFAULT) != 0 && (v & INTERFACE) == 0) print("default ");
}
+2 -2
View File
@@ -77,12 +77,12 @@ public class Javac {
private static final AtomicInteger compilerVersion = new AtomicInteger(-1);
/* This section includes flags that would ordinarily be in Flags, but which are 'too new' (we don't compile against older versions of javac for compatibility). */
/* This section includes flags that would ordinarily be in com.sun.tools.javac.code.Flags, but which are 'too new' (we don't compile against older versions of javac for compatibility). */
public static final long RECORD = 1L << 61; // ClassSymbols, MethodSymbols, VarSymbols (Marks types as being records, as well as the 'fields' in the compact declaration, and the canonical constructor)
public static final long COMPACT_RECORD_CONSTRUCTOR = 1L << 51; // MethodSymbols (the 'implicit' many-args constructor that records have)
public static final long UNINITIALIZED_FIELD = 1L << 51; // VarSymbols (To identify fields that the compact record constructor won't initialize)
public static final long GENERATED_MEMBER = 1L << 24; // MethodSymbols, VarSymbols (marks methods and the constructor generated in records)
public static final long SEALED = 1L << 62 | 1L << 48; // ClassSymbols (Flag to indicate sealed class/interface declaration)
public static final long SEALED = 1L << 62 | 1L << 48; // ClassSymbols (Flag to indicate sealed class/interface declaration) - from the introduction of sealed until ~jdk23, this was 62. In jdk24, it's 48. Ugh.
public static final long NON_SEALED = 1L << 63; // ClassSymbols (Flag to indicate that the class/interface was declared with the non-sealed modifier)
/**