UNIXProcess.toString -- include more useful information

Steven Schlansker stevenschlansker at gmail.com
Mon Apr 25 19:33:51 UTC 2016


Hi core-libs-dev,

I recently was diagnosing a problem relating to an external program invoked via
the ProcessBuilder API.

The returned Process is an instance of java.lang.UNIXProcess, which does
not have a toString method.

While I understand that the concepts of "pid" etc are not cross-platform,
it might be useful to operators to have the toString method
dump them as diagnostic information.

Imagine if instead of

"java.lang.UNIXProcess@<hashCode>"

you could see

"UNIXProcess[running=true, pid=1234]"
"UNIXProcess[running=false, exitCode=127]"

This seems like it would be a fairly trivial change that could help some
operator down the road.

Is this a reasonable request?  Thanks,
Steven




More information about the core-libs-dev mailing list