From ac30065aab4341781d2807001a6d780bd1516746 Mon Sep 17 00:00:00 2001 From: "ray.j.greenwell" Date: Mon, 29 Mar 2010 21:49:25 +0000 Subject: [PATCH] Some more @ReplacedBy annotating. git-svn-id: https://samskivert.googlecode.com/svn/trunk@2763 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- src/java/com/samskivert/util/CollectionUtil.java | 6 ++++++ src/java/com/samskivert/util/Collections.java | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/src/java/com/samskivert/util/CollectionUtil.java b/src/java/com/samskivert/util/CollectionUtil.java index fa5c41a2..359e3192 100644 --- a/src/java/com/samskivert/util/CollectionUtil.java +++ b/src/java/com/samskivert/util/CollectionUtil.java @@ -28,6 +28,8 @@ import java.util.Enumeration; import java.util.Iterator; import java.util.List; +import com.samskivert.annotation.ReplacedBy; + /** * A collection of collection-related utility functions. */ @@ -49,6 +51,7 @@ public class CollectionUtil * Adds all items returned by the iterator to the supplied collection and * returns the supplied collection. */ + @ReplacedBy("com.google.common.collect.Iterators.addAll()") public static > C addAll (C col, Iterator iter) { while (iter.hasNext()) { @@ -62,6 +65,7 @@ public class CollectionUtil * returns the supplied collection. If the supplied array is null, nothing * is added to the collection. */ + @ReplacedBy("java.util.Collections.addAll()") public static > C addAll (C col, E[] values) { if (values != null) { @@ -152,6 +156,7 @@ public class CollectionUtil * Returns an Array, of the type specified by the runtime-type token type, * containing the elements of the collection. */ + @ReplacedBy("com.google.common.collect.Iterables.toArray()") public static T[] toArray (Collection col, Class type) { @SuppressWarnings("unchecked") @@ -169,6 +174,7 @@ public class CollectionUtil * order returned by the collection's iterator). The size of the array will * be equal to the size of the collection. */ + @ReplacedBy("com.google.common.primitives.Ints.toArray()") public static int[] toIntArray (Collection col) { Iterator iter = col.iterator(); diff --git a/src/java/com/samskivert/util/Collections.java b/src/java/com/samskivert/util/Collections.java index 56f831ff..ed44dbcf 100644 --- a/src/java/com/samskivert/util/Collections.java +++ b/src/java/com/samskivert/util/Collections.java @@ -22,6 +22,8 @@ package com.samskivert.util; import java.util.*; +import com.samskivert.annotation.ReplacedBy; + /** * Provides functionality for the samskivert collections that the java.util class of * the same name provides for the standard Java collections. Collections-related functionality that @@ -36,6 +38,7 @@ public class Collections * * @param metaIterable an iterable of Iterators. */ + @ReplacedBy("com.google.common.collect.Iterators.concat() or com.google.common.collect.Iterables.concat()") public static Iterator getMetaIterator (Iterable> metaIterable) { return new MetaIterator(metaIterable); @@ -136,6 +139,7 @@ public class Collections /** * Get an iterator that returns the same elements as the supplied iterator but blocks removal. */ + @ReplacedBy("com.google.common.collect.Iterators.unmodifiableIterator") public static Iterator getUnmodifiableIterator (final Iterator itr) { return new Iterator() {