提交 c40a60e9 编写于 作者: J Josh Soref 提交者: Oleg Nenashev

[JENKINS-53177] - Promote ConsoleAnnotatorAggregator to try to fix Anonymous complaint (#3598)

JENKINS-53177
上级 c0d9fb75
......@@ -91,19 +91,10 @@ public abstract class ConsoleAnnotator<T> implements Serializable {
return (ConsoleAnnotator)a;
}
/**
* Bundles all the given {@link ConsoleAnnotator} into a single annotator.
*/
public static <T> ConsoleAnnotator<T> combine(Collection<? extends ConsoleAnnotator<? super T>> all) {
switch (all.size()) {
case 0: return null; // none
case 1: return cast(all.iterator().next()); // just one
}
class Aggregator extends ConsoleAnnotator<T> {
private static final class ConsoleAnnotatorAggregator<T> extends ConsoleAnnotator<T> {
List<ConsoleAnnotator<T>> list;
Aggregator(Collection list) {
ConsoleAnnotatorAggregator(Collection list) {
this.list = new ArrayList<ConsoleAnnotator<T>>(list);
}
......@@ -125,7 +116,17 @@ public abstract class ConsoleAnnotator<T> implements Serializable {
}
}
}
return new Aggregator(all);
/**
* Bundles all the given {@link ConsoleAnnotator} into a single annotator.
*/
public static <T> ConsoleAnnotator<T> combine(Collection<? extends ConsoleAnnotator<? super T>> all) {
switch (all.size()) {
case 0: return null; // none
case 1: return cast(all.iterator().next()); // just one
}
return new ConsoleAnnotatorAggregator<T>(all);
}
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册