RFR [14]: 8227438: [TESTLIB] Determine if file exists by Files.exists in function FileUtils.deleteFileIfExistsWithRetry

Frank Yuan frank.yuan at oracle.com
Mon Jul 15 09:56:34 UTC 2019


Thank you, Joe and Lance!

Pushed the change.


Frank

> -----Original Message-----
> From: Joe Wang [mailto:huizhe.wang at oracle.com]
> Subject: Re: RFR [14]: 8227438: [TESTLIB] Determine if file exists by Files.exists in function FileUtils.deleteFileIfExistsWithRetry
> 
> +1
> 
> -Joe
> 
> 
> On 7/11/19 11:32 PM, Frank Yuan wrote:
> > Hi
> >
> >
> >
> > Would you like to review the following patch for
> >
> > Bug: https://bugs.openjdk.java.net/browse/JDK-8227438
> >
> >
> >
> > --- a/test/lib/jdk/test/lib/util/FileUtils.java      Thu Jul 11 15:58:54 2019 +0000
> >
> > +++ b/test/lib/jdk/test/lib/util/FileUtils.java   Fri Jul 12 13:33:30 2019 +0800
> >
> > @@ -96,7 +96,7 @@
> >
> >        */
> >
> >       public static void deleteFileIfExistsWithRetry(Path path) throws IOException {
> >
> >           try {
> >
> > -            if (Files.exists(path)) {
> >
> > +            if (!Files.notExists(path)) {
> >
> >                   deleteFileWithRetry0(path);
> >
> >               }
> >
> >           } catch (InterruptedException x) {
> >
> >
> >
> >
> >
> > Files.exists returns false if the existence cannot be determined, so replace it with "!Files.notExists" like the change in
> > JDK-8184961.
> >
> >
> >
> > Thanks
> >
> > Frank
> >
> >
> >




More information about the core-libs-dev mailing list