Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Suggestion
I argue that logging statements should be exempted from this rule. An example is the repetition of:
logger.debug("This is unexpected. Bla bla bla");private static final String MESSAGE_THIS_IS_UNEXPECTED_BLA_BLA = "This is unexpected. Bla bla bla";
...
logger.debug(MESSAGE_THIS_IS_UNEXPECTED_BLA_BLA);--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/5ea942f4-83b9-47da-aac8-6c40952f0ef7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Senior Developer
--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/cddc03b3-0640-4c92-9e78-842a6cc64d18%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/1499442a-9f4e-4b9c-98bc-0db9eb1007e8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Senior Developer