Community
Participate
Working Groups
I often have code like: String b = "b"; log.info("a" + b + "c"); I can then use "Use MessageFormat for string concatenation" and I get log.info(MessageFormat.format("a{0}c", b)); But for log statements I would also like to have a quick assist feature which works for slf4j so I get log.info("a{}c", b);
I just wanted to note that basically all static code analysis tools (e.g. Sonar) will issue a warning when I write log.info("a" + b + "c"); And the quickfix for Eclipse only allows me to get log.info(MessageFormat.format("a{0}c", b)); So I have to edit that manually to log.info("a{}c", b); which is very error prone because in MessageFormat I use {number} but in the logging methods only {} is used. This might not seem like a big issue but I guess this is something which probably annoys every single Eclipse user who uses Sonar or similar tools.