RFR: 6510914: JScrollBar.getMinimumSize() breaks the contract of JComponent.setMinimumSize() [v9]

Prasanta Sadhukhan psadhukhan at openjdk.org
Tue Jan 23 03:37:46 UTC 2024


On Mon, 22 Jan 2024 21:03:10 GMT, Phil Race <prr at openjdk.org> wrote:

>> Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   javadoc updated
>
> src/java.desktop/share/classes/javax/swing/JScrollBar.java line 789:
> 
>> 787:      *
>> 788:      * @return the value of the {@code minimumSize} property if set by user
>> 789:      *         or if not set, minimum size derived from
> 
> Seems we are not there yet. What is in this PR now is internally inconsistent.
> It adopts doc on set*Size that reads as if get*Size will always ignore the super-class contract,
> but on the get*Size methods we have new doc and implementation that actually in large part honours it.
> One of these needs to change and then the CSR needs to match.
> 
> So, revisiting old ground, ie we've been back and forth on this.
> we can keep the current PR code which is "if the user calls set*Size, then honour it, accepting the low risk, OR
> we can keep the long standing behaviour, which is as near as we can get to no risk.
> 
> I'm still a bit on the fence, but I think I never want to hear about JScrollBar size again, :-)
> So can we delete the new code in the get*Size methods and copy some of the wording from set*
>      *JScrollBar will derive the maximum size from
>       * the preferred size in one axis and a fixed maximum size in the other
>      
> then the return doc can reduce to
> @ return the minimum size calculated as described above.

> So can we delete the new code in the get_Size methods and copy some of the wording from set_ *JScrollBar will derive the maximum size from * the preferred size in one axis and a fixed maximum size in the other
> 
> then the return doc can reduce to @ return the minimum size calculated as described above.

Updated as per suggestion..

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15325#discussion_r1462686437


More information about the client-libs-dev mailing list