Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8323158

HotSpot Style Guide should specify more include ordering

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 25
    • None
    • hotspot
    • master

      Currently the style guide just says includes should be alphabetically sorted, and conditional includes should be at the end. This doesn't address a number of issues.

      There was a long Oracle-internal discussion on this topic in Nov 2022 - Jan 2023 that needs to be mined for a proposal or proposals in this area.

      - The position of "unittest.hpp". It is commonly last. There may have been, and may still be, technical reasons for that positioning. Not all uses place it last, and if there isn't (any longer?) a technical reason for that placement, then it might be reconsidered.

      - System/compiler includes are not typically included in that sort, but are instead grouped together. Sometimes at the beginning, sometimes at the end.

      - Current (undocumented) style for ".inline.hpp" files is to include the associated ".hpp" file first, separated from other includes by a blank line.

      - How should platform includes be handled.

      - How should oddities like "jni.h" be handled.

      - Details of sorting should be specified. Things like digits, underscore, case-insensitive, and so on.

            stefank Stefan Karlsson
            kbarrett Kim Barrett
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: