walkmod-sonar-plugin icon indicating copy to clipboard operation
walkmod-sonar-plugin copied to clipboard

sonar:AddCurlyBrackets duplicates code inside a switch statement.

Open leukim opened this issue 8 years ago • 4 comments

Applying the transformation to a piece of code with a switch condition does not wrap up the whole code inside a case and duplicates the non-wrapped code inside the braces, effectively producing compilation errors (see attached screenshot) duplicated-code

leukim avatar Mar 31 '16 10:03 leukim

Hi, i am applying only AddCurlyBrackets transformation to file, but it hit the switch case part also and it removes all the code in side case. see below switchcaseissue

ekpatil avatar Jul 07 '16 10:07 ekpatil

Yes, in fact I am working on it right now :). It is true!

I will send a new update during this week.

rpau avatar Jul 07 '16 10:07 rpau

hey thanks!

ekpatil avatar Jul 07 '16 10:07 ekpatil

@rpau ,

I too facing the some issues with switch statement when using transformation : sonar:AddCurlyBrackets. See the attached screen shot. Some time it is adding the braces and some time the statements are repeating.

switch_case

switch_statement_repeating

Could you please help ?

Regards, Musthafa P K

pkmusthafa avatar Mar 13 '18 12:03 pkmusthafa