Enable compiliation under JDK1.5

git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@131803 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Stephen Colebourne 2004-06-26 10:00:42 +00:00
parent ac06284e5a
commit 27bc1f9d45
1 changed files with 13 additions and 13 deletions

View File

@ -50,7 +50,7 @@ import org.apache.commons.collections.collection.UnmodifiableCollection;
* @author Phil Steitz * @author Phil Steitz
* @author Steven Melzer * @author Steven Melzer
* *
* @version $Revision: 1.38 $ $Date: 2004/04/27 20:00:18 $ * @version $Revision: 1.39 $ $Date: 2004/06/26 10:00:42 $
*/ */
public class TestCollectionUtils extends TestCase { public class TestCollectionUtils extends TestCase {
@ -530,16 +530,16 @@ public class TestCollectionUtils extends TestCase {
// Enumeration, entry exists // Enumeration, entry exists
Vector vector = new Vector(list); Vector vector = new Vector(list);
Enumeration enum = vector.elements(); Enumeration en = vector.elements();
test = CollectionUtils.index(enum,0); test = CollectionUtils.index(en,0);
assertTrue(test.equals("zero")); assertTrue(test.equals("zero"));
enum = vector.elements(); en = vector.elements();
test = CollectionUtils.index(enum,1); test = CollectionUtils.index(en,1);
assertTrue(test.equals("one")); assertTrue(test.equals("one"));
// Enumeration, non-existent entry -- "dead" enumerator returned // Enumeration, non-existent entry -- "dead" enumerator returned
test = CollectionUtils.index(enum,3); test = CollectionUtils.index(en,3);
assertTrue(test.equals(enum) && !enum.hasMoreElements()); assertTrue(test.equals(en) && !en.hasMoreElements());
// Collection, entry exists // Collection, entry exists
Bag bag = new HashBag(); Bag bag = new HashBag();
@ -652,19 +652,19 @@ public class TestCollectionUtils extends TestCase {
Vector vector = new Vector(); Vector vector = new Vector();
vector.addElement("zero"); vector.addElement("zero");
vector.addElement("one"); vector.addElement("one");
Enumeration enum = vector.elements(); Enumeration en = vector.elements();
assertEquals("zero",CollectionUtils.get(enum,0)); assertEquals("zero",CollectionUtils.get(en,0));
enum = vector.elements(); en = vector.elements();
assertEquals("one",CollectionUtils.get(enum,1)); assertEquals("one",CollectionUtils.get(en,1));
// Enumerator, non-existent entry // Enumerator, non-existent entry
try { try {
CollectionUtils.get(enum,3); CollectionUtils.get(en,3);
fail("Expecting IndexOutOfBoundsException."); fail("Expecting IndexOutOfBoundsException.");
} catch (IndexOutOfBoundsException e) { } catch (IndexOutOfBoundsException e) {
// expected // expected
} }
assertTrue(!enum.hasMoreElements()); assertTrue(!en.hasMoreElements());
} }
{ {