We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 14a2d50 commit f1e4b91Copy full SHA for f1e4b91
src/net/sf/j2s/core/astvisitors/ASTVariableVisitor.java
@@ -204,6 +204,20 @@ protected String checkConstantValue(Expression node) {
204
}
205
return buffer.toString();
206
207
+ if (constValue != null && (constValue instanceof String)) {
208
+ StringBuffer buffer = new StringBuffer();
209
+ String str = (String) constValue;
210
+ if (str.length() > 20) {
211
+ return null;
212
+ }
213
+ buffer.append("\"");
214
+ buffer.append(str.replaceAll("\\\\", "\\\\\\\\")
215
+ .replaceAll("\r", "\\\\r")
216
+ .replaceAll("\n", "\\\\n")
217
+ .replaceAll("\"", "\\\\\""));
218
219
+ return buffer.toString();
220
221
return null;
222
223
0 commit comments