Skip to content

Commit 6580285

Browse files
committed
Add String valueOf overloads to clean translator stubs
1 parent 33d956d commit 6580285

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

vm/tests/src/test/java/com/codename1/tools/translator/ReadWriteLockIntegrationTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,12 @@ private void writeMockJavaClasses(Path sourceDir) throws Exception {
155155
" public String(char[] v) { value = v; count=v.length; }\n" +
156156
" public String(char[] v, int off, int len) { value = v; offset = off; count = len; }\n" +
157157
" public static String valueOf(Object obj) { return obj == null ? \"null\" : obj.toString(); }\n" +
158+
" public static String valueOf(int i) { return new String(new char[0]); }\n" +
159+
" public static String valueOf(long i) { return new String(new char[0]); }\n" +
160+
" public static String valueOf(boolean b) { return new String(new char[0]); }\n" +
161+
" public static String valueOf(char c) { return new String(new char[]{c}); }\n" +
162+
" public static String valueOf(float f) { return new String(new char[0]); }\n" +
163+
" public static String valueOf(double d) { return new String(new char[0]); }\n" +
158164
" public byte[] getBytes() { return new byte[0]; }\n" +
159165
" public byte[] getBytes(String charset) { return new byte[0]; }\n" +
160166
" public void getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin) {\n" +

vm/tests/src/test/java/com/codename1/tools/translator/StampedLockIntegrationTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,12 @@ private void writeMockJavaClasses(Path sourceDir) throws Exception {
164164
" public String(char[] v) { value = v; count=v.length; }\n" +
165165
" public String(char[] v, int off, int len) { value = v; offset = off; count = len; }\n" +
166166
" public static String valueOf(Object obj) { return obj == null ? \"null\" : obj.toString(); }\n" +
167+
" public static String valueOf(int i) { return new String(new char[0]); }\n" +
168+
" public static String valueOf(long i) { return new String(new char[0]); }\n" +
169+
" public static String valueOf(boolean b) { return new String(new char[0]); }\n" +
170+
" public static String valueOf(char c) { return new String(new char[]{c}); }\n" +
171+
" public static String valueOf(float f) { return new String(new char[0]); }\n" +
172+
" public static String valueOf(double d) { return new String(new char[0]); }\n" +
167173
" public byte[] getBytes() { return new byte[0]; }\n" +
168174
" public byte[] getBytes(String charset) { return new byte[0]; }\n" +
169175
" public void getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin) {\n" +

0 commit comments

Comments
 (0)