@@ -596,7 +596,7 @@ public File getAbsoluteFile() {
596596 * @since JDK1.1
597597 */
598598 public String getCanonicalPath () throws IOException {
599- return this .path ;
599+ return this .path . replace ( '\\' , '/' ) ;
600600// return fs.canonicalize(fs.resolve(this));
601601 }
602602
@@ -1951,23 +1951,28 @@ public boolean equals(Object obj) {
19511951 return false ;
19521952 }
19531953
1954- // /**
1955- // * Computes a hash code for this abstract pathname. Because equality of
1956- // * abstract pathnames is inherently system-dependent, so is the computation
1957- // * of their hash codes. On UNIX systems, the hash code of an abstract
1958- // * pathname is equal to the exclusive <em>or</em> of the hash code
1959- // * of its pathname string and the decimal value
1960- // * <code>1234321</code>. On Microsoft Windows systems, the hash
1961- // * code is equal to the exclusive <em>or</em> of the hash code of
1962- // * its pathname string converted to lower case and the decimal
1963- // * value <code>1234321</code>. Locale is not taken into account on
1964- // * lowercasing the pathname string.
1965- // *
1966- // * @return A hash code for this abstract pathname
1967- // */
1968- // public int hashCode() {
1954+ /**
1955+ * Computes a hash code for this abstract pathname. Because equality of
1956+ * abstract pathnames is inherently system-dependent, so is the computation
1957+ * of their hash codes. On UNIX systems, the hash code of an abstract
1958+ * pathname is equal to the exclusive <em>or</em> of the hash code
1959+ * of its pathname string and the decimal value
1960+ * <code>1234321</code>. On Microsoft Windows systems, the hash
1961+ * code is equal to the exclusive <em>or</em> of the hash code of
1962+ * its pathname string converted to lower case and the decimal
1963+ * value <code>1234321</code>. Locale is not taken into account on
1964+ * lowercasing the pathname string.
1965+ *
1966+ * @return A hash code for this abstract pathname
1967+ */
1968+ public int hashCode () {
1969+ try {
1970+ return this .getCanonicalPath ().hashCode () | 1234321 ;
1971+ } catch (IOException e ) {
1972+ return 0 ;
1973+ }
19691974// return fs.hashCode(this);
1970- // }
1975+ }
19711976
19721977 /**
19731978 * Returns the pathname string of this abstract pathname. This is just the
0 commit comments