From 8a369f2f2c90fc9c4b961fbcb9653a2dfc631022 Mon Sep 17 00:00:00 2001 From: Brian Burkhalter Date: Fri, 31 Jul 2015 07:15:59 -0700 Subject: [PATCH] 8073078: java/nio/file/FileStore/Basic.java sensitive to NFS configuration Ignore NoSuchFileExceptions as the store might have been deleted subsequent to creation of the FileStore iterator which is not dynamic. Reviewed-by: alanb --- jdk/test/java/nio/file/FileStore/Basic.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/jdk/test/java/nio/file/FileStore/Basic.java b/jdk/test/java/nio/file/FileStore/Basic.java index 465f3f2a8d2..f81d3d95a8b 100644 --- a/jdk/test/java/nio/file/FileStore/Basic.java +++ b/jdk/test/java/nio/file/FileStore/Basic.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -116,9 +116,15 @@ public class Basic { store.type()); // check space attributes are accessible - store.getTotalSpace(); - store.getUnallocatedSpace(); - store.getUsableSpace(); + try { + store.getTotalSpace(); + store.getUnallocatedSpace(); + store.getUsableSpace(); + } catch (NoSuchFileException nsfe) { + // ignore exception as the store could have been + // deleted since the iterator was instantiated + System.err.format("%s was not found\n", store); + } // two distinct FileStores should not be equal assertTrue(!store.equals(prev));