-
Bug
-
Resolution: Fixed
-
P4
-
repo-valhalla
-
generic
-
generic
JVMS 4.b reads under linking exceptions for WithField:
The field must be final, it must be declared in the current value class, and the
instruction must occur in a method of the current value class. Otherwise,
an IllegalAccessError is thrown.
According to John Rose, this is overly restrictive: "the intention has always been that withfield is a private op. That means nestmates. It’s a VM bug and maybe a spec bug also if withfield works only on the same class. Please, align with the rest of the nestmates work ASAP." and
" The spec. saying “same class” doesn’t know it’s now doing something unusual; private members always used to say “same class” but now the spec. has evolved to talk about nests."
The field must be final, it must be declared in the current value class, and the
instruction must occur in a method of the current value class. Otherwise,
an IllegalAccessError is thrown.
According to John Rose, this is overly restrictive: "the intention has always been that withfield is a private op. That means nestmates. It’s a VM bug and maybe a spec bug also if withfield works only on the same class. Please, align with the rest of the nestmates work ASAP." and
" The spec. saying “same class” doesn’t know it’s now doing something unusual; private members always used to say “same class” but now the spec. has evolved to talk about nests."