mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-26 10:25:32 +02:00
[199854] Fix regressions in unit tests
This commit is contained in:
parent
ad14cc2ddf
commit
128bc5d5f8
1 changed files with 16 additions and 14 deletions
|
@ -1207,6 +1207,7 @@ public class LocalFileService extends AbstractFileService implements ILocalServi
|
||||||
{
|
{
|
||||||
File sourceFolderOrFile = new File(srcParent, srcName);
|
File sourceFolderOrFile = new File(srcParent, srcName);
|
||||||
File targetFolder = new File(tgtParent, tgtName);
|
File targetFolder = new File(tgtParent, tgtName);
|
||||||
|
boolean movedOk = false;
|
||||||
boolean sourceIsVirtual = ArchiveHandlerManager.isVirtual(sourceFolderOrFile.getAbsolutePath());
|
boolean sourceIsVirtual = ArchiveHandlerManager.isVirtual(sourceFolderOrFile.getAbsolutePath());
|
||||||
boolean targetIsVirtual = ArchiveHandlerManager.isVirtual(targetFolder.getAbsolutePath());
|
boolean targetIsVirtual = ArchiveHandlerManager.isVirtual(targetFolder.getAbsolutePath());
|
||||||
boolean targetIsArchive = ArchiveHandlerManager.getInstance().isArchive(targetFolder);
|
boolean targetIsArchive = ArchiveHandlerManager.getInstance().isArchive(targetFolder);
|
||||||
|
@ -1219,16 +1220,16 @@ public class LocalFileService extends AbstractFileService implements ILocalServi
|
||||||
{
|
{
|
||||||
File fileToMove = new File(srcParent, srcName);
|
File fileToMove = new File(srcParent, srcName);
|
||||||
File newFile = new File(tgtParent, tgtName);
|
File newFile = new File(tgtParent, tgtName);
|
||||||
fileToMove.renameTo(newFile);
|
//Try plain Java Filesystem move first
|
||||||
return;
|
movedOk = fileToMove.renameTo(newFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
copy(srcParent, srcName, tgtParent, tgtName, monitor);
|
if (!movedOk)
|
||||||
try
|
|
||||||
{
|
{
|
||||||
|
copy(srcParent, srcName, tgtParent, tgtName, monitor);
|
||||||
|
try {
|
||||||
delete(srcParent, srcName, monitor);
|
delete(srcParent, srcName, monitor);
|
||||||
}
|
} catch (SystemMessageException exc)
|
||||||
catch (SystemMessageException exc)
|
|
||||||
{
|
{
|
||||||
if (monitor.isCanceled())
|
if (monitor.isCanceled())
|
||||||
{
|
{
|
||||||
|
@ -1240,6 +1241,7 @@ public class LocalFileService extends AbstractFileService implements ILocalServi
|
||||||
throw exc;
|
throw exc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void copy(String srcParent, String srcName, String tgtParent, String tgtName, IProgressMonitor monitor) throws SystemMessageException
|
public void copy(String srcParent, String srcName, String tgtParent, String tgtName, IProgressMonitor monitor) throws SystemMessageException
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue