File tree Expand file tree Collapse file tree 5 files changed +10
-16
lines changed Expand file tree Collapse file tree 5 files changed +10
-16
lines changed Original file line number Diff line number Diff line change 31
31
import java .util .Locale ;
32
32
33
33
import org .cprover .CProver ;
34
+ import org .cprover .CProverString ;
34
35
35
36
/**
36
37
* The {@code Character} class wraps a value of the primitive
@@ -4653,7 +4654,8 @@ public String toString() {
4653
4654
* @since 1.4
4654
4655
*/
4655
4656
public static String toString (char c ) {
4656
- return String .valueOf (c );
4657
+ char data [] = {c };
4658
+ return CProverString .ofCharArray (data , 0 , 1 );
4657
4659
}
4658
4660
4659
4661
/**
Original file line number Diff line number Diff line change @@ -212,7 +212,7 @@ public final class Double extends Number implements Comparable<Double> {
212
212
*/
213
213
public static String toString (double d ) {
214
214
// return FloatingDecimal.toJavaFormatString(d);
215
- return String . valueOf (d );
215
+ return CProverString . toString (d );
216
216
}
217
217
218
218
/**
Original file line number Diff line number Diff line change 31
31
import sun .misc .FloatConsts ;
32
32
import sun .misc .DoubleConsts ;
33
33
import org .cprover .CProver ;
34
+ import org .cprover .CProverString ;
34
35
35
36
/**
36
37
* The {@code Float} class wraps a value of primitive type
@@ -204,14 +205,9 @@ public final class Float extends Number implements Comparable<Float> {
204
205
*
205
206
* @param f the float to be converted.
206
207
* @return a string representation of the argument.
207
- * @diffblue.noSupport
208
208
*/
209
209
public static String toString (float f ) {
210
- // DIFFBLUE MODEL LIBRARY
211
- // removed for compatibility with Java 9 and newer
212
- // return FloatingDecimal.toJavaFormatString(f);
213
- CProver .notModelled ();
214
- return CProver .nondetWithNullForNotModelled ();
210
+ return CProverString .toString (f );
215
211
}
216
212
217
213
/**
Original file line number Diff line number Diff line change @@ -120,9 +120,8 @@ public final class Integer extends Number implements Comparable<Integer> {
120
120
* @see java.lang.Character#MAX_RADIX
121
121
* @see java.lang.Character#MIN_RADIX
122
122
*/
123
- // DIFFBLUE MODEL LIBRARY: Handled internally by CBMC
124
123
public static String toString (int i , int radix ) {
125
- return CProver . nondetWithoutNullForNotModelled ( );
124
+ return CProverString . toString ( i , radix );
126
125
}
127
126
128
127
/**
@@ -288,10 +287,8 @@ public static String toBinaryString(int i) {
288
287
* @param i an integer to be converted.
289
288
* @return a string representation of the argument in base 10.
290
289
*/
291
- // DIFFBLUE MODEL LIBRARY: Handled internally by CBMC
292
290
public static String toString (int i ) {
293
- // this function is handled by cbmc internally
294
- return CProver .nondetWithoutNullForNotModelled ();
291
+ return CProverString .toString (i );
295
292
}
296
293
297
294
/**
Original file line number Diff line number Diff line change @@ -125,7 +125,7 @@ public final class Long extends Number implements Comparable<Long> {
125
125
* @see java.lang.Character#MIN_RADIX
126
126
*/
127
127
public static String toString (long i , int radix ) {
128
- return CProver . nondetWithoutNullForNotModelled ( );
128
+ return CProverString . toString ( i , radix );
129
129
}
130
130
131
131
/**
@@ -351,8 +351,7 @@ static String toUnsignedString0(long val, int shift) {
351
351
* @return a string representation of the argument in base 10.
352
352
*/
353
353
public static String toString (long i ) {
354
- // this function is handled by cbmc internally
355
- return CProver .nondetWithoutNullForNotModelled ();
354
+ return CProverString .toString (i );
356
355
}
357
356
358
357
/**
You can’t perform that action at this time.
0 commit comments