Checkstyle complains about the following:
return (null == a ? a : new A());
and says the parens are unnecessary.
While the statement certainly works fine without them, it seems far more readable with them present---otherwise as I'm reading it I tend to see:
return null
first and then have to pause to consider the remaining
== a ? a : new A();
part, since my brain has already gone down one path.
Furthermore, I tend to do the same thing whenever I see a ternary operator, unless it is grouped in parens.
So: should parens around the ternary be the de facto standard? Is there ever any reason to not put them there?