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

Prasanta Sadhukhan psadhukhan at openjdk.org
Mon Jan 29 10:26:54 UTC 2024


> 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 with a new target base due to a merge or a rebase. The pull request now contains 20 commits:

 - Merge master
 - javadoc change
 - javadoc update in JScrollbar and JComponent
 - PR update as per review
 - PR update as per review
 - javadoc updated
 - Honour max/min size if set by user
 - Override set*Methods and update spec
 - Reinstate setEnabled
 - Remove unneeded methods
 - ... and 10 more: https://git.openjdk.org/jdk/compare/3066d49c...1d8fff40

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

Changes: https://git.openjdk.org/jdk/pull/15325/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=15325&range=13
  Stats: 51 lines in 2 files changed: 42 ins; 0 del; 9 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