File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -2087,13 +2087,10 @@ public boolean endsWith(String suffix) {
20872087 *
20882088 * @return a hash code value for this object.
20892089 *
2090- * @diffblue.limitedSupport
2091- * We guarantee that two strings with different hash code have different
2092- * content, but the exact value will not correspond to the actual one.
2090+ * @diffblue.fullSupport length of the string is limited by unwind value
20932091 */
20942092 public int hashCode () {
2095- // DIFFBLUE MODEL LIBRARY This is treated internally in CBMC
2096- return CProver .nondetInt ();
2093+ // DIFFBLUE MODEL LIBRARY
20972094 // int h = hash;
20982095 // if (h == 0 && value.length > 0) {
20992096 // char val[] = value;
@@ -2104,6 +2101,12 @@ public int hashCode() {
21042101 // hash = h;
21052102 // }
21062103 // return h;
2104+ int len = length ();
2105+ int h = 0 ;
2106+ for (int i = 0 ; i < len ; i ++) {
2107+ h = 31 * h + CProverString .charAt (this , i );
2108+ }
2109+ return h ;
21072110 }
21082111
21092112 /**
You can’t perform that action at this time.
0 commit comments