RFR: 8230857: Avoid reflection in sun.tools.common.ProcessHelper

Langer, Christoph christoph.langer at sap.com
Wed Sep 11 22:05:40 UTC 2019


Hi,

please review an enhancement which I've identified when working with Processhelper for JDK-8230850.

I noticed that ProcessHelper is an interface in common code with a static method that would lookup the actual platform implementation via reflection. This seems a little cumbersome since we can have a common dummy for ProcessHelper and override it with the platform specific implementation, leveraging the build system. The only drawback is that the test "TestProcessHelper" gets a little more sophisticated when using only package private methods in ProcessHelper, because the methods need to be made accessible for the test. But I guess that's ok, given the actual tool improvement.

Bug: https://bugs.openjdk.java.net/browse/JDK-8230857
Webrev: http://cr.openjdk.java.net/~clanger/webrevs/8230857.0/

Thanks
Christoph

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/serviceability-dev/attachments/20190911/fc17be87/attachment.html>


More information about the serviceability-dev mailing list