Skip to content

Commit

Permalink
Remove obsolete pre-Java 1.2 code
Browse files Browse the repository at this point in the history
  • Loading branch information
garydgregory committed May 1, 2024
1 parent f84e48c commit 1dc530e
Showing 1 changed file with 3 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -503,17 +503,6 @@ public void verify() {
// 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.
*/
Expand Down Expand Up @@ -679,7 +668,7 @@ public Map<K, V> getMap() {
@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",
Expand Down Expand Up @@ -728,7 +717,7 @@ public K[] getSampleKeys() {
"hello", "goodbye", "we'll", "see", "you", "all", "again",
"key",
"key2",
isAllowNullKey() && !JDK12 ? null : "nonnullkey"
isAllowNullKey() ? null : "nonnullkey"
};
return (K[]) result;
}
Expand All @@ -747,7 +736,7 @@ public V[] getSampleValues() {
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",
};
Expand Down

0 comments on commit 1dc530e

Please sign in to comment.