mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-13 04:15:06 +00:00
Merge branch 'fix-enum-logging' of https://github.com/varkart/lombok into varkart-fix-enum-logging
This commit is contained in:
20 files changed
+287
-1
No files matched your search
@@ -20,6 +20,7 @@ Jan Matèrne <jhm@apache.org>
|
||||
Jan Rieke <it@janrieke.de>
|
||||
Jappe van der Hel <jappe.vanderhel@gmail.com>
|
||||
John Paul Taylor II <johnpaultaylorii@gmail.com>
|
||||
Karthik kathari <44122128+varkart@users.noreply.github.com>
|
||||
Kevin Chirls <kchirls@users.noreply.github.com>
|
||||
Liu DongMiao <liudongmiao@gmail.com>
|
||||
Luan Nico <luannico27@gmail.com>
|
||||
|
||||
@@ -80,7 +80,7 @@ public class HandleLog {
|
||||
return;
|
||||
}
|
||||
|
||||
if (useStatic && !isStaticAllowed(typeNode)) {
|
||||
if (!typeNode.isEnumType() && useStatic && !isStaticAllowed(typeNode)) {
|
||||
annotationNode.addError(framework.getAnnotationAsString() + " is not supported on non-static nested classes.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -12,3 +12,15 @@ class LoggerFloggerOuter {
|
||||
private static final com.google.common.flogger.FluentLogger log = com.google.common.flogger.FluentLogger.forEnclosingClass();
|
||||
}
|
||||
}
|
||||
enum LoggerFloggerWithEnum {
|
||||
CONSTANT;
|
||||
@java.lang.SuppressWarnings("all")
|
||||
private static final com.google.common.flogger.FluentLogger log = com.google.common.flogger.FluentLogger.forEnclosingClass();
|
||||
}
|
||||
class LoggerFloggerWithInnerEnum {
|
||||
enum Inner {
|
||||
CONSTANT;
|
||||
@java.lang.SuppressWarnings("all")
|
||||
private static final com.google.common.flogger.FluentLogger log = com.google.common.flogger.FluentLogger.forEnclosingClass();
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,18 @@ class LoggerJBossLogOuter {
|
||||
private static final org.jboss.logging.Logger log = org.jboss.logging.Logger.getLogger(Inner.class);
|
||||
}
|
||||
}
|
||||
enum LoggerJBossLogWithEnum {
|
||||
CONSTANT;
|
||||
@java.lang.SuppressWarnings("all")
|
||||
private static final org.jboss.logging.Logger log = org.jboss.logging.Logger.getLogger(LoggerJBossLogWithEnum.class);
|
||||
}
|
||||
class LoggerJBossLogWithInnerEnum {
|
||||
enum Inner {
|
||||
CONSTANT;
|
||||
@java.lang.SuppressWarnings("all")
|
||||
private static final org.jboss.logging.Logger log = org.jboss.logging.Logger.getLogger(Inner.class);
|
||||
}
|
||||
}
|
||||
|
||||
class LoggerJBossLogWithDifferentLoggerName {
|
||||
@java.lang.SuppressWarnings("all")
|
||||
|
||||
@@ -14,4 +14,17 @@ class LoggerJulWithStaticField {
|
||||
@java.lang.SuppressWarnings("all")
|
||||
private static final java.util.logging.Logger log = java.util.logging.Logger.getLogger(LoggerJulWithStaticField.TOPIC);
|
||||
static final String TOPIC = "StaticField";
|
||||
}
|
||||
enum LoggerJulWithEnum {
|
||||
CONSTANT;
|
||||
@java.lang.SuppressWarnings("all")
|
||||
private static final java.util.logging.Logger log = java.util.logging.Logger.getLogger(LoggerJulWithEnum.class.getName());
|
||||
}
|
||||
class LoggerJulWithInnerEnum {
|
||||
|
||||
enum Inner {
|
||||
CONSTANT;
|
||||
@java.lang.SuppressWarnings("all")
|
||||
private static final java.util.logging.Logger log = java.util.logging.Logger.getLogger(Inner.class.getName());
|
||||
}
|
||||
}
|
||||
@@ -15,3 +15,16 @@ class LoggerLog4jWithStaticField {
|
||||
private static final org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger(LoggerLog4jWithStaticField.TOPIC);
|
||||
static final String TOPIC = "StaticField";
|
||||
}
|
||||
enum LoggerLog4jWithEnum {
|
||||
CONSTANT;
|
||||
@java.lang.SuppressWarnings("all")
|
||||
private static final org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger(LoggerLog4jWithEnum.class);
|
||||
}
|
||||
class LoggerLog4jWithInnerEnum {
|
||||
|
||||
enum Inner {
|
||||
CONSTANT;
|
||||
@java.lang.SuppressWarnings("all")
|
||||
private static final org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger(Inner.class);
|
||||
}
|
||||
}
|
||||
@@ -15,4 +15,17 @@ class LoggerLog4j2WithStaticField {
|
||||
@java.lang.SuppressWarnings("all")
|
||||
private static final org.apache.logging.log4j.Logger log = org.apache.logging.log4j.LogManager.getLogger(LoggerLog4j2WithStaticField.TOPIC);
|
||||
static final String TOPIC = "StaticField";
|
||||
}
|
||||
enum LoggerLog4j2WithEnum {
|
||||
CONSTANT;
|
||||
@java.lang.SuppressWarnings("all")
|
||||
private static final org.apache.logging.log4j.Logger log = org.apache.logging.log4j.LogManager.getLogger(LoggerLog4j2WithEnum.class);
|
||||
}
|
||||
class LoggerLog4j2WithInnerEnum {
|
||||
|
||||
enum Inner {
|
||||
CONSTANT;
|
||||
@java.lang.SuppressWarnings("all")
|
||||
private static final org.apache.logging.log4j.Logger log = org.apache.logging.log4j.LogManager.getLogger(Inner.class);
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,18 @@ class LoggerSlf4jWithImport {
|
||||
@java.lang.SuppressWarnings("all")
|
||||
private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(LoggerSlf4jWithImport.class);
|
||||
}
|
||||
enum LoggerSlf4jWithEnum {
|
||||
CONSTANT;
|
||||
@java.lang.SuppressWarnings("all")
|
||||
private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(LoggerSlf4jWithEnum.class);
|
||||
}
|
||||
class LoggerSlf4jWithInnerEnum {
|
||||
enum Inner {
|
||||
CONSTANT;
|
||||
@java.lang.SuppressWarnings("all")
|
||||
private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(Inner.class);
|
||||
}
|
||||
}
|
||||
class LoggerSlf4jOuter {
|
||||
static class Inner {
|
||||
@java.lang.SuppressWarnings("all")
|
||||
|
||||
@@ -28,3 +28,26 @@ class LoggerFloggerOuter {
|
||||
super();
|
||||
}
|
||||
}
|
||||
@Flogger enum LoggerFloggerWithEnum {
|
||||
CONSTANT(),
|
||||
private static final com.google.common.flogger.FluentLogger log = com.google.common.flogger.FluentLogger.forEnclosingClass();
|
||||
<clinit>() {
|
||||
}
|
||||
LoggerFloggerWithEnum() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
class LoggerFloggerWithInnerEnum {
|
||||
@Flogger enum Inner {
|
||||
CONSTANT(),
|
||||
private static final com.google.common.flogger.FluentLogger log = com.google.common.flogger.FluentLogger.forEnclosingClass();
|
||||
<clinit>() {
|
||||
}
|
||||
Inner() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
LoggerFloggerWithInnerEnum() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
@@ -28,6 +28,29 @@ class LoggerJBossLogOuter {
|
||||
super();
|
||||
}
|
||||
}
|
||||
@JBossLog enum LoggerJBossLogWithEnum {
|
||||
CONSTANT(),
|
||||
private static final org.jboss.logging.Logger log = org.jboss.logging.Logger.getLogger(LoggerJBossLogWithEnum.class);
|
||||
<clinit>() {
|
||||
}
|
||||
LoggerJBossLogWithEnum() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
class LoggerJBossLogWithInnerEnum {
|
||||
@JBossLog enum Inner {
|
||||
CONSTANT(),
|
||||
private static final org.jboss.logging.Logger log = org.jboss.logging.Logger.getLogger(Inner.class);
|
||||
<clinit>() {
|
||||
}
|
||||
Inner() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
LoggerJBossLogWithInnerEnum() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
@JBossLog(topic = "DifferentLogger") class LoggerJBossLogWithDifferentLoggerName {
|
||||
private static final org.jboss.logging.Logger log = org.jboss.logging.Logger.getLogger("DifferentLogger");
|
||||
<clinit>() {
|
||||
|
||||
@@ -31,4 +31,27 @@ import lombok.extern.java.Log;
|
||||
LoggerJulWithStaticField() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
@Log enum LoggerJulWithEnum {
|
||||
CONSTANT(),
|
||||
private static final java.util.logging.Logger log = java.util.logging.Logger.getLogger(LoggerJulWithEnum.class.getName());
|
||||
<clinit>() {
|
||||
}
|
||||
LoggerJulWithEnum() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
class LoggerJulWithInnerEnum {
|
||||
@Log enum Inner {
|
||||
CONSTANT(),
|
||||
private static final java.util.logging.Logger log = java.util.logging.Logger.getLogger(Inner.class.getName());
|
||||
<clinit>() {
|
||||
}
|
||||
Inner() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
LoggerJulWithInnerEnum() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
@@ -31,4 +31,27 @@ import lombok.extern.log4j.Log4j;
|
||||
LoggerLog4jWithStaticField() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
@Log4j enum LoggerLog4jWithEnum {
|
||||
CONSTANT(),
|
||||
private static final org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger(LoggerLog4jWithEnum.class);
|
||||
<clinit>() {
|
||||
}
|
||||
LoggerLog4jWithEnum() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
class LoggerLog4jWithInnerEnum {
|
||||
@Log4j enum Inner {
|
||||
CONSTANT(),
|
||||
private static final org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger(Inner.class);
|
||||
<clinit>() {
|
||||
}
|
||||
Inner() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
LoggerLog4jWithInnerEnum() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
@@ -31,4 +31,27 @@ import lombok.extern.log4j.Log4j2;
|
||||
LoggerLog4j2WithStaticField() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
@Log4j2 enum LoggerLog4j2WithEnum {
|
||||
CONSTANT(),
|
||||
private static final org.apache.logging.log4j.Logger log = org.apache.logging.log4j.LogManager.getLogger(LoggerLog4j2WithEnum.class);
|
||||
<clinit>() {
|
||||
}
|
||||
LoggerLog4j2WithEnum() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
class LoggerLog4j2WithInnerEnum {
|
||||
@Log4j2 enum Inner {
|
||||
CONSTANT(),
|
||||
private static final org.apache.logging.log4j.Logger log = org.apache.logging.log4j.LogManager.getLogger(Inner.class);
|
||||
<clinit>() {
|
||||
}
|
||||
Inner() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
LoggerLog4j2WithInnerEnum() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,29 @@ import lombok.extern.slf4j.Slf4j;
|
||||
super();
|
||||
}
|
||||
}
|
||||
@Slf4j enum LoggerSlf4jWithEnum {
|
||||
CONSTANT(),
|
||||
private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(LoggerSlf4jWithEnum.class);
|
||||
<clinit>() {
|
||||
}
|
||||
LoggerSlf4jWithEnum() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
class LoggerSlf4jWithInnerEnum {
|
||||
@Slf4j enum Inner {
|
||||
CONSTANT(),
|
||||
private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(Inner.class);
|
||||
<clinit>() {
|
||||
}
|
||||
Inner() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
LoggerSlf4jWithInnerEnum() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
class LoggerSlf4jOuter {
|
||||
static @lombok.extern.slf4j.Slf4j class Inner {
|
||||
private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(Inner.class);
|
||||
|
||||
@@ -14,3 +14,15 @@ class LoggerFloggerOuter {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Flogger
|
||||
enum LoggerFloggerWithEnum {
|
||||
CONSTANT;
|
||||
}
|
||||
|
||||
class LoggerFloggerWithInnerEnum {
|
||||
@Flogger
|
||||
enum Inner {
|
||||
CONSTANT;
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,18 @@ class LoggerJBossLogOuter {
|
||||
}
|
||||
}
|
||||
|
||||
@JBossLog
|
||||
enum LoggerJBossLogWithEnum {
|
||||
CONSTANT;
|
||||
}
|
||||
|
||||
class LoggerJBossLogWithInnerEnum {
|
||||
@JBossLog
|
||||
enum Inner {
|
||||
CONSTANT;
|
||||
}
|
||||
}
|
||||
|
||||
@JBossLog(topic="DifferentLogger")
|
||||
class LoggerJBossLogWithDifferentLoggerName {
|
||||
}
|
||||
|
||||
@@ -15,4 +15,16 @@ class LoggerJulWithDifferentName {
|
||||
@Log(topic=LoggerJulWithStaticField.TOPIC)
|
||||
class LoggerJulWithStaticField {
|
||||
static final String TOPIC = "StaticField";
|
||||
}
|
||||
|
||||
@Log
|
||||
enum LoggerJulWithEnum {
|
||||
CONSTANT;
|
||||
}
|
||||
|
||||
class LoggerJulWithInnerEnum {
|
||||
@Log
|
||||
enum Inner {
|
||||
CONSTANT;
|
||||
}
|
||||
}
|
||||
@@ -15,4 +15,16 @@ class LoggerLog4jWithDifferentName {
|
||||
@Log4j(topic=LoggerLog4jWithStaticField.TOPIC)
|
||||
class LoggerLog4jWithStaticField {
|
||||
static final String TOPIC = "StaticField";
|
||||
}
|
||||
|
||||
@Log4j
|
||||
enum LoggerLog4jWithEnum {
|
||||
CONSTANT;
|
||||
}
|
||||
|
||||
class LoggerLog4jWithInnerEnum {
|
||||
@Log4j
|
||||
enum Inner {
|
||||
CONSTANT;
|
||||
}
|
||||
}
|
||||
@@ -16,4 +16,16 @@ class LoggerLog4j2WithDifferentName {
|
||||
@Log4j2(topic=LoggerLog4j2WithStaticField.TOPIC)
|
||||
class LoggerLog4j2WithStaticField {
|
||||
static final String TOPIC = "StaticField";
|
||||
}
|
||||
|
||||
@Log4j2
|
||||
enum LoggerLog4j2WithEnum {
|
||||
CONSTANT;
|
||||
}
|
||||
|
||||
class LoggerLog4j2WithInnerEnum {
|
||||
@Log4j2
|
||||
enum Inner {
|
||||
CONSTANT;
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,18 @@ class LoggerSlf4j {
|
||||
class LoggerSlf4jWithImport {
|
||||
}
|
||||
|
||||
@Slf4j
|
||||
enum LoggerSlf4jWithEnum {
|
||||
CONSTANT;
|
||||
}
|
||||
|
||||
class LoggerSlf4jWithInnerEnum {
|
||||
@Slf4j
|
||||
enum Inner {
|
||||
CONSTANT;
|
||||
}
|
||||
}
|
||||
|
||||
class LoggerSlf4jOuter {
|
||||
@lombok.extern.slf4j.Slf4j
|
||||
static class Inner {
|
||||
|
||||
Reference in new issue
Block a user