RFR: 8334580: Deprecate no-arg constructor BasicSliderUI() for removal [v2]

Phil Race prr at openjdk.org
Fri Jun 21 18:13:10 UTC 2024


On Fri, 21 Jun 2024 15:59:26 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:

> Now that I looked at the code more thoroughly, the no-arg constructor makes more sense actually.
> 
> https://github.com/openjdk/jdk/blob/c41293a70834a79c79e859ebcdb8869884ac87dc/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicSliderUI.java#L202-L207
> 
> I was under impression that `BasicSliderUI(JSlider b)` did use its parameter but it doesn't.
> 
> Should we keep the new constructor and deprecate the _old_ one?
> 
> Should we remove the new constructor and keep the things as they've always been?

I looked at all the sub-classes of BasicSliderUI - and Aqua, Motif, Metal, Synth, Windows all of course use the constructor with args, since they had to. 
But it means that if we deprecated the consructor with args we'd probably want to look at those too. It seems like the ripple effect isn't worth it.
And what if there is later a need for the JSlider ? Unlikely I know .. but I'd prefer to correct the short-term mistake and leave everything else alone.

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

PR Comment: https://git.openjdk.org/jdk/pull/19819#issuecomment-2183211635


More information about the client-libs-dev mailing list