Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions src/main/java/java/lang/StringBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -611,14 +611,22 @@ public int lastIndexOf(String str, int fromIndex) {
}

/**
* @diffblue.noSupport
* @diffblue.fullSupport
* @diffblue.untested
*/
@Override
public StringBuilder reverse() {
// super.reverse();
// return this;
CProver.notModelled();
return CProver.nondetWithNullForNotModelled();
int size = this.length();
if (size < 2)
return this;
String tmp = this.toString();
CProverString.delete(this, 0, size);
for (int i=size-1; i>=0; --i) {
this.append(CProverString.charAt(tmp, i));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 this will create a lot of intermediary strings which could be avoided using one nondetString and then assume on each character, but otherwise it looks fine.

}
return this;
}

/**
Expand Down