RFR: 8331051: Add an `@since` checker test for `java.base` module
Nizar Benalla
duke at openjdk.org
Mon Apr 29 09:16:27 UTC 2024
This checker checks the values of the `@since` tag found in the documentation comment for an element against the release in which the element first appeared.
Real since value of an API element is computed as the oldest release in which the given API element was introduced. That is:
- for modules, classes and interfaces, the release in which the element with the given qualified name was introduced
- for constructors, the release in which the constructor with the given VM descriptor was introduced
- for methods and fields, the release in which the given method or field with the given VM descriptor became a member of its enclosing class or interface, whether direct or inherited
Effective since value of an API element is computed as follows:
- if the given element has a `@since` tag in its javadoc, it is used
- in all other cases, return the effective since value of the enclosing element
The since checker verifies that for every API element, the real since value and the effective since value are the same, and reports an error if they are not.
Important note : We only check code written since `JDK 9` as the releases used to determine the expected value of `@since` tags are taken from the historical data built into `javac` which only goes back that far
The intial comment at the beginning of `SinceChecker.java` holds more information into the program.
I already have filed issues and fixed some wrong tags like in #18640, #18032, #18030, #18055, #18373, #18954, #18972.
-------------
Commit messages:
- trivial change - extra parentheses
- General improvements:
- Add more details to the initial comment
- remove unnecessary class - jtreg comment is enough to run the test
- renamed files to give them more unique filenames - add more to the comment at the beginning of the file
- first `@since` checker test of the JDK. For `java.base`
Changes: https://git.openjdk.org/jdk/pull/18934/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=18934&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8331051
Stats: 869 lines in 3 files changed: 867 ins; 0 del; 2 mod
Patch: https://git.openjdk.org/jdk/pull/18934.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/18934/head:pull/18934
PR: https://git.openjdk.org/jdk/pull/18934
More information about the core-libs-dev
mailing list