Files
aftabkh4n 7c17a14706 Verify CFR's Java 17 round trip and its default sealed-class omission
Adds a CFR 0.152 example next to Vineflower: a synthetic Java 17 fixture
with a sealed interface, records, instanceof patterns, switch yield and a
text block is decompiled by the pinned release JAR (SHA-256 checked) and
rebuilt, and prints the same line. A reflection probe shows that by default
the rebuilt interface is no longer sealed, and --sealed true restores it,
matching CFR's option defaults for Java 17 class files. The CFR entry now
names the flag.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019S6gW1R7hWkvBKbBYnSYgK
2026-11-03 09:40:55 +00:00

8 lines
313 B
Java

public class SealedProbe {
public static void main(String[] args) throws Exception {
Class<?> shape = Class.forName("Shapes$Shape");
Class<?>[] permitted = shape.getPermittedSubclasses();
System.out.println(shape.isSealed() + ":" + (permitted == null ? 0 : permitted.length));
}
}