Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 04dd59c

Browse files
committed
handle String.valueOf()
1 parent daced34 commit 04dd59c

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

java2python/config/default.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@
209209
(r'\.getClass\(\)', '.__class__'),
210210
(r'\.getName\(\)', '.__name__'),
211211
(r'\.getInterfaces\(\)', '.__bases__'),
212-
#(r'String\.valueOf\((.*?)\)', r'str(\1)'),
212+
(r'String\.valueOf\((.*?)\)', r'str(\1)'),
213213
#(r'(\s)(\S*?)(\.toString\(\))', r'\1str(\2)'),
214214
]
215215

test/String0.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
class String0 {
2+
static void test(String s) {
3+
System.out.println(s);
4+
}
5+
6+
public static void main(String[] args) {
7+
test(String.valueOf(42));
8+
}
9+
}

0 commit comments

Comments
 (0)