File tree Expand file tree Collapse file tree 8 files changed +38
-19
lines changed Expand file tree Collapse file tree 8 files changed +38
-19
lines changed Original file line number Diff line number Diff line change @@ -176,6 +176,8 @@ public static Boolean valueOf(String s) {
176
176
* @param b the boolean to be converted
177
177
* @return the string representation of the specified {@code boolean}
178
178
* @since 1.4
179
+ *
180
+ * @diffblue.fullSupport
179
181
*/
180
182
public static String toString (boolean b ) {
181
183
return b ? "true" : "false" ;
Original file line number Diff line number Diff line change 26
26
package java .lang ;
27
27
28
28
import org .cprover .CProver ;
29
+ import org .cprover .CProverString ;
29
30
30
31
/**
31
32
*
@@ -71,9 +72,11 @@ public final class Byte extends Number implements Comparable<Byte> {
71
72
* @param b the {@code byte} to be converted
72
73
* @return the string representation of the specified {@code byte}
73
74
* @see java.lang.Integer#toString(int)
75
+ *
76
+ * @diffblue.fullSupport
74
77
*/
75
78
public static String toString (byte b ) {
76
- return Integer .toString ((int )b , 10 );
79
+ return CProverString .toString ((int )b );
77
80
}
78
81
79
82
/**
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
@@ -4651,9 +4652,12 @@ public String toString() {
4651
4652
* @param c the {@code char} to be converted
4652
4653
* @return the string representation of the specified {@code char}
4653
4654
* @since 1.4
4655
+ *
4656
+ * @diffblue.fullSupport
4654
4657
*/
4655
4658
public static String toString (char c ) {
4656
- return String .valueOf (c );
4659
+ char data [] = {c };
4660
+ return CProverString .ofCharArray (data , 0 , 1 );
4657
4661
}
4658
4662
4659
4663
/**
Original file line number Diff line number Diff line change @@ -208,11 +208,14 @@ public final class Double extends Number implements Comparable<Double> {
208
208
*
209
209
* @param d the {@code double} to be converted.
210
210
* @return a string representation of the argument.
211
- * @diffblue.noSupport
211
+ *
212
+ * @diffblue.limitedSupport
213
+ * The precision in the produced string may not match that of the
214
+ * actual program.
212
215
*/
213
216
public static String toString (double d ) {
214
217
// return FloatingDecimal.toJavaFormatString(d);
215
- return String . valueOf (d );
218
+ return CProverString . toString (d );
216
219
}
217
220
218
221
/**
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,13 @@ 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
+ *
209
+ * @diffblue.limitedSupport
210
+ * The precision in the produced string may not match that of the
211
+ * actual program.
208
212
*/
209
213
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 ();
214
+ return CProverString .toString (f );
215
215
}
216
216
217
217
/**
Original file line number Diff line number Diff line change @@ -119,10 +119,11 @@ public final class Integer extends Number implements Comparable<Integer> {
119
119
* @return a string representation of the argument in the specified radix.
120
120
* @see java.lang.Character#MAX_RADIX
121
121
* @see java.lang.Character#MIN_RADIX
122
+ *
123
+ * @diffblue.fullSupport
122
124
*/
123
- // DIFFBLUE MODEL LIBRARY: Handled internally by CBMC
124
125
public static String toString (int i , int radix ) {
125
- return CProver . nondetWithoutNullForNotModelled ( );
126
+ return CProverString . toString ( i , radix );
126
127
}
127
128
128
129
/**
@@ -287,11 +288,11 @@ public static String toBinaryString(int i) {
287
288
*
288
289
* @param i an integer to be converted.
289
290
* @return a string representation of the argument in base 10.
291
+ *
292
+ * @diffblue.fullSupport
290
293
*/
291
- // DIFFBLUE MODEL LIBRARY: Handled internally by CBMC
292
294
public static String toString (int i ) {
293
- // this function is handled by cbmc internally
294
- return CProver .nondetWithoutNullForNotModelled ();
295
+ return CProverString .toString (i );
295
296
}
296
297
297
298
/**
Original file line number Diff line number Diff line change @@ -123,9 +123,11 @@ public final class Long extends Number implements Comparable<Long> {
123
123
* @return a string representation of the argument in the specified radix.
124
124
* @see java.lang.Character#MAX_RADIX
125
125
* @see java.lang.Character#MIN_RADIX
126
+ *
127
+ * @diffblue.fullSupport
126
128
*/
127
129
public static String toString (long i , int radix ) {
128
- return CProver . nondetWithoutNullForNotModelled ( );
130
+ return CProverString . toString ( i , radix );
129
131
}
130
132
131
133
/**
@@ -349,10 +351,11 @@ static String toUnsignedString0(long val, int shift) {
349
351
*
350
352
* @param i a {@code long} to be converted.
351
353
* @return a string representation of the argument in base 10.
354
+ *
355
+ * @diffblue.fullSupport
352
356
*/
353
357
public static String toString (long i ) {
354
- // this function is handled by cbmc internally
355
- return CProver .nondetWithoutNullForNotModelled ();
358
+ return CProverString .toString (i );
356
359
}
357
360
358
361
/**
Original file line number Diff line number Diff line change 26
26
package java .lang ;
27
27
28
28
import org .cprover .CProver ;
29
+ import org .cprover .CProverString ;
29
30
30
31
/**
31
32
* The {@code Short} class wraps a value of primitive type {@code
@@ -69,9 +70,11 @@ public final class Short extends Number implements Comparable<Short> {
69
70
* @param s the {@code short} to be converted
70
71
* @return the string representation of the specified {@code short}
71
72
* @see java.lang.Integer#toString(int)
73
+ *
74
+ * @diffblue.fullSupport
72
75
*/
73
76
public static String toString (short s ) {
74
- return Integer .toString ((int )s , 10 );
77
+ return CProverString .toString ((int )s );
75
78
}
76
79
77
80
/**
You can’t perform that action at this time.
0 commit comments