--- old/src/share/classes/java/net/HttpCookie.java 2011-05-02 11:30:06.000000000 -0700 +++ new/src/share/classes/java/net/HttpCookie.java 2011-05-02 11:30:05.000000000 -0700 @@ -34,6 +34,7 @@ import java.lang.NullPointerException; // for javadoc import java.util.Locale; +import java.util.Objects; /** * An HttpCookie object represents an http cookie, which carries state @@ -817,7 +818,7 @@ // 3. and have same path (case-sensitive). return equalsIgnoreCase(getName(), other.getName()) && equalsIgnoreCase(getDomain(), other.getDomain()) && - equals(getPath(), other.getPath()); + Objects.equals(getPath(), other.getPath()); } @@ -1162,14 +1163,6 @@ return false; } - private static boolean equals(String s, String t) { - if (s == t) return true; - if ((s != null) && (t != null)) { - return s.equals(t); - } - return false; - } - private static boolean startsWithIgnoreCase(String s, String start) { if (s == null || start == null) return false;