提交 d9e4e36f 编写于 作者: S Stephen Connolly

fix build

上级 fc79e104
......@@ -115,8 +115,8 @@ public abstract class Label extends Actionable implements Comparable<Label>, Mod
}
@Override
protected boolean matches(SubTask item) {
final Label l = item.getAssignedLabel();
protected boolean matches(Queue.Item item, SubTask subTask) {
final Label l = item.getAssignedLabelFor(subTask);
return l != null && Label.this.matches(l.name);
}
};
......
......@@ -24,7 +24,6 @@
package hudson.model;
import hudson.Extension;
import hudson.Util;
import hudson.model.MultiStageTimeSeries.TimeScale;
import hudson.model.MultiStageTimeSeries.TrendChart;
import hudson.model.queue.SubTask;
......@@ -310,11 +309,12 @@ public abstract class LoadStatistics {
/**
* Returns {@code true} is the specified {@link SubTask} from the {@link Queue} should be counted.
* @param item the {@link SubTask}
* @param item the {@link Queue.Item} that the {@link SubTask belongs to}
* @param subTask the {@link SubTask}
* @return {@code true} IFF the specified {@link SubTask} from the {@link Queue} should be counted.
* @since 1.607
*/
protected abstract boolean matches(SubTask item);
protected abstract boolean matches(Queue.Item item, SubTask subTask);
/**
* Computes a self-consistent snapshot of the load statistics.
......@@ -355,8 +355,9 @@ public abstract class LoadStatistics {
int q = 0;
if (queue != null) {
for (Queue.BuildableItem item : queue) {
for (SubTask st : item.task.getSubTasks()) {
if (matches(st))
if (matches(item, st))
q++;
}
}
......
......@@ -75,7 +75,7 @@ public class OverallLoadStatistics extends LoadStatistics {
}
@Override
protected boolean matches(SubTask item) {
protected boolean matches(Queue.Item item, SubTask subTask) {
return true;
}
......
......@@ -28,15 +28,12 @@ import hudson.model.LoadStatistics;
import hudson.model.Node;
import hudson.model.Node.Mode;
import hudson.model.OverallLoadStatistics;
import hudson.model.Queue;
import hudson.model.Queue.Task;
import hudson.model.queue.SubTask;
import hudson.util.Iterators;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.NoSuchElementException;
import java.util.Set;
/**
* {@link LoadStatistics} that track the "free roam" jobs (whose {@link Task#getAssignedLabel()} is null)
......@@ -90,8 +87,8 @@ public class UnlabeledLoadStatistics extends LoadStatistics {
}
@Override
protected boolean matches(SubTask item) {
return true;
protected boolean matches(Queue.Item item, SubTask subTask) {
return item.getAssignedLabelFor(subTask) == null;
}
private static class UnlabeledNodesIterable implements Iterable<Node> {
......
......@@ -64,7 +64,7 @@ public class LoadStatisticsTest {
}
@Override
protected boolean matches(SubTask item) {
protected boolean matches(Queue.Item item, SubTask subTask) {
throw new UnsupportedOperationException();
}
};
......@@ -129,7 +129,7 @@ public class LoadStatisticsTest {
}
@Override
protected boolean matches(SubTask item) {
protected boolean matches(Queue.Item item, SubTask subTask) {
return false;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册