Re: RFR(XXS): 8242485: Null _file checking in fileStream::flush()

Denghui Dong denghui.ddh at
Sat Apr 11 15:52:55 UTC 2020

Thank you for the review and point out other methods need to check _file.
In addition to "fileStream::flush", I found there are still four methods need to check _file in fileStream: read, readln, eof, rewind.
but those methods will crash if _file is NULL, and I didn't find any caller of them(Maybe I am wrong),
so I think it's more appropriate to add assert check to those methods.


Could you review it again, and sponsor it if everything is okay?

Testing: teir1
Test summary
   TEST                                              TOTAL  PASS  FAIL ERROR
   jtreg:test/hotspot/jtreg:tier1                     1516  1516     0     0
   jtreg:test/jdk:tier1                               1904  1904     0     0
>> jtreg:test/langtools:tier1                         4031  4029     2     0 <<
   jtreg:test/nashorn:tier1                              0     0     0     0
   jtreg:test/jaxp:tier1                                 0     0     0     0
There are two unrelated test failures in langtools: jdk/javadoc/tool/  and tools/javac/processing/model/ 

From:Yasumasa Suenaga <suenaga at>
Send Time:2020年4月11日(星期六) 09:22
To:董登辉(卓昂) <denghui.ddh at>; hotspot-dev <hotspot-dev at>; hotspot-runtime-dev at <hotspot-runtime-dev at>
Subject:Re: RFR(XXS): 8242485: Null _file checking in fileStream::flush()

Hi Denghui,

null check lacks in other place too.
Can you fix it?



On 2020/04/10 21:34, Denghui Dong wrote:
> Hi team,
> Could you please review this small patch?
> JBS:
> webrev:
> I found the method "fileStream::flush()" lacks null check before fflush  which will cause
> all open output streams are flushed by fflush() if _file is NULL.
> Thanks,
> Denghui Dong

More information about the hotspot-runtime-dev mailing list