So if you want to sneak in a back door, all you need is the right excuse to put some unicode escapes in a block comment, and you can hide your code in plain sight.
Something like:
https://gist.github.com/anonymous/f33c1e392193a9ec30dcc5b31d...
I tried this in Eclipse, and the one saving grace is that while the basic syntax highlighting doesn't pick up on most of the de-commented part, the code intel seems to do an actual parse, and does a very subtle highlighting of "someService". (Edit: After reopening the file, that highlight is gone and it looks like a normal comment).
But if I saw that, I think I'd just assume the syntax coloring was messing up. And of course, if I'm looking at the code in GitHub, it will look just like a normal comment.
I feel the sudden urge to test every Java syntax highlighter in use and file lots of issues.
Since the escape sequences have to be handled everywhere, it seems unlikely that this will ever be fixed completely, but I hope that something will be done about it.
In 2001.
I added a pingback to this thread to the bug, along with some general encouragement that fixing this is a wise idea.
Given that they're prefixed with //, why does the sequence get interpreted at all? IIRC "///[star]" does not open a block comment.
EDIT: oh! That's what the 0x0a is for -- it's a line feed, which puts the /[star] onto the next line. Sneaky.
EDIT2: hmmmm HN formatting... had to replace my asterisks with [star] because it was just italicizing everything in between.
In [2]: u"\u000A\u002F\u002A"
Out[2]: u'\n/*'
It appears java will interpret the inline escaped unicode, which is hiding a block comment.http://stackoverflow.com/questions/4448180/why-does-java-per...
//
/*See this classic example: http://stackoverflow.com/questions/20383687/how-it-is-possib...
\u000A\u002F\u002A
bytes? This sequence appears multiple times, but is commented out in both languages' interpretations.