Apparent conflict in ACC_SUPER rules

Lukas Petru Lukas.Petru at seznam.cz
Tue Jan 28 16:39:34 UTC 2020


Hello.




This is my feedback and request for clarification sent to the e-mail address
as suggested in chapter 1 of Java Virtual Machine Specification.




When reading the Java language specification, I found the following pieces 
of text that seem to be in contradiction:




Java SE 13
Released September 2019 as JSR 388
(https://docs.oracle.com/javase/specs/jvms/se13/html/jvms-4.html)




chapter 4 section 4.1. The ClassFile Structure




access_flags




> If the ACC_INTERFACE flag is set, the ACC_ABSTRACT flag must also be set, 
and the
> ACC_FINAL, ACC_SUPER, ACC_ENUM, and ACC_MODULE flags set must not be set.




I.e. for interface, never set ACC_SUPER.




> Compilers to the instruction set of the Java Virtual Machine should set 
the
> ACC_SUPER flag.




I.e. always set ACC_SUPER.




Which one is true? Should interfaces have the ACC_SUPER always set or never 
set?




Kind regards,

Lukas


More information about the jls-jvms-spec-comments mailing list