On Tue, 4 Aug 2026 00:07:47 GMT, Chen Liang <[email protected]> wrote:
> Currently, it's hard for users to inspect the preview-specific class files in > the JDK with javap. There's a hidden option from the base file manager, > `--preview-mode`, that accomplishes this, but this option is cursed by the > fact that it consumes arbitrary string arguments that do not represent a > valid boolean, causing confusions when it accidentally consumes subsequent > flags or arguments. We should tweak this option to reject whatever is not > `true` or `false`, and document this option for the `javap` tool, and > document in `value-class-preview.md`. (This is already documented in > `javac.properties`) > > Currently, on mainline, you can already do: (`=` can be replaced with a space) > > javap --preview-mode=true java.lang.Integer > > > to obtain the disassembly for the preview `Integer` class. > > However, an erroneous command line like: > > javap --preview-mode java.lang.Integer > > > fails with an ambiguous message, because the parser tries to parse > `java.lang.Integer` as a boolean value. This patch makes the error message > more clear, as demonstrated in the new test. > > --------- > - [x] I confirm that I make this contribution in accordance with the [OpenJDK > Interim AI Policy](https://openjdk.org/legal/ai). Ok, created a CSR documenting the change in this option. ------------- PR Comment: https://git.openjdk.org/jdk/pull/32186#issuecomment-5179891614
