RFR: 8272870: Add convenience factory methods for border and background [v3]

Ambarish Rapte arapte at openjdk.java.net
Wed Sep 15 11:19:50 UTC 2021


On Thu, 9 Sep 2021 23:43:29 GMT, Nir Lisker <nlisker at openjdk.org> wrote:

>> Added convenience factory factory methods for Background and Border.
>
> Nir Lisker has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - Removed whitespaces
>  - Added tests and doc updates

Provided few minor comments, overall looks good to me.

modules/javafx.graphics/src/main/java/javafx/scene/layout/Background.java line 357:

> 355: 
> 356:     /**
> 357:      * A convenience factory method for creating a background with a single {@code Paint}.

Minor: typo:  `background` -> `Background`
Let's use the `Background` in all places where we refer the class name. Two other places which need similar change are in @param and @return

A similar change is needed for Border.stroke method also: border -> Border

modules/javafx.graphics/src/test/java/test/javafx/scene/layout/BackgroundTest.java line 722:

> 720:     @Test
> 721:     public void testSingleFill() {
> 722:         var background1 = Background.fill(Color.BEIGE);

I think we should have a test for null argument too.
Similar for the test BorderTest.testSingleStroke()

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

Changes requested by arapte (Reviewer).

PR: https://git.openjdk.java.net/jfx/pull/610


More information about the openjfx-dev mailing list