Skip to content

Commit 542ed24

Browse files
committed
Add more details to the initial comment
1 parent d42c7f1 commit 542ed24

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

test/jdk/tools/sincechecker/SinceChecker.java

+15-10
Original file line numberDiff line numberDiff line change
@@ -50,20 +50,25 @@
5050

5151
/*
5252
The `@since` checker works as a two-step process:
53-
- in the first step, we process JDKs 9-current, only classfiles, producing a map ``<unique-Element-ID``> => ``<version(s)-where-it-was-introduced>``.
54-
("version(s)", because there's versioning of Preview API, so there may be two versions (we use a class with two fields for preview and stable) - one when it was introduced as a preview, and one when it went out of preview. More on that below)
55-
For each Element, compute the unique ID, look into the map, and if there's nothing, record the current version as the originating version.
53+
- In the first step, we process JDKs 9-current, only classfiles, producing a map `<unique-Element-ID`> => `<version(s)-where-it-was-introduced>`.
54+
("version(s)", because we handle versioning of Preview API, so there may be two versions (we use a class with two fields for preview and stable) -
55+
one when it was introduced as a preview, and one when it went out of preview. More on that below)
5656
57-
At the end of this step we have a map of the Real since values
57+
-- For each Element, we compute the unique ID, look into the map, and if there's nothing, record the current version as the originating version.
58+
-- At the end of this step we have a map of the Real since values
5859
59-
Real since value of an API element is computed as the oldest release in which the given API element was introduced. That is:
60+
- In the second step, we would look at "effective" `@since` tags in the mainline sources, which we get from the `src.zip` file (if the test run doesn't have it, we throw a `jtreg.SkippedException`)
61+
and 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.
62+
63+
--In this step we limit the tool to only check the specific MODULE whose name was passed as an argument in the test. In that module, we look for unqualified exports and test those packages.
64+
65+
note on real vs effective `@since`:
66+
67+
Real since value of an API element is computed as the oldest release in which the given API element was introduced. That is:
6068
- for modules, classes and interfaces, the release in which the element with the given qualified name was introduced
6169
- for constructors, the release in which the constructor with the given VM descriptor was introduced
6270
- 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
6371
64-
- in the second step, we would look at "effective" `@since` tags in the mainline sources, and the `@since` checker verifies that for every API element,
65-
the real since value and the effective since value are the same,and reports an error if they are not.
66-
6772
Effective since value of an API element is computed as follows:
6873
- if the given element has a `@since` tag in its javadoc, it is used
6974
- in all other cases, return the effective since value of the enclosing element
@@ -72,8 +77,8 @@
7277
- When an element is still marked as preview, the `@since` should be the first JDK release where the element was added.
7378
- If the element is no longer marked as preview, the `@since` should be the first JDK release where it was no longer preview.
7479
75-
note: The `<unique-Element-ID>` for methods looks like `method: <return-descriptor> <binary-name-of-enclosing-class>.<method-name>(<ParameterDescriptor>)`.
76-
it is somewhat inspired from the VM Method Descriptors
80+
note: The `<unique-Element-ID>` for methods looks like `method: <erased-return-descriptor> <binary-name-of-enclosing-class>.<method-name>(<ParameterDescriptor>)`.
81+
it is somewhat inspired from the VM Method Descriptors. But we use the erased return so that methods that were later generified remain the same.
7782
*/
7883

7984

0 commit comments

Comments
 (0)