Re: RFR: 8332103: Add missing `@since` tags to `java.desktop` [v2]

2024-05-29 Thread Alexey Ivanov
On Tue, 14 May 2024 23:36:13 GMT, Nizar Benalla  wrote:

>> src/java.desktop/share/classes/javax/swing/plaf/basic/BasicSliderUI.java 
>> line 154:
>> 
>>> 152:  * Constructs a {@code BasicSliderUI}.
>>> 153:  *
>>> 154:  * @since 16
>> 
>> Hmm, the *explicit* default constructor was added in JDK 16, but it was 
>> implicit before then.
>> So I am not 100% sure what the right answer is - the same as the class, or 
>> when it was explicitly added.
>
> When mapping methods and when they first appeared (by using the historical 
> record built into javac) I use an id in the form of 
> `method:  
> .()` so for 
> covariant overrides in general, when the return type changes I consider it to 
> be a new method.
> 
> Looking at the contents of the dictionnary:
> This explicit constructor existed for a long time but then this new was added 
> a new one was added in JDK 16
> | Key | Value |
> | - | - |
> | `method: void 
> javax.swing.plaf.basic.BasicSliderUI.(javax.swing.JSlider):` | 9 |
> | `method: void javax.swing.plaf.basic.BasicSliderUI.():`  | 16 |
> 
> Note: JDK 9 is used as the "base" as that's how far I can reliably use the 
> `--release` info, so if something was added in JDK 2,5.7,9. It has a value of 
> "9" in the dictionnary. I mainly check for errors in newer code.

> Hmm, the _explicit_ default constructor was added in JDK 16, but it was 
> implicit before then. So I am not 100% sure what the right answer is - the 
> same as the class, or when it was explicitly added.

I believe there was no default constructor in `BasicSliderUI()` because there 
was a constructor with a parameter `BasicSliderUI(JSlider b)`.

Thus, this case seem to be correct `BasicSliderUI()` is available since 16.

At the same time, `BasicSliderUI(JSlider b)` has existed since at least 7, the 
constructor is present in the history of the file. The history in GitHub goes 
up to 1st December 2007 which corresponds to Java 7 timeline. I'm pretty sure 
this constructor existed in previous releases, and you have to dig further to 
find when it was added.

Very much likely, the constructor `BasicSliderUI(JSlider b)` was added when the 
`BasicSliderUI` class was added. The class does not have `@since` tag, so it's 
inherited from the package, isn't it? The same rule applies to the constructor, 
doesn't it?

-

PR Review Comment: https://git.openjdk.org/jdk/pull/19192#discussion_r1618748176


Re: RFR: 8332103: Add missing `@since` tags to `java.desktop` [v2]

2024-05-14 Thread Nizar Benalla
> If you're currently reviewing this PR, thank you!
> Most fixes here are according to the reports by the since checker tool in 
> #18934 and are pretty simple.
> 
> To make reviewing easier
> - `BasicSliderUI` has the constructor `public BasicSliderUI(JSlider b)` for a 
> long time so the default constructor (without parameters) didn't exist until 
> JDK 16
> 
> For the `package-info` files, it is pretty hard to find source code of JDK 
> 1-5 so I used the `grep` command to find the oldest instance of an `@since` 
> in those packages.
> 
> I found instances of `@since 1.1` in the other packages but 
> `javax/swing/plaf/synth/package-info.java` might be worth checking as most 
> classes there had no `@since`.

Nizar Benalla has updated the pull request incrementally with one additional 
commit since the last revision:

  Swing was added in JDK 1.2

-

Changes:
  - all: https://git.openjdk.org/jdk/pull/19192/files
  - new: https://git.openjdk.org/jdk/pull/19192/files/dec1c1b5..7e8244db

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk=19192=01
 - incr: https://webrevs.openjdk.org/?repo=jdk=19192=00-01

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/19192.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/19192/head:pull/19192

PR: https://git.openjdk.org/jdk/pull/19192