Community
Participate
Working Groups
+++ This bug was initially created as a clone of Bug #314439 +++ Build ID: TM 3.2rc2 on Linux-GTK-RHEL-4 Found when debugging RSEFileStoreTest#testDeleteSpecialCases() : Using the RSE "local" file system to try and delete an existing folder that has no permissions at all throws a NullPointerException. Example: mkdir nonAccessible chmod 0 nonAccessible LocalFileService.delete(nonAccessible); because java.io.File#listFiles() returns null in this case, this results in an NPE: Exception in tearDown.deleteTestStore: java.lang.NullPointerException at org.eclipse.rse.internal.services.local.files.LocalFileService.deleteContents(LocalFileService.java:1104) at org.eclipse.rse.internal.services.local.files.LocalFileService.delete(LocalFileService.java:1068) at org.eclipse.rse.subsystems.files.core.servicesubsystem.FileServiceSubSystem.delete(FileServiceSubSystem.java:975) at org.eclipse.rse.internal.efs.RSEFileStoreImpl.delete(RSEFileStoreImpl.java:797) at org.eclipse.rse.internal.efs.RSEFileStore.delete(RSEFileStore.java:362) at org.eclipse.rse.tests.subsystems.files.RSEFileStoreTest.tearDown(RSEFileStoreTest.java:174)
Created attachment 169990 [details] trivial patch Attached trivial patch fixes the issue. With the fix, an exception is now reported as expected instead of the NPE: Exception in tearDown.deleteTestStore: org.eclipse.core.runtime.CoreException: Failed to delete: /folk/mober/rseTest1274877741316: rse://LOCALHOST/folk/mober/rseTest1274877741316 at org.eclipse.rse.internal.efs.RSEFileStoreImpl.rethrowCoreException(RSEFileStoreImpl.java:629) at org.eclipse.rse.internal.efs.RSEFileStoreImpl.delete(RSEFileStoreImpl.java:803) at org.eclipse.rse.internal.efs.RSEFileStore.delete(RSEFileStore.java:362) at org.eclipse.rse.tests.subsystems.files.RSEFileStoreTest.tearDown(RSEFileStoreTest.java:174) Caused by: org.eclipse.rse.services.clientserver.messages.SystemOperationFailedException: Failed to delete: /folk/mober/rseTest1274877741316 at org.eclipse.rse.internal.services.local.files.LocalFileService.delete(LocalFileService.java:1081) at org.eclipse.rse.subsystems.files.core.servicesubsystem.FileServiceSubSystem.delete(FileServiceSubSystem.java:975)
Dave can you review this trivial fix please?
Released > I20100526.