Browse Source

Remove use of SortedSet.floor()

Its only available in Java 6, and JGit still supports Java 5.

Change-Id: I6c8fac06106ffe20ac8b4b595f34e027f2d29cc2
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
stable-0.9
Shawn O. Pearce 14 years ago
parent
commit
7b8e8df799
  1. 7
      org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/FileTreeIteratorWithTimeControl.java

7
org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/FileTreeIteratorWithTimeControl.java

@ -43,6 +43,7 @@
package org.eclipse.jgit.treewalk;
import java.io.File;
import java.util.SortedSet;
import java.util.TreeSet;
import org.eclipse.jgit.lib.ObjectReader;
@ -98,8 +99,8 @@ public class FileTreeIteratorWithTimeControl extends FileTreeIterator {
@Override
public long getEntryLastModified() {
Long cutOff = modTimes
.floor(Long.valueOf(super.getEntryLastModified()));
return (cutOff == null) ? 0 : cutOff;
Long cutOff = Long.valueOf(super.getEntryLastModified());
SortedSet<Long> head = modTimes.headSet(cutOff);
return head.isEmpty() ? 0 : head.last().longValue();
}
}

Loading…
Cancel
Save