RFR: CODETOOLS-7902337 jcov (JREInstr) hides results of running java commands: jlink, jimage

Jonathan Gibbons jonathan.gibbons at oracle.com
Tue Oct 23 21:03:31 UTC 2018


In doCommand, the process could block if output is written to stderr, 
because you are not reading from stderr.

Instead of using RUntime.exec, the easiest way to fix this is to use 
ProcessBuilder and then set stderr to redirect to stdout.

-- Jon


On 10/23/2018 01:58 PM, Alexandre (Shura) Iline wrote:
> 1. Did you mean to use Objects.requireNonNull(Object) where you use Objects.nonNull(Object)?
> 2. I think it makes sense to close the resources in doCommand(String, File, String). Perhaps use  try-with-resources.
> 3. In getJavaVersion(), the way I read it
> 3.1. VER9 will be returned for versions 16 or more, which is strange
> 3.2. For version 11, the return value will be 210 = 100 + 11*10
> 3.3. I would think just parsing the string with regex would give more transparent code
>
> Shura
>
>> On Oct 23, 2018, at 1:20 PM, Leonid Kuskov <Leonid.Kuskov at Oracle.com> wrote:
>>
>> Please review and push the cosmetic fix for the
>>
>> Issue: https://bugs.openjdk.java.net/browse/CODETOOLS-7902337
>> Webrev: http://cr.openjdk.java.net/~lkuskov/7902337/webrev.00/
>>
>> Thanks,
>> Leonid
>>



More information about the jcov-dev mailing list