commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Menelaos Perdikeas (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (LANG-885) Apache commons StringEscapeUtils.unescapeJava(“\\”) returns “”
Date Mon, 15 Apr 2013 16:36:16 GMT

     [ https://issues.apache.org/jira/browse/LANG-885?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Menelaos Perdikeas updated LANG-885:
------------------------------------

    Description: 
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?


  was:
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?


    
> Apache commons StringEscapeUtils.unescapeJava(“\\”) returns “”
> --------------------------------------------------------------
>
>                 Key: LANG-885
>                 URL: https://issues.apache.org/jira/browse/LANG-885
>             Project: Commons Lang
>          Issue Type: Bug
>    Affects Versions: 3.1
>         Environment: Linux 3.2.0-40-generic-pae #64-Ubuntu SMP i686 athlon i386 GNU/Linux
>            Reporter: Menelaos Perdikeas
>            Priority: Minor
>
> 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?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message