RFR 8183123 : JDP packets have no processId context set
Daniel D. Daugherty
daniel.daugherty at oracle.com
Wed Jul 5 20:27:37 UTC 2017
On 6/29/17 7:57 AM, Andrew Leonard wrote:
> Hi All,
> Please can I get some review feedback for my changes for this issue:
> _https://bugs.openjdk.java.net/browse/JDK-8183123_
> The webrev patch has been uploaded here:
> _http://cr.openjdk.java.net/~clanger/webrevs/8183123.0/_
> <http://cr.openjdk.java.net/%7Eclanger/webrevs/8183123.0/>
src/jdk.management.agent/share/classes/sun/management/jdp/JdpController.java
L137 return (int)ProcessHandle.current().pid();
The return type is Integer. Why not cast to "Integer" instead
of "int"?
test/sun/management/jdp/JdpOnTestCase.java
The test update just verifies that a non-NULL PROCESS_ID is found, but
doesn't verify the format (integer) of the return. Of course, a
platform
independent format for PROCESS_ID might be problematic... For example,
in some versions of Cygwin, I've seen negative values for PIDs...
Thumbs up. If you change the cast I don't need to see a new webrev.
Dan
_
_
>
>
> Essentially the fix entails:
> - Replacing invalid process id query logic with call to
> ProcessHandle.current().getPid().
> - Update testcase to cover the failing scenario. Thus it fails without
> my patch, and succeeds with it.
>
> Thanks
> Andrew
>
> Andrew Leonard
> Java Runtimes Development
> IBM Hursley
> IBM United Kingdom Ltd
> Phone internal: 245913, external: 01962 815913
> internet email: andrew_m_leonard at uk.ibm.com
>
> Unless stated otherwise above:
> IBM United Kingdom Limited - Registered in England and Wales with
> number 741598.
> Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/serviceability-dev/attachments/20170705/3b9f129c/attachment.html>
More information about the serviceability-dev
mailing list