mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-26 02:15:31 +02:00
Bug 314433 - [efs][testing] testDeleteSpecialCases runs into an NPE on Linux
This commit is contained in:
parent
c4a073e7d2
commit
bdd58cec35
2 changed files with 15 additions and 11 deletions
|
@ -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.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.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.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.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.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
|
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
|
||||||
|
|
|
@ -35,6 +35,7 @@
|
||||||
* David McKnight (IBM) - [291738] [efs] repeated queries to RSEFileStoreImpl.fetchInfo() in short time-span should be reduced
|
* 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
|
* 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) - [314496] [efs] Symlink target not reported
|
||||||
|
* Martin Oberhuber (Wind River) - [314433] [efs] NPE on openOutputStream to broken symlink
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.rse.internal.efs;
|
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 {
|
try {
|
||||||
// Convert from EFS option constants to IFileService option constants
|
// Convert from EFS option constants to IFileService option constants
|
||||||
if ((options & EFS.APPEND) != 0) {
|
if ((options & EFS.APPEND) != 0) {
|
||||||
|
@ -777,15 +785,11 @@ public class RSEFileStoreImpl extends FileStore
|
||||||
rethrowCoreException(e, EFS.ERROR_WRITE);
|
rethrowCoreException(e, EFS.ERROR_WRITE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (remoteFile.isDirectory()) {
|
//file does not exist, apparently
|
||||||
throw new CoreException(new Status(IStatus.ERROR,
|
//TODO use Java MessageFormat for embedding filename in message
|
||||||
Activator.getDefault().getBundle().getSymbolicName(),
|
throw new CoreException(new Status(IStatus.ERROR, Activator.getDefault().getBundle().getSymbolicName(),
|
||||||
EFS.ERROR_WRONG_TYPE,
|
// EFS.ERROR_NOT_EXISTS,
|
||||||
Messages.CANNOT_OPEN_STREAM_ON_FOLDER, null));
|
EFS.ERROR_WRITE, Messages.FILE_STORE_DOES_NOT_EXIST + ": " + toString(), null)); //$NON-NLS-1$
|
||||||
}
|
|
||||||
//Fallback: No file, no folder?
|
|
||||||
//TODO check what to do for symbolic links and other strange stuff
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Reference in a new issue