findbugs-slf4j icon indicating copy to clipboard operation
findbugs-slf4j copied to clipboard

New Detector for arrays, list

Open afrin216 opened this issue 8 years ago • 0 comments

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.

afrin216 avatar May 26 '17 18:05 afrin216