On Jul 26, 1:22 pm, Steffen Glückselig <
goo...@gungfu.de> wrote:
> Hello,
>
> I was going to extend java.util.regex.Matcher for named groups and
> came to a point where I wanted to proxy the Matcher-class so that my
> extension was usable in-place of the original implementation.
>
> I realized - via "java.lang.VerifyError: Cannot inherit from final
> class" - that it isn't possible to do that.
>
> [...]
>
> Maybe 'proxy' should be able to handle even final classes?
The enforcement of the 'final' restriction is done by the JVM (unlike
some other things that are enforced by a Java-compiler but not the
JVM); subclassing for some classes must be prohibited for security
reasons.
> Is there another way to 'inject' the extended implementation in common
> code?
You could pack your own RT.jar (not really very practical).