Built-in string formatting vs string concatenation as logging parameter
I'm using SonarLint that shows me an issue in the following line. LOGGER.debug("Comparing objects: " + object1 + " and " + object2); Side-note: The method that contains this line might get called quite often. The description for this issue is "Preconditions" and logging arguments should not require evaluation (squid:S2629) Passing message arguments that require further evaluation into a Guava com.google.common.base.Preconditions check can result in a performance penalty. That's because whether or not they're needed, each argument must be resolved before the method is actually called. Similarly