Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Suspicious code in CodeFormatterVisitor.java

Hi Sergey,
 
I can't remember exactly what has led to this code. I guess I was a little confused by the JDT pendant.
In any case I agree that the condition can be reduced to !statementIsNullStmt, because null statements
should be kept on the same line as the previous statement and that's independent of the previous statement.
 
Thanks,
Toni


From: sprigogin@xxxxxxxxxx [mailto:sprigogin@xxxxxxxxxx] On Behalf Of Sergey Prigogin
Sent: Friday, January 28, 2011 8:34 PM
To: CDT General developers list.; Leherbauer, Anton (Toni)
Subject: Suspicious code in CodeFormatterVisitor.java

CodeFormatterVisitor.formatStatements method contains two 'if' statements with a strange condition:

if ((previousStatementIsNullStmt && !statementIsNullStmt)
        || (!previousStatementIsNullStmt && !statementIsNullStmt)) {
    scribe.startNewLine();
}

As it currently stands, the condition can be reduced to just !statementIsNullStmt, but something else was probably intended. Toni, do you remember the original intension?

-sergey


Back to the top