RFR: 8365610: Sort share/jfr includes

Aleksey Shipilev shade at openjdk.org
Mon Aug 18 12:06:12 UTC 2025


On Mon, 18 Aug 2025 11:44:38 GMT, Markus Grönlund <mgronlun at openjdk.org> wrote:

> In my opinion, it adds little value and instead creates more work for us that develop JFR.

Noted, but I think this overestimates the amount of work. If the test would fail in `tier1` (which the required pre-integration testing, runs even in GHA), in 99% of cases you either sort the includes by hand, or run the tool in the way that test failure itself would guide you through: https://github.com/openjdk/jdk/blob/c1198bba0e8cbdaa47c821263d122d0ba4dd6759/test/hotspot/jtreg/sources/TestIncludesAreSorted.java#L91-L93

> But if "someone" has said this is good to do for all of HotSpot (who?) we can accommodate to the general will.

Take a look at [Hotspot Style Guide](https://github.com/openjdk/jdk/blob/master/doc/hotspot-style.md#source-files): "Keep the include lines within a section alphabetically sorted by their lowercase value. If an include must be out of order for correctness, suffix with it a comment such as // do not reorder. Source code processing tools can also use this hint."

Both the original [JDK-8352645](https://bugs.openjdk.org/browse/JDK-8352645), and the related tasks from it maintain the same consensus: sort the includes, make sure the test would keep them sorted.

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

PR Comment: https://git.openjdk.org/jdk/pull/26800#issuecomment-3196365263


More information about the hotspot-jfr-dev mailing list