src/share/classes/java/lang/String.java

Print this page

        

*** 1490,1500 **** * * @return a hash code value for this object. */ public int hashCode() { int h = hash; ! if (h == 0) { int off = offset; char val[] = value; int len = count; for (int i = 0; i < len; i++) { --- 1490,1500 ---- * * @return a hash code value for this object. */ public int hashCode() { int h = hash; ! if (h == 0 && count > 0) { int off = offset; char val[] = value; int len = count; for (int i = 0; i < len; i++) {