Refinements for sealed types

Alex Buckley alex.buckley at
Mon Aug 19 22:52:50 UTC 2019

On 8/19/2019 3:22 PM, Brian Goetz wrote:
> I don't have a strong opinion on whether "sealed but no permitted 
> subtypes" is a habitable space separate from "final", but I'm fine to
> say "that means final" for most purposes.  Not sure what reflection
> should say; is it OK for a type that is clearly sealed in its 
> declaration to report back as "not sealed, but final?"  Or does
> that mean it is both sealed _and_ final (an empty PermittedSubtypes 
> attribute, plus an ACC_FINAL)?

Are you referring here to a source declaration such as `sealed interface
X {}` where, per Vicente, X.class has ACC_FINAL set? I think 
X.class.isSealed() should return true and X.class.isFinal() [simplifying 
for space] should return false. Has there been any discussion of 
reclaiming ACC_SUPER, 0x0020, for ACC_SEALED in v58 class files? Using 
an empty attribute to denote sealing is pretty ugly.


More information about the amber-spec-experts mailing list