# 7065 Inspection 'if statement with identical branches' bad fix

When I selected "Collapse 'if' statement" on an 'if...else...' with identical branches, it collapsed the 'else...' part, but lost the curly braces:

Potentially more than a little dangerous!



Message was edited by:
Dave Lorde

5 comments
Comment actions Permalink

JIRA issue please?

Bas

Dave Lorde wrote:

When I selected "Collapse 'if' statement" on an 'if...else...' with identical branches, it collapsed the 'else...' part, but lost the curly braces:

     if (exitButton) {
>         doExit();
>     }
>     else if (cancelButton) {          doCancel1(); 
>         doCancel2();
>     }
>     else {
>         doCancel1(); 
>         doCancel2();
>     }       
> 
> // becomes this:
>     if (exitButton) {
>         doExit();
>     }
>     else if (cancelButton) {
>         doCancel1(); 
>         doCancel2();
>     }
>     else doCancel1(); 
>         doCancel2();]]>

Potentially more than a little dangerous!

0
Comment actions Permalink

Having serious problems accessing this and JIRA sites...

0
Comment actions Permalink

Yes, access seems a little flaky that last couple of days. I have submitted one for you:
http://www.jetbrains.net/jira/browse/IDEADEV-19429

Bas

0
Comment actions Permalink

And fixed it too.

Bas

0
Comment actions Permalink

Thanks Bas :)

0

Please sign in to leave a comment.