Evil bug :)

I post it here instead of in Jira, because it's plain evil, in a funny way :).

Imagine you have this code:


This code won't compile, but Intelli doesn't report an error about it. What happens, is that \u000A is interpreted by the Java compiler as a newline, thus producing the following code:


This, ofcourse, does not compile. It would be nice if IntelliJ would mark this as an error!

Erik

5 comments

Hello,

This one from Java Puzzles :)
And this is not a bug :)

0

The realy bug this '\n' in IntelliJ IDEA, is here:
Type string with '\n', copy it into clipboard, paste it.

0

Correct :)

Okay, this may not be a bug, but more of a feature request than, to correctly identify this as being Illegal?

Or a least give an error about the text after the unicode character? The JDK does the same.

0

Ah, nice bug! Never noticed it!

0

Not sure, that JDK (javac, i guess) make this checking.

0

Please sign in to leave a comment.