findbugs-slf4j
findbugs-slf4j copied to clipboard
New Detector for arrays, list
Since slf4j automatically adds square brackets to collections, arrays etc passed into the message within square brackets would result in two sets of square brackets.
Example:
final List<String> serviceClasses = Arrays.asList("a","b");
LOGGER.info("Found services [{}]", serviceClasses);
would result in final formatted having two sets of square brackets like Found services [["a","b"]]. It would be nice if we could detect this pattern of [{}] for collection and warn the user.