Skip to main content

Removed unused local variable (Sonar)

sonar:java/remove-unused-local-variable-s1481​

ImportanceReview GuidanceRequires Scanning Tool
LOWMerge Without ReviewYes (Sonar)

This change removes unused variables. Unused variables make the code harder to read, which will lead to confusion and bugs. We only remove variables that have no state-changing effects.

Our changes look something like this:

     catch (final UnsolvedSymbolException e) {
- String errorMessage = "An unexpected exception happened";
LOG.error("Problem resolving type of : {}", expr, e);
return false;
}

References​