RFR: 8220555: JFR tool shows incorrect message when it cannot access the file

Erik Gahlin erik.gahlin at oracle.com
Wed Mar 13 18:07:05 UTC 2019


Looks good.

According to the bug report, the following error message will printed if the file can’t be found. 

$ jfr print hs_err_pid4390.jfr 
jfr print: could not open file /home/ysuenaga/OpenJDK/jdk/hs_err_pid4390.jfr (No such file or directory) 

Which is reasonable.

Could you also describe what the the error message will be, if the the user lacks permission to access the file.

Thanks
Erik


> On 13 Mar 2019, at 08:46, Yasumasa Suenaga <yasuenag at gmail.com> wrote:
> 
> Hi all,
> 
> Please review this change:
> 
>  JBS: https://bugs.openjdk.java.net/browse/JDK-8220555
>  webrev: http://cr.openjdk.java.net/~ysuenaga/JDK-8220555/webrev.00/
> 
> JFR tool shows error message as "could not find file" when it receives
> FileNotFoundException from ctor of RandomAccessFile.
> According to Javadoc of RandomAccessFile [1], FileNotFoundException
> will be thrown when we do not be granted to access the file.
> Therefore, the error message misleads the user.
> 
> All tests on submit repo seems to be succeeded
> (mach5-one-ysuenaga-JDK-8220555-20190313-0612-1175783).
> Also it passed :jdk_jfr jtreg tests on my Linux box.
> 
> 
> Thanks,
> 
> Yasumasa
> 
> 
> [1] https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/io/RandomAccessFile.html#%3Cinit%3E(java.io.File,java.lang.String)



More information about the hotspot-jfr-dev mailing list