On Mon, 24 Aug 2026 20:37:09 GMT, Sean Mullan <[email protected]> wrote:
>> My intention was to focus on supporting the syntax that is currently used in
>> the JDK `java.security` file. Alan correctly notes that the semantics of
>> this use case is quite different than what the current `Properties` API
>> supports, so it is not as simple as just reusing and making the
>> `java.util.Properties::load0` method more accessible. I'm not inclined to
>> significantly increase the scope of this enhancement.
>>
>> So I think it makes sense to add support for additional separators and
>> document any other differences. If any of these become critical parsing
>> issues later, we can always consider adding support for them at that time.
>
> I've added support for these delimeters (':', '=', whitespace). I added
> support for comments beginning with '!' or '#' and blank lines containing
> just whitespace. I think this brings it closer to the syntax specified by
> `java.util.Properties.load(Reader)`. I'll go over it again, and document any
> differences in the next round of changes.
I just pushed another changeset with a few major changes:
- I now use the `Properties` API to parse each property. This means all of the
`java.util.Properties` syntax specified by the `load(Reader)` method should now
be supported. Although it is slightly inefficient (each property is parsed
separately), for now I think it is ok until we see if it makes sense to make
internal parts of the `Properties` implementation reusable.
- I added a new test case that creates a second JDK image containing a custom
(not the JDK's) `java.security` file. This ensures that the implementation can
parse `java.security` files containing different formats, etc.
- Several other smaller improvements to the test and code
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/31884#discussion_r3917920842