src/java.base/share/classes/java/util/jar/Attributes.java

Print this page
rev 13827 : 8151384: Examine sun.misc.ASCIICaseInsensitiveComparator
Reviewed-by:

*** 34,44 **** import java.util.Collection; import java.util.AbstractSet; import java.util.Iterator; import sun.util.logging.PlatformLogger; import java.util.Comparator; - import sun.misc.ASCIICaseInsensitiveComparator; /** * The Attributes class maps Manifest attribute names to associated string * values. Valid attribute names are case-insensitive, are restricted to * the ASCII characters in the set [0-9a-zA-Z_-], and cannot exceed 70 --- 34,43 ----
*** 499,509 **** * @return true if this attribute name is equal to the * specified attribute object */ public boolean equals(Object o) { if (o instanceof Name) { ! Comparator<String> c = ASCIICaseInsensitiveComparator.CASE_INSENSITIVE_ORDER; return c.compare(name, ((Name)o).name) == 0; } else { return false; } } --- 498,508 ---- * @return true if this attribute name is equal to the * specified attribute object */ public boolean equals(Object o) { if (o instanceof Name) { ! Comparator<String> c = String.CASE_INSENSITIVE_ORDER; return c.compare(name, ((Name)o).name) == 0; } else { return false; } }
*** 511,521 **** /** * Computes the hash value for this attribute name. */ public int hashCode() { if (hashCode == -1) { ! hashCode = ASCIICaseInsensitiveComparator.lowerCaseHashCode(name); } return hashCode; } /** --- 510,520 ---- /** * Computes the hash value for this attribute name. */ public int hashCode() { if (hashCode == -1) { ! hashCode = name.toLowerCase().hashCode(); } return hashCode; } /**