On Mon, 29 Jan 2024 10:26:54 GMT, Prasanta Sadhukhan <psadhuk...@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 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 requested by aivanov (Reviewer).

src/java.desktop/share/classes/javax/swing/JComponent.java line 1748:

> 1746:      * <p>
> 1747:      * Subclasses may choose to override this by returning its own 
> maximum size
> 1748:      * in its {@code getMaximumSize} method.

Suggestion:

     * Subclasses may choose to override this by returning their own maximum 
size
     * in the {@code getMaximumSize} method.

“Subclasses” is plural and therefore requires plural possessive pronoun.

src/java.desktop/share/classes/javax/swing/JComponent.java line 1792:

> 1790:      * <p>
> 1791:      * Subclasses may choose to override this by returning its own 
> minimum size
> 1792:      * in its {@code getMinimumSize} method.

Suggestion:

     * Subclasses may choose to override this by returning their own minimum 
size
     * in the {@code getMinimumSize} method.

src/java.desktop/share/classes/javax/swing/JScrollBar.java line 790:

> 788:      * fixed minimum size in the other.
> 789:      *
> 790:      * @return the minimum size as specified above.

Suggestion:

     * @return the minimum size as specified above

`@return` tags usually don't have a period in the end. Let's follow it for 
consistency.

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

PR Review: https://git.openjdk.org/jdk/pull/15325#pullrequestreview-1848427511
PR Review Comment: https://git.openjdk.org/jdk/pull/15325#discussion_r1469441820
PR Review Comment: https://git.openjdk.org/jdk/pull/15325#discussion_r1469442444
PR Review Comment: https://git.openjdk.org/jdk/pull/15325#discussion_r1469454747

Reply via email to