1

The following code:

final String INVALID_ESCAPE="\\";
System.out.println(String.format("'%s' -> '%s'", INVALID_ESCAPE, 
    StringEscapeUtils.unescapeJava(INVALID_ESCAPE)));

... produces:

'\' -> ''

on the console. Since '\' is not a valid escape I would expect an Exception at runtime. Am I missing anything?

UPDATE: filled a bug(?) report in Apache jira

Marcus Junius Brutus
  • 26,087
  • 41
  • 189
  • 331
  • I would suggest you either file a bug at https://issues.apache.org/jira/browse/LANG or post to the mailing list. Somebody should soon be able to inform you what the intended purpose of the method is and whether you've discovered a bug. – Duncan Jones Apr 15 '13 at 14:56

1 Answers1

2

From the source:

// TODO: throw "illegal character: \92" as an Exception if a \ on the end of the Java (as per the compiler)?

Send a patch ;-)

forty-two
  • 12,204
  • 2
  • 26
  • 36