-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
1.4.1
-
x86
-
windows_2000
I used javac of j2sdk1.4.1 to compile the following codes:
public class comment {
public static void main(String argv[]) {
System.out.println("comment");
}
} //end comment
But the compiler complaint:
comment.java:5: unclosed comment
} //end comment
1 error
The more intesting thing is when I add a blank line after the whole source file, it is ok.
I think you may search a \n after // as the end of the comment, but if the comment locates at the last line of the file, it cause problem.
###@###.###
public class comment {
public static void main(String argv[]) {
System.out.println("comment");
}
} //end comment
But the compiler complaint:
comment.java:5: unclosed comment
} //end comment
1 error
The more intesting thing is when I add a blank line after the whole source file, it is ok.
I think you may search a \n after // as the end of the comment, but if the comment locates at the last line of the file, it cause problem.
###@###.###
- duplicates
-
JDK-4733858 REGRESSION: programs with unterminated // comment don't compile
- Resolved