David, > Is this because the management API's are actually split across > the base module (java.lang.management) and the jdk.management module? > If so that seem messy. If not then I'm not understanding the issue.
Yes. Exactly. Moreover future management functionality may require additional modules. -Dmitry On 2016-01-14 07:06, David Holmes wrote: > Hi Dmitry, > > On 14/01/2016 4:45 AM, Dmitry Samersoff wrote: >> Everybody, >> >> Please, review the fix: >> >> http://cr.openjdk.java.net/~dsamersoff/JDK-8141070/webrev.01/ >> >> The problem: >> >> Code in management.cpp throw NoClassDefFound exception if any of >> requested classes is missing. >> >> But, in upcoming modular JDK classes that not belong to >> java.lang.management (sun.management, com.sun.management etc) might not >> be present. > > Is this because the management API's are actually split across the base > module (java.lang.management) and the jdk.management module? If so that > seem messy. If not then I'm not understanding the issue. > > I would have hoped that the management initialization function in the VM > could simply check for the management module being present and set a > flag that can be checked by all the management entry points. Something > that might even be better done at the Java level. ?? > > Cheers, > David > >> Solution: >> >> Refactor class resolving code to support two type of classes - REQUIRED >> (still throw NCDFE if the class is missing) and OPTIONAL (just return >> NULL). >> >> I introduced a new parameter to highlight the fact that a class is an >> optional one on caller side rather than handle it silently inside >> management.cpp. >> >> -Dmitry >> -- Dmitry Samersoff Oracle Java development team, Saint Petersburg, Russia * I would love to change the world, but they won't give me the sources.