Community
Participate
Working Groups
3.1 to prevent bugs like: int i= ... i =+ j; //most likely a BUG - should be i += j eclipse could warn on usages of the unary + operator (or just warn about =+)
Should be trivial to add.
How frequent is it ? i.e. compiler job or some static analysis engine ?
Created attachment 148659 [details] Proposed fix + regression tests
>Proposed fix + regression tests It looks like this is already in HEAD. Please revert it. This diagnose doesn't make much sense and code like: i= 0; j= +1; k= -1; is most likely intentional. If at all, then we should only warn for "=+<spaces>" and "=-<spaces>" patterns but that's overkill and would be strange as it depends on formatting. I checked all the source in my big workspace and there's not a single occurrence of that pattern. This is a WONTFIX.
(In reply to comment #4) I agree, we should no bloat the list of options with this.
I'll revert the patch.
(In reply to comment #4) > >Proposed fix + regression tests > It looks like this is already in HEAD. Please revert it. This diagnose doesn't > make much sense and code like: > > i= 0; > j= +1; > k= -1; If you write code like this, then you simply keep the warning off. The warning could have been useful for cases like in comment 0. Anyway I'll revert the fix.
Verified for 3.6M3