[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-2d-dev
Subject:    Re: RFR: 6510914: JScrollBar.getMinimumSize() breaks the contract of JComponent.setMinimumSize() [v2
From:       Prasanta Sadhukhan <psadhukhan () openjdk ! org>
Date:       2023-09-27 4:54:20
Message-ID: 5OGm-0SM7bgkioZGpWdiW-XPT3mSkyYgDxrAmxenf0Y=.53d2ad6b-6a39-4fab-aa1b-e9a040a576bb () github ! com
[Download RAW message or body]

On Thu, 24 Aug 2023 07:46:07 GMT, Prasanta Sadhukhan <psadhukhan@openjdk.org> wrote:

> > javadoc contract for JComponent.setMinimumSize(Dimension) states:
> > 
> > "Sets the minimum size of this component to a constant value. Subsequent calls to \
> > getMinimumSize will always return this value..." 
> > However, JScrollBar overrides getMinimumSize() and breaks this contract - it \
> > always returns a minimum size derived from the preferred size even if you have \
> > previously called setMinimumSize() 
> > Fix is made to check if mnimumSize is set and if so, honour it..
> 
> Prasanta Sadhukhan has updated the pull request incrementally with two additional \
> commits since the last revision: 
> - copyright year
> - Fix maximumSize, test

I dont see any visual change with this fix and it solves `get/setMinimumSize` \
contract.  However,
I think the suggestion is to update the javadoc for JScrollBar but it does not have \
`setMinimumSize/setMaximumSize` method which has the contract in \
`JComponent.setMinimumSize/setMaximumSize`  " Subsequent calls to getMaximumSize will \
always return this value;"

so not sure where to update the spec..in the JScrollBar class top summary or in \
`getMinimumSize/getMaximumSize` but since the contract is in set method, not sure if \
it will be considered if updated in get methods..

@aivanov-jdk @prrace Please provide your opinion..

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

PR Comment: https://git.openjdk.org/jdk/pull/15325#issuecomment-1736698607


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic