Remove obsolete pre-Java 1.2 code

This commit is contained in:
Gary Gregory 2024-05-01 10:35:14 -04:00
parent f84e48c4d5
commit 1dc530e6fa
1 changed files with 3 additions and 14 deletions

View File

@ -503,17 +503,6 @@ public abstract class AbstractMapTest<K, V> extends AbstractObjectTest {
// the value equal to the value returned from the values iterator.
}
/**
* JDK1.2 has bugs in null handling of Maps, especially HashMap.Entry.toString
* This avoids nulls for JDK1.2
*/
private static final boolean JDK12;
static {
final String str = System.getProperty("java.version");
JDK12 = str.startsWith("1.2");
}
/**
* Creates a new Map Entry that is independent of the first and the map.
*/
@ -679,7 +668,7 @@ public abstract class AbstractMapTest<K, V> extends AbstractObjectTest {
@SuppressWarnings("unchecked")
public V[] getNewSampleValues() {
final Object[] result = {
isAllowNullValue() && !JDK12 && isAllowDuplicateValues() ? null : "newnonnullvalue",
isAllowNullValue() && isAllowDuplicateValues() ? null : "newnonnullvalue",
"newvalue",
isAllowDuplicateValues() ? "newvalue" : "newvalue2",
"newblahv", "newfoov", "newbarv", "newbazv", "newtmpv", "newgoshv",
@ -728,7 +717,7 @@ public abstract class AbstractMapTest<K, V> extends AbstractObjectTest {
"hello", "goodbye", "we'll", "see", "you", "all", "again",
"key",
"key2",
isAllowNullKey() && !JDK12 ? null : "nonnullkey"
isAllowNullKey() ? null : "nonnullkey"
};
return (K[]) result;
}
@ -747,7 +736,7 @@ public abstract class AbstractMapTest<K, V> extends AbstractObjectTest {
final Object[] result = {
"blahv", "foov", "barv", "bazv", "tmpv", "goshv", "gollyv", "geev",
"hellov", "goodbyev", "we'llv", "seev", "youv", "allv", "againv",
isAllowNullValue() && !JDK12 ? null : "nonnullvalue",
isAllowNullValue() ? null : "nonnullvalue",
"value",
isAllowDuplicateValues() ? "value" : "value2",
};