RFR: 8341372: BackgroundPosition, BorderImage, BorderStroke, CornerRadii should be final [v2]

Nir Lisker nlisker at openjdk.org
Mon Oct 7 22:53:03 UTC 2024


On Wed, 2 Oct 2024 17:53:15 GMT, Michael Strauß <mstrauss at openjdk.org> wrote:

>> Backgrounds and borders are comprised of immutable and final types. The following types are marked with the `final` modifier:
>> 
>> * Background
>> * BackgroundFill
>> * BackgroundImage
>> * BackgroundSize
>> * Border
>> * BorderWidths
>> 
>> The following types are not marked with the `final` modifier:
>> 
>> * BackgroundPosition
>> * BorderImage
>> * BorderStroke
>> * CornerRadii
>> 
>> This is probably just an oversight, as there is no value in allowing a subsection of these types to be extended.
>
> Michael Strauß has updated the pull request incrementally with one additional commit since the last revision:
> 
>   make fields private

I've previously looked at these classes when records came out and they would be good candidates for being records, but it breaks binary compatibility. They would also be good value classes when that comes out. In any case, they need to be final and immutable.

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

PR Comment: https://git.openjdk.org/jfx/pull/1587#issuecomment-2398061219


More information about the openjfx-dev mailing list