Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit dee9c7f

Browse files
committedAug 16, 2019
Replace CProverString.insert functions by models
The String version and the String.valueOf functions should be enough to model all of them.
1 parent ca0c926 commit dee9c7f

File tree

2 files changed

+6
-90
lines changed

2 files changed

+6
-90
lines changed
 

‎src/main/java/java/lang/StringBuilder.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ public StringBuilder insert(int offset, boolean b) {
487487
// return this;
488488
if ((offset < 0) || (offset > length()))
489489
throw new StringIndexOutOfBoundsException(offset);
490-
return CProverString.insert(this, offset, b);
490+
return CProverString.insert(this, offset, String.valueOf(b));
491491
}
492492

493493
/**
@@ -502,7 +502,7 @@ public StringBuilder insert(int offset, char c) {
502502
// return this;
503503
if ((offset < 0) || (offset > length()))
504504
throw new IndexOutOfBoundsException();
505-
return CProverString.insert(this, offset, c);
505+
return CProverString.insert(this, offset, String.valueOf(c));
506506
}
507507

508508
/**
@@ -517,7 +517,7 @@ public StringBuilder insert(int offset, int i) {
517517
// return this;
518518
if ((offset < 0) || (offset > length()))
519519
throw new StringIndexOutOfBoundsException(offset);
520-
return CProverString.insert(this, offset, i);
520+
return CProverString.insert(this, offset, String.valueOf(i));
521521
}
522522

523523
/**
@@ -533,7 +533,7 @@ public StringBuilder insert(int offset, long l) {
533533
// return this;
534534
if ((offset < 0) || (offset > length()))
535535
throw new StringIndexOutOfBoundsException(offset);
536-
return CProverString.insert(this, offset, l);
536+
return CProverString.insert(this, offset, String.valueOf(l));
537537
}
538538

539539
/**
@@ -549,7 +549,7 @@ public StringBuilder insert(int offset, float f) {
549549
// return this;
550550
if ((offset < 0) || (offset > length()))
551551
throw new StringIndexOutOfBoundsException(offset);
552-
return CProverString.insert(this, offset, f);
552+
return CProverString.insert(this, offset, String.valueOf(f));
553553
}
554554

555555
/**
@@ -567,7 +567,7 @@ public StringBuilder insert(int offset, double d) {
567567
// return this;
568568
if ((offset < 0) || (offset > length()))
569569
throw new StringIndexOutOfBoundsException(offset);
570-
return CProverString.insert(this, offset, d);
570+
return CProverString.insert(this, offset, String.valueOf(d));
571571
}
572572

573573
/**

‎src/main/java/org/cprover/CProverString.java

Lines changed: 0 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -172,90 +172,6 @@ public static StringBuilder insert(
172172
return CProver.nondetWithoutNullForNotModelled();
173173
}
174174

175-
/**
176-
* Inserts the string representation of the {@code boolean}
177-
* argument into this sequence.
178-
*
179-
* @param instance the StringBuilder instance
180-
* @param offset the offset.
181-
* @param b a {@code boolean}.
182-
* @return the modified StringBuilder.
183-
*/
184-
public static StringBuilder insert(
185-
StringBuilder instance, int offset, boolean b) {
186-
return CProver.nondetWithoutNullForNotModelled();
187-
}
188-
189-
/**
190-
* Inserts the string representation of the {@code char}
191-
* argument into this sequence.
192-
*
193-
* @param instance the StringBuilder instance
194-
* @param offset the offset.
195-
* @param c a {@code char}.
196-
* @return the modified StringBuilder.
197-
*/
198-
public static StringBuilder insert(
199-
StringBuilder instance, int offset, char c) {
200-
return CProver.nondetWithoutNullForNotModelled();
201-
}
202-
203-
/**
204-
* Inserts the string representation of the {@code int}
205-
* argument into this sequence.
206-
*
207-
* @param instance the StringBuilder instance
208-
* @param offset the offset.
209-
* @param i a {@code int}.
210-
* @return the modified StringBuilder.
211-
*/
212-
public static StringBuilder insert(
213-
StringBuilder instance, int offset, int i) {
214-
return CProver.nondetWithoutNullForNotModelled();
215-
}
216-
217-
/**
218-
* Inserts the string representation of the {@code long}
219-
* argument into this sequence.
220-
*
221-
* @param instance the StringBuilder instance
222-
* @param offset the offset.
223-
* @param l a {@code long}.
224-
* @return the modified StringBuilder.
225-
*/
226-
public static StringBuilder insert(
227-
StringBuilder instance, int offset, long l) {
228-
return CProver.nondetWithoutNullForNotModelled();
229-
}
230-
231-
/**
232-
* Inserts the string representation of the {@code float}
233-
* argument into this sequence.
234-
*
235-
* @param instance the StringBuilder instance
236-
* @param offset the offset.
237-
* @param f a {@code float}.
238-
* @return the modified StringBuilder.
239-
*/
240-
public static StringBuilder insert(
241-
StringBuilder instance, int offset, float f) {
242-
return CProver.nondetWithoutNullForNotModelled();
243-
}
244-
245-
/**
246-
* Inserts the string representation of the {@code double}
247-
* argument into this sequence.
248-
*
249-
* @param instance the StringBuilder instance
250-
* @param offset the offset.
251-
* @param d a {@code double}.
252-
* @return the modified StringBuilder.
253-
*/
254-
public static StringBuilder insert(
255-
StringBuilder instance, int offset, double d) {
256-
return CProver.nondetWithoutNullForNotModelled();
257-
}
258-
259175
/**
260176
* Sets the length of the character sequence.
261177
*

0 commit comments

Comments
 (0)
Please sign in to comment.