From c38a64a5564996b552d88448bfb00722403bf194 Mon Sep 17 00:00:00 2001 From: Maarten Mulders Date: Fri, 7 Feb 2014 16:14:01 +0100 Subject: Handlers and testcases for @Slf4j --- test/transform/resource/after-delombok/LoggerSlf4j.java | 5 +++++ test/transform/resource/after-ecj/LoggerSlf4j.java | 9 +++++++++ test/transform/resource/before/LoggerSlf4j.java | 4 ++++ 3 files changed, 18 insertions(+) (limited to 'test/transform/resource') diff --git a/test/transform/resource/after-delombok/LoggerSlf4j.java b/test/transform/resource/after-delombok/LoggerSlf4j.java index a07c8546..3c6e6d2f 100644 --- a/test/transform/resource/after-delombok/LoggerSlf4j.java +++ b/test/transform/resource/after-delombok/LoggerSlf4j.java @@ -11,4 +11,9 @@ class LoggerSlf4jOuter { @java.lang.SuppressWarnings("all") private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(Inner.class); } +} + +class LoggerSlf4jWithDifferentLoggerName { + @java.lang.SuppressWarnings("all") + private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger("DifferentLogger"); } \ No newline at end of file diff --git a/test/transform/resource/after-ecj/LoggerSlf4j.java b/test/transform/resource/after-ecj/LoggerSlf4j.java index 1ccf5c9e..a34f85d7 100644 --- a/test/transform/resource/after-ecj/LoggerSlf4j.java +++ b/test/transform/resource/after-ecj/LoggerSlf4j.java @@ -27,4 +27,13 @@ class LoggerSlf4jOuter { LoggerSlf4jOuter() { super(); } +} + +@Slf4j("DifferentLogger") class LoggerSlf4jWithDifferentLoggerName { + private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger("DifferentLogger"); + () { + } + LoggerSlf4jWithDifferentLoggerName() { + super(); + } } \ No newline at end of file diff --git a/test/transform/resource/before/LoggerSlf4j.java b/test/transform/resource/before/LoggerSlf4j.java index 133ee36e..b620e056 100644 --- a/test/transform/resource/before/LoggerSlf4j.java +++ b/test/transform/resource/before/LoggerSlf4j.java @@ -13,4 +13,8 @@ class LoggerSlf4jOuter { static class Inner { } +} + +@Slf4j("DifferentLogger") +class LoggerSlf4jWithDifferentLoggerName { } \ No newline at end of file -- cgit From f13191e02c1b8e8e8857cadfcf29cfd15dd1f1ad Mon Sep 17 00:00:00 2001 From: Maarten Mulders Date: Sat, 8 Feb 2014 14:43:48 +0100 Subject: Handlers and testcases for @CommonsLog --- src/core/lombok/eclipse/handlers/HandleLog.java | 2 +- src/core/lombok/extern/apachecommons/CommonsLog.java | 4 ++++ src/core/lombok/javac/handlers/HandleLog.java | 2 +- test/transform/resource/after-delombok/LoggerCommons.java | 4 ++++ test/transform/resource/after-ecj/LoggerCommons.java | 8 ++++++++ test/transform/resource/before/LoggerCommons.java | 6 +++++- 6 files changed, 23 insertions(+), 3 deletions(-) (limited to 'test/transform/resource') diff --git a/src/core/lombok/eclipse/handlers/HandleLog.java b/src/core/lombok/eclipse/handlers/HandleLog.java index ee9986b1..0f77bf76 100644 --- a/src/core/lombok/eclipse/handlers/HandleLog.java +++ b/src/core/lombok/eclipse/handlers/HandleLog.java @@ -161,7 +161,7 @@ public class HandleLog { @ProviderFor(EclipseAnnotationHandler.class) public static class HandleCommonsLog extends EclipseAnnotationHandler { @Override public void handle(AnnotationValues annotation, Annotation source, EclipseNode annotationNode) { - processAnnotation(LoggingFramework.COMMONS, annotation, source, annotationNode, ""); + processAnnotation(LoggingFramework.COMMONS, annotation, source, annotationNode, annotation.getInstance().value()); } } diff --git a/src/core/lombok/extern/apachecommons/CommonsLog.java b/src/core/lombok/extern/apachecommons/CommonsLog.java index 024e3744..34ac0fe6 100644 --- a/src/core/lombok/extern/apachecommons/CommonsLog.java +++ b/src/core/lombok/extern/apachecommons/CommonsLog.java @@ -59,4 +59,8 @@ import java.lang.annotation.Target; @Retention(RetentionPolicy.SOURCE) @Target(ElementType.TYPE) public @interface CommonsLog { + /** + * Sets the category of the constructed Logger. By default, it will use the type where the annotation is placed. + */ + String value() default ""; } \ No newline at end of file diff --git a/src/core/lombok/javac/handlers/HandleLog.java b/src/core/lombok/javac/handlers/HandleLog.java index 12aa07fb..2ad16b80 100644 --- a/src/core/lombok/javac/handlers/HandleLog.java +++ b/src/core/lombok/javac/handlers/HandleLog.java @@ -111,7 +111,7 @@ public class HandleLog { @ProviderFor(JavacAnnotationHandler.class) public static class HandleCommonsLog extends JavacAnnotationHandler { @Override public void handle(AnnotationValues annotation, JCAnnotation ast, JavacNode annotationNode) { - processAnnotation(LoggingFramework.COMMONS, annotation, annotationNode, ""); + processAnnotation(LoggingFramework.COMMONS, annotation, annotationNode, annotation.getInstance().value()); } } diff --git a/test/transform/resource/after-delombok/LoggerCommons.java b/test/transform/resource/after-delombok/LoggerCommons.java index 6feea5b6..32ace53a 100644 --- a/test/transform/resource/after-delombok/LoggerCommons.java +++ b/test/transform/resource/after-delombok/LoggerCommons.java @@ -5,4 +5,8 @@ class LoggerCommons { class LoggerCommonsWithImport { @java.lang.SuppressWarnings("all") private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog(LoggerCommonsWithImport.class); +} +class LoggerCommonsWithDifferentName { + @java.lang.SuppressWarnings("all") + private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog("DifferentName"); } \ No newline at end of file diff --git a/test/transform/resource/after-ecj/LoggerCommons.java b/test/transform/resource/after-ecj/LoggerCommons.java index d63bb9c1..50d07a14 100644 --- a/test/transform/resource/after-ecj/LoggerCommons.java +++ b/test/transform/resource/after-ecj/LoggerCommons.java @@ -14,4 +14,12 @@ import lombok.extern.apachecommons.CommonsLog; LoggerCommonsWithImport() { super(); } +} +@CommonsLog("DifferentName") class LoggerCommonsWithDifferentName { + private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog("DifferentName"); + () { + } + LoggerCommonsWithDifferentName() { + super(); + } } \ No newline at end of file diff --git a/test/transform/resource/before/LoggerCommons.java b/test/transform/resource/before/LoggerCommons.java index 52210d25..ce9e4ec4 100644 --- a/test/transform/resource/before/LoggerCommons.java +++ b/test/transform/resource/before/LoggerCommons.java @@ -6,4 +6,8 @@ class LoggerCommons { @CommonsLog class LoggerCommonsWithImport { -} \ No newline at end of file +} + +@CommonsLog("DifferentName") +class LoggerCommonsWithDifferentName { +} -- cgit From e1153c16562dba545f4cc2ecbc26befde6c1a781 Mon Sep 17 00:00:00 2001 From: Maarten Mulders Date: Sat, 8 Feb 2014 15:16:39 +0100 Subject: Handler and testcases for @Log --- src/core/lombok/eclipse/handlers/HandleLog.java | 2 +- src/core/lombok/extern/java/Log.java | 4 ++++ src/core/lombok/javac/handlers/HandleLog.java | 2 +- test/transform/resource/after-delombok/LoggerJul.java | 4 ++++ test/transform/resource/after-ecj/LoggerJul.java | 8 ++++++++ test/transform/resource/before/LoggerJul.java | 4 ++++ 6 files changed, 22 insertions(+), 2 deletions(-) (limited to 'test/transform/resource') diff --git a/src/core/lombok/eclipse/handlers/HandleLog.java b/src/core/lombok/eclipse/handlers/HandleLog.java index 0f77bf76..891d4df2 100644 --- a/src/core/lombok/eclipse/handlers/HandleLog.java +++ b/src/core/lombok/eclipse/handlers/HandleLog.java @@ -171,7 +171,7 @@ public class HandleLog { @ProviderFor(EclipseAnnotationHandler.class) public static class HandleJulLog extends EclipseAnnotationHandler { @Override public void handle(AnnotationValues annotation, Annotation source, EclipseNode annotationNode) { - processAnnotation(LoggingFramework.JUL, annotation, source, annotationNode, ""); + processAnnotation(LoggingFramework.JUL, annotation, source, annotationNode, annotation.getInstance().value()); } } diff --git a/src/core/lombok/extern/java/Log.java b/src/core/lombok/extern/java/Log.java index 7ae4e07b..dfa2e2aa 100644 --- a/src/core/lombok/extern/java/Log.java +++ b/src/core/lombok/extern/java/Log.java @@ -58,4 +58,8 @@ import java.lang.annotation.Target; @Retention(RetentionPolicy.SOURCE) @Target(ElementType.TYPE) public @interface Log { + /** + * Sets the category of the constructed Logger. By default, it will use the type where the annotation is placed. + */ + String value() default ""; } \ No newline at end of file diff --git a/src/core/lombok/javac/handlers/HandleLog.java b/src/core/lombok/javac/handlers/HandleLog.java index 2ad16b80..bdb80ccb 100644 --- a/src/core/lombok/javac/handlers/HandleLog.java +++ b/src/core/lombok/javac/handlers/HandleLog.java @@ -121,7 +121,7 @@ public class HandleLog { @ProviderFor(JavacAnnotationHandler.class) public static class HandleJulLog extends JavacAnnotationHandler { @Override public void handle(AnnotationValues annotation, JCAnnotation ast, JavacNode annotationNode) { - processAnnotation(LoggingFramework.JUL, annotation, annotationNode, ""); + processAnnotation(LoggingFramework.JUL, annotation, annotationNode, annotation.getInstance().value()); } } diff --git a/test/transform/resource/after-delombok/LoggerJul.java b/test/transform/resource/after-delombok/LoggerJul.java index 20f0d24d..ad119777 100644 --- a/test/transform/resource/after-delombok/LoggerJul.java +++ b/test/transform/resource/after-delombok/LoggerJul.java @@ -5,4 +5,8 @@ class LoggerJul { class LoggerJulWithImport { @java.lang.SuppressWarnings("all") private static final java.util.logging.Logger log = java.util.logging.Logger.getLogger(LoggerJulWithImport.class.getName()); +} +class LoggerJulWithDifferentName { + @java.lang.SuppressWarnings("all") + private static final java.util.logging.Logger log = java.util.logging.Logger.getLogger("DifferentName"); } \ No newline at end of file diff --git a/test/transform/resource/after-ecj/LoggerJul.java b/test/transform/resource/after-ecj/LoggerJul.java index c98dfe27..3aa8181d 100644 --- a/test/transform/resource/after-ecj/LoggerJul.java +++ b/test/transform/resource/after-ecj/LoggerJul.java @@ -14,4 +14,12 @@ import lombok.extern.java.Log; LoggerJulWithImport() { super(); } +} +@Log("DifferentName") class LoggerJulWithDifferentName { + private static final java.util.logging.Logger log = java.util.logging.Logger.getLogger("DifferentName"); + () { + } + LoggerJulWithDifferentName() { + super(); + } } \ No newline at end of file diff --git a/test/transform/resource/before/LoggerJul.java b/test/transform/resource/before/LoggerJul.java index 52869e81..41e36220 100644 --- a/test/transform/resource/before/LoggerJul.java +++ b/test/transform/resource/before/LoggerJul.java @@ -6,4 +6,8 @@ class LoggerJul { @Log class LoggerJulWithImport { +} + +@Log("DifferentName") +class LoggerJulWithDifferentName { } \ No newline at end of file -- cgit From ebc9ee5f6d6bc89af65d27f472d13f18b34bef18 Mon Sep 17 00:00:00 2001 From: Maarten Mulders Date: Sat, 8 Feb 2014 15:38:54 +0100 Subject: Handler and testcases for @Log4j --- src/core/lombok/eclipse/handlers/HandleLog.java | 2 +- src/core/lombok/extern/log4j/Log4j.java | 4 ++++ src/core/lombok/javac/handlers/HandleLog.java | 2 +- test/transform/resource/after-delombok/LoggerLog4j.java | 4 ++++ test/transform/resource/after-ecj/LoggerLog4j.java | 8 ++++++++ test/transform/resource/before/LoggerLog4j.java | 4 ++++ 6 files changed, 22 insertions(+), 2 deletions(-) (limited to 'test/transform/resource') diff --git a/src/core/lombok/eclipse/handlers/HandleLog.java b/src/core/lombok/eclipse/handlers/HandleLog.java index 891d4df2..1cd933e3 100644 --- a/src/core/lombok/eclipse/handlers/HandleLog.java +++ b/src/core/lombok/eclipse/handlers/HandleLog.java @@ -181,7 +181,7 @@ public class HandleLog { @ProviderFor(EclipseAnnotationHandler.class) public static class HandleLog4jLog extends EclipseAnnotationHandler { @Override public void handle(AnnotationValues annotation, Annotation source, EclipseNode annotationNode) { - processAnnotation(LoggingFramework.LOG4J, annotation, source, annotationNode, ""); + processAnnotation(LoggingFramework.LOG4J, annotation, source, annotationNode, annotation.getInstance().value()); } } diff --git a/src/core/lombok/extern/log4j/Log4j.java b/src/core/lombok/extern/log4j/Log4j.java index 29e1b27c..0fe74599 100644 --- a/src/core/lombok/extern/log4j/Log4j.java +++ b/src/core/lombok/extern/log4j/Log4j.java @@ -59,4 +59,8 @@ import java.lang.annotation.Target; @Retention(RetentionPolicy.SOURCE) @Target(ElementType.TYPE) public @interface Log4j { + /** + * Sets the category of the constructed Logger. By default, it will use the type where the annotation is placed. + */ + String value() default ""; } \ No newline at end of file diff --git a/src/core/lombok/javac/handlers/HandleLog.java b/src/core/lombok/javac/handlers/HandleLog.java index bdb80ccb..b01dd564 100644 --- a/src/core/lombok/javac/handlers/HandleLog.java +++ b/src/core/lombok/javac/handlers/HandleLog.java @@ -131,7 +131,7 @@ public class HandleLog { @ProviderFor(JavacAnnotationHandler.class) public static class HandleLog4jLog extends JavacAnnotationHandler { @Override public void handle(AnnotationValues annotation, JCAnnotation ast, JavacNode annotationNode) { - processAnnotation(LoggingFramework.LOG4J, annotation, annotationNode, ""); + processAnnotation(LoggingFramework.LOG4J, annotation, annotationNode, annotation.getInstance().value()); } } diff --git a/test/transform/resource/after-delombok/LoggerLog4j.java b/test/transform/resource/after-delombok/LoggerLog4j.java index 7d54b259..99eac34f 100644 --- a/test/transform/resource/after-delombok/LoggerLog4j.java +++ b/test/transform/resource/after-delombok/LoggerLog4j.java @@ -5,4 +5,8 @@ class LoggerLog4j { class LoggerLog4jWithImport { @java.lang.SuppressWarnings("all") private static final org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger(LoggerLog4jWithImport.class); +} +class LoggerLog4jWithDifferentName { + @java.lang.SuppressWarnings("all") + private static final org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger("DifferentName"); } \ No newline at end of file diff --git a/test/transform/resource/after-ecj/LoggerLog4j.java b/test/transform/resource/after-ecj/LoggerLog4j.java index 6814be7b..a6c52d61 100644 --- a/test/transform/resource/after-ecj/LoggerLog4j.java +++ b/test/transform/resource/after-ecj/LoggerLog4j.java @@ -14,4 +14,12 @@ import lombok.extern.log4j.Log4j; LoggerLog4jWithImport() { super(); } +} +@Log4j("DifferentName") class LoggerLog4jWithDifferentName { + private static final org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger("DifferentName"); + () { + } + LoggerLog4jWithDifferentName() { + super(); + } } \ No newline at end of file diff --git a/test/transform/resource/before/LoggerLog4j.java b/test/transform/resource/before/LoggerLog4j.java index 03735bff..fa7dad4a 100644 --- a/test/transform/resource/before/LoggerLog4j.java +++ b/test/transform/resource/before/LoggerLog4j.java @@ -6,4 +6,8 @@ class LoggerLog4j { @Log4j class LoggerLog4jWithImport { +} + +@Log4j("DifferentName") +class LoggerLog4jWithDifferentName { } \ No newline at end of file -- cgit From 1045006fa9d19c6daf51b2c200176ba789c2372f Mon Sep 17 00:00:00 2001 From: Maarten Mulders Date: Sat, 8 Feb 2014 20:24:23 +0100 Subject: Handler and testcases for @Log4j2 --- src/core/lombok/eclipse/handlers/HandleLog.java | 2 +- src/core/lombok/extern/log4j/Log4j2.java | 4 ++++ src/core/lombok/javac/handlers/HandleLog.java | 2 +- test/transform/resource/after-delombok/LoggerLog4j2.java | 4 ++++ test/transform/resource/after-ecj/LoggerLog4j2.java | 8 ++++++++ test/transform/resource/before/LoggerLog4j2.java | 4 ++++ 6 files changed, 22 insertions(+), 2 deletions(-) (limited to 'test/transform/resource') diff --git a/src/core/lombok/eclipse/handlers/HandleLog.java b/src/core/lombok/eclipse/handlers/HandleLog.java index 1cd933e3..583aa0af 100644 --- a/src/core/lombok/eclipse/handlers/HandleLog.java +++ b/src/core/lombok/eclipse/handlers/HandleLog.java @@ -191,7 +191,7 @@ public class HandleLog { @ProviderFor(EclipseAnnotationHandler.class) public static class HandleLog4j2Log extends EclipseAnnotationHandler { @Override public void handle(AnnotationValues annotation, Annotation source, EclipseNode annotationNode) { - processAnnotation(LoggingFramework.LOG4J2, annotation, source, annotationNode, ""); + processAnnotation(LoggingFramework.LOG4J2, annotation, source, annotationNode, annotation.getInstance().value()); } } diff --git a/src/core/lombok/extern/log4j/Log4j2.java b/src/core/lombok/extern/log4j/Log4j2.java index 2a0f09e1..96fab793 100644 --- a/src/core/lombok/extern/log4j/Log4j2.java +++ b/src/core/lombok/extern/log4j/Log4j2.java @@ -59,4 +59,8 @@ import java.lang.annotation.Target; @Retention(RetentionPolicy.SOURCE) @Target(ElementType.TYPE) public @interface Log4j2 { + /** + * Sets the category of the constructed Logger. By default, it will use the type where the annotation is placed. + */ + String value() default ""; } \ No newline at end of file diff --git a/src/core/lombok/javac/handlers/HandleLog.java b/src/core/lombok/javac/handlers/HandleLog.java index b01dd564..a5d12964 100644 --- a/src/core/lombok/javac/handlers/HandleLog.java +++ b/src/core/lombok/javac/handlers/HandleLog.java @@ -141,7 +141,7 @@ public class HandleLog { @ProviderFor(JavacAnnotationHandler.class) public static class HandleLog4j2Log extends JavacAnnotationHandler { @Override public void handle(AnnotationValues annotation, JCAnnotation ast, JavacNode annotationNode) { - processAnnotation(LoggingFramework.LOG4J2, annotation, annotationNode, ""); + processAnnotation(LoggingFramework.LOG4J2, annotation, annotationNode, annotation.getInstance().value()); } } diff --git a/test/transform/resource/after-delombok/LoggerLog4j2.java b/test/transform/resource/after-delombok/LoggerLog4j2.java index 7e4c01de..8473134b 100644 --- a/test/transform/resource/after-delombok/LoggerLog4j2.java +++ b/test/transform/resource/after-delombok/LoggerLog4j2.java @@ -5,4 +5,8 @@ class LoggerLog4j2 { class LoggerLog4j2WithImport { @java.lang.SuppressWarnings("all") private static final org.apache.logging.log4j.Logger log = org.apache.logging.log4j.LogManager.getLogger(LoggerLog4j2WithImport.class); +} +class LoggerLog4j2WithDifferentName { + @java.lang.SuppressWarnings("all") + private static final org.apache.logging.log4j.Logger log = org.apache.logging.log4j.LogManager.getLogger("DifferentName"); } \ No newline at end of file diff --git a/test/transform/resource/after-ecj/LoggerLog4j2.java b/test/transform/resource/after-ecj/LoggerLog4j2.java index c1368e5d..3243ef2d 100644 --- a/test/transform/resource/after-ecj/LoggerLog4j2.java +++ b/test/transform/resource/after-ecj/LoggerLog4j2.java @@ -14,4 +14,12 @@ import lombok.extern.log4j.Log4j2; LoggerLog4j2WithImport() { super(); } +} +@Log4j2("DifferentName") class LoggerLog4j2WithDifferentName { + private static final org.apache.logging.log4j.Logger log = org.apache.logging.log4j.LogManager.getLogger("DifferentName"); + () { + } + LoggerLog4j2WithDifferentName() { + super(); + } } \ No newline at end of file diff --git a/test/transform/resource/before/LoggerLog4j2.java b/test/transform/resource/before/LoggerLog4j2.java index b7ea99ee..13b3605f 100644 --- a/test/transform/resource/before/LoggerLog4j2.java +++ b/test/transform/resource/before/LoggerLog4j2.java @@ -6,4 +6,8 @@ class LoggerLog4j2 { @Log4j2 class LoggerLog4j2WithImport { +} + +@Log4j2("DifferentName") +class LoggerLog4j2WithDifferentName { } \ No newline at end of file -- cgit From c0e00edb7bf369470c55d59307bbf80cc3abb9d9 Mon Sep 17 00:00:00 2001 From: Maarten Mulders Date: Sat, 8 Feb 2014 20:35:56 +0100 Subject: Handler and testcases for @XSlf4j --- src/core/lombok/eclipse/handlers/HandleLog.java | 2 +- src/core/lombok/extern/slf4j/XSlf4j.java | 4 ++++ src/core/lombok/javac/handlers/HandleLog.java | 2 +- test/transform/resource/after-delombok/LoggerXSlf4j.java | 4 ++++ test/transform/resource/after-ecj/LoggerXSlf4j.java | 8 ++++++++ test/transform/resource/before/LoggerXSlf4j.java | 4 ++++ 6 files changed, 22 insertions(+), 2 deletions(-) (limited to 'test/transform/resource') diff --git a/src/core/lombok/eclipse/handlers/HandleLog.java b/src/core/lombok/eclipse/handlers/HandleLog.java index 583aa0af..56160b39 100644 --- a/src/core/lombok/eclipse/handlers/HandleLog.java +++ b/src/core/lombok/eclipse/handlers/HandleLog.java @@ -211,7 +211,7 @@ public class HandleLog { @ProviderFor(EclipseAnnotationHandler.class) public static class HandleXSlf4jLog extends EclipseAnnotationHandler { @Override public void handle(AnnotationValues annotation, Annotation source, EclipseNode annotationNode) { - processAnnotation(LoggingFramework.XSLF4J, annotation, source, annotationNode, ""); + processAnnotation(LoggingFramework.XSLF4J, annotation, source, annotationNode, annotation.getInstance().value()); } } diff --git a/src/core/lombok/extern/slf4j/XSlf4j.java b/src/core/lombok/extern/slf4j/XSlf4j.java index 599c68ab..306057f0 100644 --- a/src/core/lombok/extern/slf4j/XSlf4j.java +++ b/src/core/lombok/extern/slf4j/XSlf4j.java @@ -57,4 +57,8 @@ import java.lang.annotation.Target; @Retention(RetentionPolicy.SOURCE) @Target(ElementType.TYPE) public @interface XSlf4j { + /** + * Sets the category of the constructed Logger. By default, it will use the type where the annotation is placed. + */ + String value() default ""; } diff --git a/src/core/lombok/javac/handlers/HandleLog.java b/src/core/lombok/javac/handlers/HandleLog.java index a5d12964..12b0cb5c 100644 --- a/src/core/lombok/javac/handlers/HandleLog.java +++ b/src/core/lombok/javac/handlers/HandleLog.java @@ -161,7 +161,7 @@ public class HandleLog { @ProviderFor(JavacAnnotationHandler.class) public static class HandleXSlf4jLog extends JavacAnnotationHandler { @Override public void handle(AnnotationValues annotation, JCAnnotation ast, JavacNode annotationNode) { - processAnnotation(LoggingFramework.XSLF4J, annotation, annotationNode, ""); + processAnnotation(LoggingFramework.XSLF4J, annotation, annotationNode, annotation.getInstance().value()); } } diff --git a/test/transform/resource/after-delombok/LoggerXSlf4j.java b/test/transform/resource/after-delombok/LoggerXSlf4j.java index 981bcca6..d0654b51 100644 --- a/test/transform/resource/after-delombok/LoggerXSlf4j.java +++ b/test/transform/resource/after-delombok/LoggerXSlf4j.java @@ -5,4 +5,8 @@ class LoggerXSlf4j { class LoggerXSlf4jWithImport { @java.lang.SuppressWarnings("all") private static final org.slf4j.ext.XLogger log = org.slf4j.ext.XLoggerFactory.getXLogger(LoggerXSlf4jWithImport.class); +} +class LoggerXSlf4jWithDifferentName { + @java.lang.SuppressWarnings("all") + private static final org.slf4j.ext.XLogger log = org.slf4j.ext.XLoggerFactory.getXLogger("DifferentName"); } \ No newline at end of file diff --git a/test/transform/resource/after-ecj/LoggerXSlf4j.java b/test/transform/resource/after-ecj/LoggerXSlf4j.java index f05e1ae7..4cd4cb94 100644 --- a/test/transform/resource/after-ecj/LoggerXSlf4j.java +++ b/test/transform/resource/after-ecj/LoggerXSlf4j.java @@ -14,4 +14,12 @@ import lombok.extern.slf4j.XSlf4j; LoggerXSlf4jWithImport() { super(); } +} +@XSlf4j("DifferentName") class LoggerXSlf4jWithDifferentName { + private static final org.slf4j.ext.XLogger log = org.slf4j.ext.XLoggerFactory.getXLogger("DifferentName"); + () { + } + LoggerXSlf4jWithDifferentName() { + super(); + } } \ No newline at end of file diff --git a/test/transform/resource/before/LoggerXSlf4j.java b/test/transform/resource/before/LoggerXSlf4j.java index 6dbbf2d1..408bd134 100644 --- a/test/transform/resource/before/LoggerXSlf4j.java +++ b/test/transform/resource/before/LoggerXSlf4j.java @@ -6,4 +6,8 @@ class LoggerXSlf4j { @XSlf4j class LoggerXSlf4jWithImport { +} + +@XSlf4j("DifferentName") +class LoggerXSlf4jWithDifferentName { } \ No newline at end of file -- cgit