Name: ###@###.### Date: 07/09/96
Compilation of the test below is failed because of wrong parse
of backslash and Unicode escape combination in string literals:
Test:
-----
// Ident: @(#)lex002.java 1.1 96/07/09
// Copyright 09 ÉÀÌ 1996 Sun Microsystems, Inc. All Rights Reserved
package javasoft.sqe.tests.java_spec.lex002;
import java.io.PrintStream;
// \\ and Unicode escapes in string literals.
class lex002 {
public static void main (String args []) {
System.exit(run(args,System.out));
}
public static int run(String args[],PrintStream out) {
String str [] = {"\\\\u005c", "\\\\"
};
for (int i = 0; i <= 1; i++) out.println (str [i]);
if (str[0].equals(str[1]))
return 0;
else
return 2;
}}
The error is that Unicode escape \\u005c after backslash is
not translated to the corresponding Unicode character \\.
See the section 3.2 Lexical Translations in the Java Language
Specification.
======================================================================