There is an if judgment in the project that does not increase the parentheses, but there is a lot of logical processing behind it. This is not standard, but also cause the changes in the code will cause unnecessary trouble, so I will all the code over my hand, have been modified. Like what:
if (A) result = "Hello";
Do something
Modified to:
if (A) {result
= "Hello";
}
Do something
Concrete Project Code screenshot:
(in fact, it's also a violation of a method, preferably only a return principle)
In revising this question, I am afraid that the changes appear to be superfluous, the code appears to be sloppy, so I went to know and Oschina on the search, to see if the other people on whether or not to increase the brackets after the view that most of the results are: best to Add.
The reasons are broadly as follows:
1/For code specification, you should enlarge parentheses after if
2/If you need to declare a temporary variable after if, you need to add curly braces, otherwise the compilation will not pass
3/Have a friend said that Google's programming specification is to say if after must add (do not know true or false, also did not go to investigate)
4/Someone said that in order to modify the code after no ambiguity
Conclusion: In Java programming, you need to enlarge the parentheses after the IF. Conventions are better than configurations