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

Prasanta Sadhukhan psadhukhan at openjdk.org
Thu Aug 24 07:46:07 UTC 2023


> 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

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/15325/files
  - new: https://git.openjdk.org/jdk/pull/15325/files/31bbdee8..be0a339b

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=15325&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=15325&range=00-01

  Stats: 105 lines in 3 files changed: 56 ins; 48 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/15325.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/15325/head:pull/15325

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


More information about the client-libs-dev mailing list