Duplicate code blocks?

Using SonarQube version 6.7.5, using Sonar Way with no modifications.

Sonar is reporting duplicated lines of code (the lines marked with a | in parseFPL_FT are supposedly duplicated by the lines marked with a | in parseAircraft_wake):
‘’’
protected void parseFPL_FT( String line )
{
| String t = “SCHEDULED”;
| switch ( line )
| {
| case “S”:
| t = “SCHEDULED”;
| break;
| case “N”:
| t = “NOT_SCHEDULED”;
| break;
| case “G”:
| t = “GENERAL”;
| break;
| case “M”:
| t = “MILITARY”;
| break;
case “X”:
t = “OTHER”;
break;
default:
warnings.add( "Unknown flight type: " + line );
}
fp.setFlightType( t );
}

and

protected void parseAircraft_wake( String line )
{
| String t = “MEDIUM”;
| switch ( line )
| {
| case “H”:
| t = “HEAVY”;
| break;
| case “M”:
| t = “MEDIUM”;
| break;
| case “L”:
| t = “LIGHT”;
| break;
| case “J”:
| t = “SUPER”;
| break;
default:
warnings.add( "Unknown Wake/Turbulence Category: " + line );
}
fp.setWakeTurbulenceCategory( t );
}
‘’’

Any clue why? I can see that the variable in the switch statement is the same, and the variable being set inside the various case clauses is the same. But, the switches have dramatically different entries and there are even a different number of entries.

Where do I go from here?

Hi,

String contents are ignored in duplication calculation. That’s why these come out as duplicates.

I know this isn’t the answer you wanted, but…

 
HTH,
Ann