#111 find obsolete braces

release_3.4
closed
Check (274)
5
2012-10-10
2002-11-07
Lars Kühne
No

we should find obsolete braces as in

if ((x == 0)) {
doStuff();
}

or

x = (y + 1);

Probably what I mean above is to find braces around
toplevel expressions.

Maybe it's also a good idea to be able to find braces
that are obsolete but try to make the code easier to
read, as in

x = (a * b) + (c * d);

Note that reporting those braces conflicts with the Sun
conventions at
http://java.sun.com/docs/codeconv/html/CodeConventions.doc9.html#331
so it should be configurable (or be a separate check)

Discussion

  • Logged In: YES
    user_id=746148

    754910 (Identify redundant brackets) was closed as duplicate
    of this rfe

     
  • Logged In: YES
    user_id=746148

    Implementation committed to CVS for 3.4 (module
    UnnecessaryParentheses)