1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-04 15:45:25 +02:00

Bug 314433 - [efs][testing] testDeleteSpecialCases runs into an NPE on Linux

This commit is contained in:
Martin Oberhuber 2010-05-26 20:04:27 +00:00
parent c4a073e7d2
commit bdd58cec35
2 changed files with 15 additions and 11 deletions

View file

@ -26,7 +26,7 @@ plugin@org.eclipse.rse.core=v201003151933,:pserver:anonymous:none@dev.eclipse.or
plugin@org.eclipse.rse.doc.isv=v201005221130,:pserver:anonymous:none@dev.eclipse.org:/cvsroot/dsdp,,org.eclipse.tm.rse/doc/org.eclipse.rse.doc.isv
plugin@org.eclipse.rse.doc.user=v200905272300,:pserver:anonymous:none@dev.eclipse.org:/cvsroot/dsdp,,org.eclipse.tm.rse/doc/org.eclipse.rse.doc.user
plugin@org.eclipse.rse.dstore.security=v201003010830,:pserver:anonymous:none@dev.eclipse.org:/cvsroot/dsdp,,org.eclipse.tm.rse/plugins/org.eclipse.rse.dstore.security
plugin@org.eclipse.rse.efs=v201005261830,:pserver:anonymous:none@dev.eclipse.org:/cvsroot/dsdp,,org.eclipse.tm.rse/plugins/org.eclipse.rse.efs
plugin@org.eclipse.rse.efs=v201005262000,:pserver:anonymous:none@dev.eclipse.org:/cvsroot/dsdp,,org.eclipse.tm.rse/plugins/org.eclipse.rse.efs
plugin@org.eclipse.rse.efs.ui=v201003010830,:pserver:anonymous:none@dev.eclipse.org:/cvsroot/dsdp,,org.eclipse.tm.rse/plugins/org.eclipse.rse.efs.ui
plugin@org.eclipse.rse.examples.daytime=v200905272300,:pserver:anonymous:none@dev.eclipse.org:/cvsroot/dsdp,,org.eclipse.tm.rse/examples/org.eclipse.rse.examples.daytime
plugin@org.eclipse.rse.examples.tutorial=v200905272300,:pserver:anonymous:none@dev.eclipse.org:/cvsroot/dsdp,,org.eclipse.tm.rse/examples/org.eclipse.rse.examples.tutorial

View file

@ -35,6 +35,7 @@
* David McKnight (IBM) - [291738] [efs] repeated queries to RSEFileStoreImpl.fetchInfo() in short time-span should be reduced
* Szymon Brandys (IBM) - [303092] [efs] RSE portion to deal with FileSystemResourceManager makes second call to efs provider on exception due to cancel
* Martin Oberhuber (Wind River) - [314496] [efs] Symlink target not reported
* Martin Oberhuber (Wind River) - [314433] [efs] NPE on openOutputStream to broken symlink
********************************************************************************/
package org.eclipse.rse.internal.efs;
@ -762,7 +763,14 @@ public class RSEFileStoreImpl extends FileStore
}
}
if (remoteFile.isFile()) {
if (remoteFile.isDirectory()) {
throw new CoreException(new Status(IStatus.ERROR,
Activator.getDefault().getBundle().getSymbolicName(),
EFS.ERROR_WRONG_TYPE,
Messages.CANNOT_OPEN_STREAM_ON_FOLDER, null));
} else {
//bug 314433: try opening the Stream even for non-existing items or symlinks
//since returning null violates the API contract - better throw an Exception.
try {
// Convert from EFS option constants to IFileService option constants
if ((options & EFS.APPEND) != 0) {
@ -777,15 +785,11 @@ public class RSEFileStoreImpl extends FileStore
rethrowCoreException(e, EFS.ERROR_WRITE);
}
}
else if (remoteFile.isDirectory()) {
throw new CoreException(new Status(IStatus.ERROR,
Activator.getDefault().getBundle().getSymbolicName(),
EFS.ERROR_WRONG_TYPE,
Messages.CANNOT_OPEN_STREAM_ON_FOLDER, null));
}
//Fallback: No file, no folder?
//TODO check what to do for symbolic links and other strange stuff
return null;
//file does not exist, apparently
//TODO use Java MessageFormat for embedding filename in message
throw new CoreException(new Status(IStatus.ERROR, Activator.getDefault().getBundle().getSymbolicName(),
// EFS.ERROR_NOT_EXISTS,
EFS.ERROR_WRITE, Messages.FILE_STORE_DOES_NOT_EXIST + ": " + toString(), null)); //$NON-NLS-1$
}
/*