On Fri, 19 Nov 2021 19:54:49 GMT, Jonathan Gibbons <j...@openjdk.org> wrote:

>> I vaguely remember that at some stage I seem to have realized that while 
>> `sealed` works for Style, it does not work for Attribute. This is because 
>> the attribute is typically queried by the most specific `Class<T extends 
>> Attribute>`, which means that the client knows the exact type of the 
>> attribute upon return from Attributes.get (note plural attributeS).
>> 
>> Here's another issue that might have contributed to this mess: although the 
>> [sealed classes](https://openjdk.java.net/jeps/409) are available, the 
>> [exhaustive switch for sealed 
>> hierarchies](https://openjdk.java.net/jeps/420) is not.
>> 
>> That said, here's what I will do. I will push a commit to make Style 
>> `sealed`, which seems a reasonable thing to do. Do you have any objections, 
>> Jon? (Asking because you have already reviewed the change.)
>
> Thanks for the explanation.   Mostly, I was curious about what had happened 
> in your thinking in this area.  I have no strong preferences either way, with 
> a mild preference for leaving it alone, and improve it later when you may be 
> able to make better use of the declaration.

Please clarify: do you want me to revert 93f01b9, push the PR as it is now, or 
do something else?

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

PR: https://git.openjdk.java.net/jdk/pull/6359

Reply via email to