Jiminey Cricket, people, he's not asking about the expression itself, he's asking why eclipse didn't generate a warning about it. And the answer is, eclipse just isn't terribly smart about warnings.
Expand 'Potential programming problems'.
Second option down is 'Assignment has no effect (eg. if (x = y)).
For me, that was set to 'ignore' by default, but you can change it to generate an error or a warning. The first thing I do when I setup a new Eclipse install is go through these check and crank most of them into errors. By default Eclipse's settings are quite permissive, but IMHO there's some super helpful ones in there (even if they're not *technically* errors at times).