On Fri, 13 Sep 2024 21:03:05 GMT, Andy Goryachev <ango...@openjdk.org> wrote:

> I had a single method before that accepted `(String style, String ... 
> names)`. Turns out it was a trap: it's easy to forget about it and simply 
> supply a list of style names, which results in the first style name being 
> interpreted as an inline style (and cause an error message).

Yeah, that's always a potential problem with a method like this where there is 
a single argument before the varargs list of the same type as the varargs list.

> Since I fell into this trap myself, I thought it would be better to have two 
> methods with descriptive names.
> 
> Is there a better solution?

I can't immediately think of one. At least you might add a note to the 
`fromInlineStyle` docs that it is equivalent to `fromStyles(style)`.

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

PR Comment: https://git.openjdk.org/jfx/pull/1524#issuecomment-2350258805

Reply via email to