On 8/8/17 10:18 AM, Daniel Fuchs wrote:
That's what will happen if someone had a custom implementation
of ThreadMXBean which is compiled against JDK 9 but runs in JDK 10,
and therefore does not have the new methods. Then it inherits
the default body that throes UOE.
I'm not aware of any custom implementation of the platform mxbean. I
would expect only JVM implementations would do that. The API was
evolved in the past and haven't heard such issue.
I understand the nice benefit. IMO I don't think it's highly necessary
since these MBeans are expected to be provided by the platform.
With the default body then the implementation can still be compiled
against jdk 10, without having to add the new method.
This means that you can evolve MBean interfaces by adding methods
to them as long as you provide a default body (which is rather cool :-))