]> source.dussan.org Git - jgit.git/commitdiff
Remove use of SortedSet.floor() 93/1193/1
authorShawn O. Pearce <spearce@spearce.org>
Wed, 28 Jul 2010 21:40:09 +0000 (14:40 -0700)
committerShawn O. Pearce <spearce@spearce.org>
Wed, 28 Jul 2010 21:40:09 +0000 (14:40 -0700)
Its only available in Java 6, and JGit still supports Java 5.

Change-Id: I6c8fac06106ffe20ac8b4b595f34e027f2d29cc2
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/FileTreeIteratorWithTimeControl.java

index 3bfa4fb5724e928cae66c157c8bc94378ed11bd2..fc19321c0ae7844f4afad85f43cf194104fdaf60 100644 (file)
@@ -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();
        }
 }