# 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

0
5 comments
Avatar
Permanently deleted user

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) { <------ Collapse 'if' statement here
>         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
Avatar
Permanently deleted user

Having serious problems accessing this and JIRA sites...

0

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

And fixed it too.

Bas

0
Avatar
Permanently deleted user

Thanks Bas :)

0

Please sign in to leave a comment.