On 10/5/2018 3:22 AM, Mark Thomas wrote:
On 05/10/18 10:42, Rémy Maucherat wrote:
On Fri, Oct 5, 2018 at 11:40 AM Mark Thomas <ma...@apache.org> wrote:
The Tomcat style is to always use { and } even for one line for clarity.
Due to the age of the code base, there are a mix of styles. Generally,
we try and move code towards the currently accepted style as we change it.
+1 a lack of { } is too big a possible bug source to ignore.
I just tried enabling the CheckStyle test for this. There were just
under three thousand errors.

I'm wondering if it is worth going through the code base fixing these.

On a related topic, I did notice several instance of the following:

if (a == b) ...
if (a == c) ...
if (a == d) ...

that could be more efficiently written as:

if (a == b) {
     ...
} else if (a == c) {
     ...
} else if (a == d) {
     ...
}

How do you feel about aligning the `else` with the `if`?  I think that it makes it much clearer which block it refers to, e.g.

if (a == b) {
    ...
}
else if (a == c) {
    ...
}
else if (a == d) {
    ...
}


Igal


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to