Deprecated DSet.toArray. Pretending like arrays are parameterized collections

is a bad idea and will lead to pain. Nixed the one place where toArray was used
(which was a serous pig's breakfast itself).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6402 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2011-01-01 01:15:33 +00:00
parent 328ff30506
commit 1db66920d2
2 changed files with 46 additions and 46 deletions
@@ -243,22 +243,6 @@ public class DSet<E extends DSet.Entry>
};
}
/**
* Copies the elements of this distributed set into the supplied array. If the array is not
* large enough to hold all of the elements, as many as fit into the array will be copied. If
* the <code>array</code> argument is null, an object array of sufficient size to contain all
* of the elements of this set will be created and returned.
*/
public E[] toArray (E[] array)
{
if (array == null) {
@SuppressWarnings("unchecked") E[] copy = (E[])new Entry[size()];
array = copy;
}
System.arraycopy(_entries, 0, array, 0, array.length);
return array;
}
/**
* Creates an <b>immutable</b> view of this distributed set as a Java set.
*/
@@ -288,7 +272,28 @@ public class DSet<E extends DSet.Entry>
}
/**
* @deprecated use {@link #toArray(Entry[])}.
* Copies the elements of this distributed set into the supplied array. If the array is not
* large enough to hold all of the elements, as many as fit into the array will be copied. If
* the <code>array</code> argument is null, an object array of sufficient size to contain all
* of the elements of this set will be created and returned.
*
* @deprecated use {@link #clone} or add this to an {@link ArrayList}. Arrays are an untypesafe
* quagmire.
*/
@Deprecated
public E[] toArray (E[] array)
{
if (array == null) {
@SuppressWarnings("unchecked") E[] copy = (E[])new Entry[size()];
array = copy;
}
System.arraycopy(_entries, 0, array, 0, array.length);
return array;
}
/**
* @deprecated use {@link #clone} or add this to an {@link ArrayList}. Arrays are an untypesafe
* quagmire.
*/
@Deprecated
public Object[] toArray (Object[] array)