Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Muskalla2010-07-30 15:51:49 +0000
committerBenjamin Muskalla2010-07-30 15:51:49 +0000
commit0b300c7cf16dbf3c6d5d504a54edc0f57b992ab7 (patch)
treee91fd4726c34cc31acdf964de85d6b0bde95aa93
parent96cf50208c3a3f916de42bef73eef273a17f0ff9 (diff)
downloadegit-0b300c7cf16dbf3c6d5d504a54edc0f57b992ab7.tar.gz
egit-0b300c7cf16dbf3c6d5d504a54edc0f57b992ab7.tar.xz
egit-0b300c7cf16dbf3c6d5d504a54edc0f57b992ab7.zip
Fixed deprecated API usage
Besides fixing the deprecated API call, also moved the sleep in AppOperationTest to a more reasonable location. For me, the tests failed most of the time as localTime and the timestamp in the repo were the same. I think it makes more sense to wait after the commit to have a time gap between commit and file change Change-Id: I3c481096f1b89f35b0b232fbcd8f4b1ad0d012fc Signed-off-by: Benjamin Muskalla <bmuskalla@eclipsesource.com>
-rw-r--r--org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/AddOperationTest.java3
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/AdaptableFileTreeIterator.java5
2 files changed, 4 insertions, 4 deletions
diff --git a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/AddOperationTest.java b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/AddOperationTest.java
index cd9ea0a50b..467120c715 100644
--- a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/AddOperationTest.java
+++ b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/AddOperationTest.java
@@ -136,6 +136,8 @@ public class AddOperationTest extends GitTestCase {
testRepository.lastModifiedInIndex(file1.getLocation()
.toPortableString()));
+ Thread.sleep(1000);
+
file1.setContents(
new ByteArrayInputStream("other text".getBytes(project.project
.getDefaultCharset())), 0, null);
@@ -143,7 +145,6 @@ public class AddOperationTest extends GitTestCase {
new ByteArrayInputStream("other text".getBytes(project.project
.getDefaultCharset())), 0, null);
- Thread.sleep(1000);
assertFalse(file1.getLocalTimeStamp() == testRepository
.lastModifiedInIndex(file1.getLocation().toPortableString()));
assertFalse(file2.getLocalTimeStamp() == testRepository
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/AdaptableFileTreeIterator.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/AdaptableFileTreeIterator.java
index 88a9af7f96..44cd5cdf39 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/AdaptableFileTreeIterator.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/AdaptableFileTreeIterator.java
@@ -14,7 +14,6 @@ import java.io.IOException;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.runtime.Path;
import org.eclipse.jgit.errors.IncorrectObjectTypeException;
import org.eclipse.jgit.lib.ObjectReader;
import org.eclipse.jgit.treewalk.AbstractTreeIterator;
@@ -79,8 +78,8 @@ public class AdaptableFileTreeIterator extends FileTreeIterator {
public AbstractTreeIterator createSubtreeIterator(ObjectReader repo)
throws IncorrectObjectTypeException, IOException {
final File currentFile = ((FileEntry) current()).getFile();
- final IContainer[] containers = root.findContainersForLocation(new Path(
- currentFile.getAbsolutePath()));
+ final IContainer[] containers = root
+ .findContainersForLocationURI(currentFile.toURI());
if (containers.length > 0)
return new ContainerTreeIterator(this, containers[0]);
else

Back to the top