From 7b8e8df7995400637469d08baab2ee1af5537831 Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Wed, 28 Jul 2010 14:40:09 -0700 Subject: [PATCH] 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 --- .../jgit/treewalk/FileTreeIteratorWithTimeControl.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/FileTreeIteratorWithTimeControl.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/FileTreeIteratorWithTimeControl.java index 3bfa4fb572..fc19321c0a 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/FileTreeIteratorWithTimeControl.java +++ b/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 head = modTimes.headSet(cutOff); + return head.isEmpty() ? 0 : head.last().longValue(); } } -- 2.39.5