Name: poR10007 Date: 04/14/2000
Javac incorrectly rejects ASCII SUB character in traditional
or documentation comments and admits it in single-line
comments. By the way, SUB character is usual and it is legal
for this character to appear within comments or a string
literal, for example.
Javac (JDK1.3.0A - JDK1.3.0Z) fails to compile the following
test while oldjavac successfully does:
-lex00804.java-------------------------------------------
public class lex00804 {
public static void main(String args[]) {
return;
}
}
/* \u001A */
-Compilation log-----------------------------------------
$ java -version
java version "1.3.0rc3"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0rc3-Z)
Java HotSpot(TM) Client VM (build 1.3.0rc3-Z, interpreted mode)
$ javac -d . lex00804.java
lex00804.java:6: unclosed comment
/* \u001A */
^
lex00804.java:6: illegal character: \26
/* \u001A */
^
lex00804.java:6: 'class' or 'interface' expected
/* \u001A */
^
3 errors
$ oldjavac -d . lex00804.java; echo $?
0
$
---------------------------------------------------------
======================================================================
- relates to
-
JDK-4209933 \u001a in String Literal
- Closed