提交 f60c5c20 编写于 作者: K kohsuke

bug fix. map is sorted in the descending order.


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@2616 71c3de6d-444a-0410-be80-ed276b4c234a
上级 a301c005
......@@ -322,9 +322,9 @@ public abstract class Job<JobT extends Job<JobT,RunT>, RunT extends Run<JobT,Run
* gone (deleted, rotated, etc.)
*/
public RunT getNearestBuild(int n) {
SortedMap<Integer, ? extends RunT> m = _getRuns().tailMap(n);
SortedMap<Integer, ? extends RunT> m = _getRuns().headMap(n);
if(m.isEmpty()) return null;
return m.get(m.firstKey());
return m.get(m.lastKey());
}
public Object getDynamic(String token, StaplerRequest req, StaplerResponse rsp) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册