Some unit tests were failing under JDK1.2.2, because of bugs in the

source for JDK1.2.2 TreeMap and HashMap (they incorrectly return false
when a null value is removed from the collection views).


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130758 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
pjack 2002-08-12 18:00:46 +00:00
parent 9adb578a23
commit 7e650946d4
2 changed files with 25 additions and 8 deletions

View File

@ -1,7 +1,7 @@
/*
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/TestFastHashMap.java,v 1.6 2002/06/18 05:41:11 mas Exp $
* $Revision: 1.6 $
* $Date: 2002/06/18 05:41:11 $
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/TestFastHashMap.java,v 1.7 2002/08/12 18:00:46 pjack Exp $
* $Revision: 1.7 $
* $Date: 2002/08/12 18:00:46 $
*
* ====================================================================
*
@ -69,7 +69,7 @@ import java.util.Map;
/**
* @author <a href="mailto:jvanzyl@apache.org">Jason van Zyl</a>
* @version $Id: TestFastHashMap.java,v 1.6 2002/06/18 05:41:11 mas Exp $
* @version $Id: TestFastHashMap.java,v 1.7 2002/08/12 18:00:46 pjack Exp $
*/
public class TestFastHashMap extends TestMap
{
@ -94,4 +94,12 @@ public class TestFastHashMap extends TestMap
fhm.setFast(false);
return (fhm);
}
/**
* There is a bug in JDK1.2 HashMap; the keySet() will incorrectly
* return false when a null value is removed.
*/
public boolean useNullValue() {
return false;
}
}

View File

@ -1,7 +1,7 @@
/*
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/TestFastTreeMap.java,v 1.6 2002/06/18 05:35:58 mas Exp $
* $Revision: 1.6 $
* $Date: 2002/06/18 05:35:58 $
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/TestFastTreeMap.java,v 1.7 2002/08/12 18:00:46 pjack Exp $
* $Revision: 1.7 $
* $Date: 2002/08/12 18:00:46 $
*
* ====================================================================
*
@ -69,7 +69,7 @@ import java.util.TreeMap;
/**
* @author <a href="mailto:jvanzyl@apache.org">Jason van Zyl</a>
* @version $Id: TestFastTreeMap.java,v 1.6 2002/06/18 05:35:58 mas Exp $
* @version $Id: TestFastTreeMap.java,v 1.7 2002/08/12 18:00:46 pjack Exp $
*/
public class TestFastTreeMap extends TestTreeMap
{
@ -102,6 +102,15 @@ public class TestFastTreeMap extends TestTreeMap
return false;
}
/**
* There is a bug in JDK1.2.2 TreeMap; the keySet will incorrectly
* return false when a null value is removed
*/
public boolean useNullValue() {
return false;
}
public void setUp()
{
map = (TreeMap) makeEmptyMap();