File tree 1 file changed +26
-4
lines changed
1 file changed +26
-4
lines changed Original file line number Diff line number Diff line change @@ -1390,11 +1390,33 @@ public byte[] getBytes() {
1390
1390
* @see #equalsIgnoreCase(String)
1391
1391
*
1392
1392
* @diffblue.fullSupport
1393
- * @diffblue.untested
1394
1393
*/
1395
1394
public boolean equals (Object anObject ) {
1396
- // DIFFBLUE MODEL LIBRARY This is treated internally in CBMC
1397
- return CProver .nondetBoolean ();
1395
+ // if (this == anObject) {
1396
+ // return true;
1397
+ // }
1398
+ // if (anObject instanceof String) {
1399
+ // String anotherString = (String)anObject;
1400
+ // int n = value.length;
1401
+ // if (n == anotherString.value.length) {
1402
+ // char v1[] = value;
1403
+ // char v2[] = anotherString.value;
1404
+ // int i = 0;
1405
+ // while (n-- != 0) {
1406
+ // if (v1[i] != v2[i])
1407
+ // return false;
1408
+ // i++;
1409
+ // }
1410
+ // return true;
1411
+ // }
1412
+ // }
1413
+ // return false;
1414
+
1415
+ // DIFFBLUE MODEL LIBRARY Use CProverString function
1416
+ if (anObject instanceof String ) {
1417
+ return CProverString .equals ((String ) anObject , this );
1418
+ }
1419
+ return false ;
1398
1420
}
1399
1421
1400
1422
/**
@@ -1611,7 +1633,7 @@ public int compareTo(String anotherString) {
1611
1633
// DIFFBLUE MODEL LIBRARY For some reason this needs to be not null for
1612
1634
// FileReader tests to pass.
1613
1635
public static final Comparator <String > CASE_INSENSITIVE_ORDER
1614
- = CProver . nondetWithoutNullForNotModelled () ;
1636
+ = null ;
1615
1637
// DIFFBLUE MODEL LIBRARY Not needed for modelling
1616
1638
// private static class CaseInsensitiveComparator
1617
1639
// implements Comparator<String>, java.io.Serializable {
You can’t perform that action at this time.
0 commit comments