RFR: 8366837: Clean up gensrc by spp.Spp

Magnus Ihse Bursie ihse at openjdk.org
Fri Sep 5 15:43:32 UTC 2025


On Wed, 3 Sep 2025 20:17:50 GMT, Magnus Ihse Bursie <ihse at openjdk.org> wrote:

> Several java classes in java.base is generated from templates using SPP, the "Stream Preprocessor". Unfortunately much of this code is very old and has survived unchanged since pre-JDK 7. It does not follow modern makefile standards for abstraction, safe coding practices, etc. In short, they have been a thorn in the side for a long time, and the time has finally come to clean them up.

I have verified that the generated java source code in gensrc is byte-by-byte identical with and without this patch. That is really all that is needed in terms of correctness, but to make sure I do not run into some unexpected problem I am also running a confirmation round on our internal CI.

Hm, something is messing up the command lines on the GHA hosts. Funny, I did not see it when testing elsewhere. I'll look into it.

For the record: the changes in the X-Coder template means that additional empty lines will be inserted in the generated source. This has no real effect on anything substantial, but it means that line numbers change, which make a complete byte-by-byte comparison fail for anything that is dependent on these classes.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/27078#issuecomment-3250651080
PR Comment: https://git.openjdk.org/jdk/pull/27078#issuecomment-3250722749
PR Comment: https://git.openjdk.org/jdk/pull/27078#issuecomment-3258508787


More information about the core-libs-dev mailing list