RFR: 8332895: Support interpolation for backgrounds and borders [v18]

Michael Strauß mstrauss at openjdk.org
Wed Aug 7 15:37:41 UTC 2024


On Wed, 7 Aug 2024 15:21:18 GMT, John Hendrikx <jhendrikx at openjdk.org> wrote:

>> I just think it's much simpler than an annotation...
>> 
>> Or it could be a public instance method `boolean isSupportReconstruction()` for the child classes to override, saving N (1? 8?) bytes per instance.
>
> But the annotation costs no bytes per instance, if that even matters, as I thought these were singletons so it looks like we're quite into micro-optimization territory here.

Whether a style converter supports reconstruction should be a statement about the type, not a statement about the instance. For this reason, I don't prefer an instance method like `isSupportReconstruction()`. In any case, these are our options:
1. Boolean parameter / Feature enum passed to constructor
2. Instance method `isSupportReconstruction()`
3. Annotation
4. Empty marker interface
5. Interface with the `convertBack` method
6. Subclassing

I lean slightly towards the annotation, but I'm generally okay with either option.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1522#discussion_r1707281230


More information about the openjfx-dev mailing list