Promote ConsoleAnnotatorAggregator to try to fix Anonymous complaint
@@ -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);
}
/**
