GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||
GeezerVison is showing github.com — [java] Lombok: support all logger annotations by Pankraz76 · Pull Request #7242 · pmd/pmd Conversation
|
| Annotation | Type of log |
|---|---|
@Slf4j |
org.slf4j.Logger |
@XSlf4j |
org.slf4j.ext.XLogger |
@Log |
java.util.logging.Logger |
@Log4j |
org.apache.log4j.Logger |
@Log4j2 |
org.apache.logging.log4j.Logger |
@CommonsLog |
org.apache.commons.logging.Log |
@JBossLog |
org.jboss.logging.Logger |
@Flogger |
com.google.common.flogger.FluentLogger |
@CustomLog is not supported, as its type is configured in lombok.config.
ImplicitMemberSymbols#lombokSlf4jLoggerField is renamed to lombokLoggerField and takes the logger type (internal API).
./mvnw clean verify passes (checked automatically by github actions)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Besides @slf4j, also create the log field for @XSlf4j, @log, @log4j, @log4j2, @CommonsLog, @JBossLog and @flogger. @CustomLog is not supported, as its type is configured in lombok.config. Refs pmd#3119 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01PPz9uxrZpT8ysmD5A2Fgg5
There was an error while loading. Please reload this page.
|
Compared to main: (comment created at 2026-10-26 15:42:46+00:00 for 1fd8524) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| * | ||
| * @see <a href="https://projectlombok.org/features/log">Lombok @Log</a> | ||
| */ | ||
| private static final Map<String, String> LOMBOK_LOGGERS = CollectionUtil.buildMap(m -> { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I think these lombok changes are good and sensible. But we cannot keep piling this lombok-specific logic into AstClassSym.
I think we should extract this into a LombokUtil or something and also move there the parts of ImplicitMemberSymbols that are lombok-specific. Maybe we can do that in a followup PR though.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Thanks, good point. I did it right away in this PR instead of a follow-up:
LombokUtil (in symbols.internal.ast) now holds all Lombok-specific logic: the logger map, the logger field, the getter generation and the AccessLevel parsing.AstClassSym#processLombok now only delegates to LombokUtil.addLombokMembers(...).ImplicitMemberSymbols has no Lombok-specific code anymore. lombokLoggerField/lombokGetter are replaced by two generic factories, fakeField(...) and fakeMethod(...), which LombokUtil uses.No behaviour change, all tests are still green.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Move the lombok logger and getter handling out of AstClassSym and ImplicitMemberSymbols into a new package-private LombokUtil. ImplicitMemberSymbols now only offers the generic fakeField and fakeMethod factories. No behaviour change. Refs pmd#3119 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01PPz9uxrZpT8ysmD5A2Fgg5
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.