mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-14 06:17:44 +00:00
[deps] Updated eclipse deps to 3.9 tree. This also enables testing java7 features on ecj.
[Log] updated naming for @Log (topic= instead of mchmulder's 'value').
This commit is contained in:
1 parent
db24fd42c5
commit
d78135180c
39 files changed
+182
-64
No files matched your search
@@ -1,12 +1,12 @@
|
||||
Lombok contributors in alphabetical order:
|
||||
|
||||
Jappe van der Hel <jappe.vanderhel@gmail.com>
|
||||
Maarten Mulders <mthmulders@users.noreply.github.com>
|
||||
Philipp Eichhorn <peichhor@web.de>
|
||||
Reinier Zwitserloot <reinier@zwitserloot.com>
|
||||
Robbert Jan Grootjans <grootjans@gmail.com>
|
||||
Roel Spilker <r.spilker@gmail.com>
|
||||
Sander Koning <askoning@gmail.com>
|
||||
Taiki Sugawara <buzz.taiki@gmail.com>
|
||||
Maarten Mulders <mthmulders@users.noreply.github.com>
|
||||
|
||||
By adding your name to this list, you grant full and irrevocable copyright and patent indemnity to Project Lombok and all use of Project Lombok, and you certify that you have the right to do so for all commits you add to Project Lombok.
|
||||
@@ -0,0 +1,14 @@
|
||||
<ivy-module version="2.0">
|
||||
<info organisation="org.eclipse.custom" module="core.runtime" revision="3.9.0" publication="20130326125500">
|
||||
<license name="Eclipse Public Licence v1.0" url="http://www.eclipse.org/org/documents/epl-v10.php" />
|
||||
<description homepage="http://www.eclipse.org/eclipse/" />
|
||||
</info>
|
||||
<configurations>
|
||||
<conf name="default" />
|
||||
<conf name="sources" />
|
||||
</configurations>
|
||||
<publications>
|
||||
<artifact conf="default" url="http://projectlombok.org/ivyrepo/eclipse/org.eclipse.core.runtime_3.9.0.v20130326-1255.jar" />
|
||||
<artifact type="zip" conf="sources" url="http://projectlombok.org/ivyrepo/eclipse/org.eclipse.core.runtime_3.9.0.v20130326-1255-sources.jar" />
|
||||
</publications>
|
||||
</ivy-module>
|
||||
@@ -0,0 +1,14 @@
|
||||
<ivy-module version="2.0">
|
||||
<info organisation="org.eclipse.custom" module="ecj" revision="4.3.1" publication="20140210214200">
|
||||
<license name="Eclipse Public Licence v1.0" url="http://www.eclipse.org/org/documents/epl-v10.php" />
|
||||
<description homepage="http://www.eclipse.org/eclipse/" />
|
||||
</info>
|
||||
<configurations>
|
||||
<conf name="default" />
|
||||
<conf name="sources" />
|
||||
</configurations>
|
||||
<publications>
|
||||
<artifact conf="default" url="http://projectlombok.org/ivyrepo/eclipse/ecj-4.3.1.jar" />
|
||||
<artifact type="zip" conf="sources" url="http://projectlombok.org/ivyrepo/eclipse/ecjsrc-4.3.1.zip" />
|
||||
</publications>
|
||||
</ivy-module>
|
||||
@@ -0,0 +1,14 @@
|
||||
<ivy-module version="2.0">
|
||||
<info organisation="org.eclipse.custom" module="equinox.common" revision="3.6.200" publication="20130402150500">
|
||||
<license name="Eclipse Public Licence v1.0" url="http://www.eclipse.org/org/documents/epl-v10.php" />
|
||||
<description homepage="http://www.eclipse.org/eclipse/" />
|
||||
</info>
|
||||
<configurations>
|
||||
<conf name="default" />
|
||||
<conf name="sources" />
|
||||
</configurations>
|
||||
<publications>
|
||||
<artifact conf="default" url="http://projectlombok.org/ivyrepo/eclipse/org.eclipse.equinox.common_3.6.200.v20130402-1505.jar" />
|
||||
<artifact type="zip" conf="sources" url="http://projectlombok.org/ivyrepo/eclipse/org.eclipse.equinox.common_3.6.200.v20130402-1505-sources.jar" />
|
||||
</publications>
|
||||
</ivy-module>
|
||||
@@ -0,0 +1,14 @@
|
||||
<ivy-module version="2.0">
|
||||
<info organisation="org.eclipse.custom" module="jdt.core" revision="3.9.1" publication="20130905083700">
|
||||
<license name="Eclipse Public Licence v1.0" url="http://www.eclipse.org/org/documents/epl-v10.php" />
|
||||
<description homepage="http://www.eclipse.org/eclipse/" />
|
||||
</info>
|
||||
<configurations>
|
||||
<conf name="default" />
|
||||
<conf name="sources" />
|
||||
</configurations>
|
||||
<publications>
|
||||
<artifact conf="default" url="http://projectlombok.org/ivyrepo/eclipse/org.eclipse.jdt.core_3.9.1.v20130905-0837.jar" />
|
||||
<artifact type="zip" conf="sources" url="http://projectlombok.org/ivyrepo/eclipse/org.eclipse.jdt.core_3.9.1.v20130905-0837-sources.jar" />
|
||||
</publications>
|
||||
</ivy-module>
|
||||
@@ -0,0 +1,14 @@
|
||||
<ivy-module version="2.0">
|
||||
<info organisation="org.eclipse.custom" module="jdt.ui" revision="3.9.1" publication="20130820142700">
|
||||
<license name="Eclipse Public Licence v1.0" url="http://www.eclipse.org/org/documents/epl-v10.php" />
|
||||
<description homepage="http://www.eclipse.org/eclipse/" />
|
||||
</info>
|
||||
<configurations>
|
||||
<conf name="default" />
|
||||
<conf name="sources" />
|
||||
</configurations>
|
||||
<publications>
|
||||
<artifact conf="default" url="http://projectlombok.org/ivyrepo/eclipse/org.eclipse.jdt.ui_3.9.1.v20130820-1427.jar" />
|
||||
<artifact type="zip" conf="sources" url="http://projectlombok.org/ivyrepo/eclipse/org.eclipse.jdt.ui_3.9.1.v20130820-1427-sources.jar" />
|
||||
</publications>
|
||||
</ivy-module>
|
||||
@@ -0,0 +1,14 @@
|
||||
<ivy-module version="2.0">
|
||||
<info organisation="org.eclipse.custom" module="osgi" revision="3.9.0" publication="20130529171000">
|
||||
<license name="Eclipse Public Licence v1.0" url="http://www.eclipse.org/org/documents/epl-v10.php" />
|
||||
<description homepage="http://www.eclipse.org/eclipse/" />
|
||||
</info>
|
||||
<configurations>
|
||||
<conf name="default" />
|
||||
<conf name="sources" />
|
||||
</configurations>
|
||||
<publications>
|
||||
<artifact conf="default" url="http://projectlombok.org/ivyrepo/eclipse/org.eclipse.osgi_3.9.0.v20130529-1710.jar" />
|
||||
<artifact type="zip" conf="sources" url="http://projectlombok.org/ivyrepo/eclipse/org.eclipse.osgi_3.9.0.v20130529-1710-sources.jar" />
|
||||
</publications>
|
||||
</ivy-module>
|
||||
@@ -35,17 +35,17 @@
|
||||
|
||||
<dependency org="net.java.openjdk.custom" name="javac6" rev="1.6.0.18" conf="javac6->runtime; contrib->sources" />
|
||||
<dependency org="net.java.openjdk.custom" name="javac7" rev="1.7.0" conf="javac7->runtime; contrib->sources" />
|
||||
<dependency org="org.eclipse.custom" name="ecj" rev="3.6.2" conf="ecj->default; contrib->sources" />
|
||||
<dependency org="org.eclipse.custom" name="ecj" rev="4.3.1" conf="ecj->default; contrib->sources" />
|
||||
|
||||
<dependency org="netbeans.org" name="boot" rev="6.8beta" conf="netbeansBuild->build" />
|
||||
<dependency org="netbeans.org" name="openide.modules" rev="6.8beta" conf="netbeansBuild->build" />
|
||||
<dependency org="netbeans.org" name="openide.util" rev="6.8beta" conf="netbeansBuild->build" />
|
||||
<dependency org="netbeans.org" name="modules.java.source" rev="6.8beta" conf="netbeansBuild->build" />
|
||||
|
||||
<dependency org="org.eclipse.custom" name="core.runtime" rev="3.6.0" conf="eclipseBuild->default; contrib->sources" />
|
||||
<dependency org="org.eclipse.custom" name="jdt.core" rev="3.6.0" conf="eclipseBuild->default; contrib->sources" />
|
||||
<dependency org="org.eclipse.custom" name="jdt.ui" rev="3.6.0" conf="eclipseBuild->default; contrib->sources" />
|
||||
<dependency org="org.eclipse.custom" name="equinox.common" rev="3.6.0" conf="eclipseBuild->default; contrib->sources" />
|
||||
<dependency org="org.eclipse.custom" name="osgi" rev="3.6.0" conf="eclipseBuild->default; contrib->sources" />
|
||||
<dependency org="org.eclipse.custom" name="core.runtime" rev="3.9.0" conf="eclipseBuild->default; contrib->sources" />
|
||||
<dependency org="org.eclipse.custom" name="jdt.core" rev="3.9.1" conf="eclipseBuild->default; contrib->sources" />
|
||||
<dependency org="org.eclipse.custom" name="jdt.ui" rev="3.9.1" conf="eclipseBuild->default; contrib->sources" />
|
||||
<dependency org="org.eclipse.custom" name="equinox.common" rev="3.6.200" conf="eclipseBuild->default; contrib->sources" />
|
||||
<dependency org="org.eclipse.custom" name="osgi" rev="3.9.0" conf="eclipseBuild->default; contrib->sources" />
|
||||
</dependencies>
|
||||
</ivy-module>
|
||||
@@ -161,7 +161,7 @@ public class HandleLog {
|
||||
@ProviderFor(EclipseAnnotationHandler.class)
|
||||
public static class HandleCommonsLog extends EclipseAnnotationHandler<lombok.extern.apachecommons.CommonsLog> {
|
||||
@Override public void handle(AnnotationValues<lombok.extern.apachecommons.CommonsLog> annotation, Annotation source, EclipseNode annotationNode) {
|
||||
processAnnotation(LoggingFramework.COMMONS, annotation, source, annotationNode, annotation.getInstance().value());
|
||||
processAnnotation(LoggingFramework.COMMONS, annotation, source, annotationNode, annotation.getInstance().topic());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,7 +171,7 @@ public class HandleLog {
|
||||
@ProviderFor(EclipseAnnotationHandler.class)
|
||||
public static class HandleJulLog extends EclipseAnnotationHandler<lombok.extern.java.Log> {
|
||||
@Override public void handle(AnnotationValues<lombok.extern.java.Log> annotation, Annotation source, EclipseNode annotationNode) {
|
||||
processAnnotation(LoggingFramework.JUL, annotation, source, annotationNode, annotation.getInstance().value());
|
||||
processAnnotation(LoggingFramework.JUL, annotation, source, annotationNode, annotation.getInstance().topic());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -181,7 +181,7 @@ public class HandleLog {
|
||||
@ProviderFor(EclipseAnnotationHandler.class)
|
||||
public static class HandleLog4jLog extends EclipseAnnotationHandler<lombok.extern.log4j.Log4j> {
|
||||
@Override public void handle(AnnotationValues<lombok.extern.log4j.Log4j> annotation, Annotation source, EclipseNode annotationNode) {
|
||||
processAnnotation(LoggingFramework.LOG4J, annotation, source, annotationNode, annotation.getInstance().value());
|
||||
processAnnotation(LoggingFramework.LOG4J, annotation, source, annotationNode, annotation.getInstance().topic());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -191,7 +191,7 @@ public class HandleLog {
|
||||
@ProviderFor(EclipseAnnotationHandler.class)
|
||||
public static class HandleLog4j2Log extends EclipseAnnotationHandler<lombok.extern.log4j.Log4j2> {
|
||||
@Override public void handle(AnnotationValues<lombok.extern.log4j.Log4j2> annotation, Annotation source, EclipseNode annotationNode) {
|
||||
processAnnotation(LoggingFramework.LOG4J2, annotation, source, annotationNode, annotation.getInstance().value());
|
||||
processAnnotation(LoggingFramework.LOG4J2, annotation, source, annotationNode, annotation.getInstance().topic());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -201,7 +201,7 @@ public class HandleLog {
|
||||
@ProviderFor(EclipseAnnotationHandler.class)
|
||||
public static class HandleSlf4jLog extends EclipseAnnotationHandler<lombok.extern.slf4j.Slf4j> {
|
||||
@Override public void handle(AnnotationValues<lombok.extern.slf4j.Slf4j> annotation, Annotation source, EclipseNode annotationNode) {
|
||||
processAnnotation(LoggingFramework.SLF4J, annotation, source, annotationNode, annotation.getInstance().value());
|
||||
processAnnotation(LoggingFramework.SLF4J, annotation, source, annotationNode, annotation.getInstance().topic());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -211,7 +211,7 @@ public class HandleLog {
|
||||
@ProviderFor(EclipseAnnotationHandler.class)
|
||||
public static class HandleXSlf4jLog extends EclipseAnnotationHandler<lombok.extern.slf4j.XSlf4j> {
|
||||
@Override public void handle(AnnotationValues<lombok.extern.slf4j.XSlf4j> annotation, Annotation source, EclipseNode annotationNode) {
|
||||
processAnnotation(LoggingFramework.XSLF4J, annotation, source, annotationNode, annotation.getInstance().value());
|
||||
processAnnotation(LoggingFramework.XSLF4J, annotation, source, annotationNode, annotation.getInstance().topic());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -62,5 +62,5 @@ 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 "";
|
||||
String topic() default "";
|
||||
}
|
||||
Vendored
+1
-1
@@ -61,5 +61,5 @@ 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 "";
|
||||
String topic() default "";
|
||||
}
|
||||
+1
-1
@@ -62,5 +62,5 @@ 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 "";
|
||||
String topic() default "";
|
||||
}
|
||||
+1
-1
@@ -62,5 +62,5 @@ 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 "";
|
||||
String topic() default "";
|
||||
}
|
||||
+1
-1
@@ -60,5 +60,5 @@ public @interface Slf4j {
|
||||
/**
|
||||
* Sets the category of the constructed Logger. By default, it will use the type where the annotation is placed.
|
||||
*/
|
||||
String value() default "";
|
||||
String topic() default "";
|
||||
}
|
||||
+1
-1
@@ -60,5 +60,5 @@ 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 "";
|
||||
String topic() default "";
|
||||
}
|
||||
@@ -25,9 +25,7 @@ import static lombok.javac.handlers.JavacHandlerUtil.*;
|
||||
|
||||
import java.lang.annotation.Annotation;
|
||||
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.core.AnnotationValues;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import lombok.javac.JavacAnnotationHandler;
|
||||
import lombok.javac.JavacNode;
|
||||
import lombok.javac.JavacTreeMaker;
|
||||
@@ -111,7 +109,7 @@ public class HandleLog {
|
||||
@ProviderFor(JavacAnnotationHandler.class)
|
||||
public static class HandleCommonsLog extends JavacAnnotationHandler<lombok.extern.apachecommons.CommonsLog> {
|
||||
@Override public void handle(AnnotationValues<lombok.extern.apachecommons.CommonsLog> annotation, JCAnnotation ast, JavacNode annotationNode) {
|
||||
processAnnotation(LoggingFramework.COMMONS, annotation, annotationNode, annotation.getInstance().value());
|
||||
processAnnotation(LoggingFramework.COMMONS, annotation, annotationNode, annotation.getInstance().topic());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,7 +119,7 @@ public class HandleLog {
|
||||
@ProviderFor(JavacAnnotationHandler.class)
|
||||
public static class HandleJulLog extends JavacAnnotationHandler<lombok.extern.java.Log> {
|
||||
@Override public void handle(AnnotationValues<lombok.extern.java.Log> annotation, JCAnnotation ast, JavacNode annotationNode) {
|
||||
processAnnotation(LoggingFramework.JUL, annotation, annotationNode, annotation.getInstance().value());
|
||||
processAnnotation(LoggingFramework.JUL, annotation, annotationNode, annotation.getInstance().topic());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,7 +129,7 @@ public class HandleLog {
|
||||
@ProviderFor(JavacAnnotationHandler.class)
|
||||
public static class HandleLog4jLog extends JavacAnnotationHandler<lombok.extern.log4j.Log4j> {
|
||||
@Override public void handle(AnnotationValues<lombok.extern.log4j.Log4j> annotation, JCAnnotation ast, JavacNode annotationNode) {
|
||||
processAnnotation(LoggingFramework.LOG4J, annotation, annotationNode, annotation.getInstance().value());
|
||||
processAnnotation(LoggingFramework.LOG4J, annotation, annotationNode, annotation.getInstance().topic());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,7 +139,7 @@ public class HandleLog {
|
||||
@ProviderFor(JavacAnnotationHandler.class)
|
||||
public static class HandleLog4j2Log extends JavacAnnotationHandler<lombok.extern.log4j.Log4j2> {
|
||||
@Override public void handle(AnnotationValues<lombok.extern.log4j.Log4j2> annotation, JCAnnotation ast, JavacNode annotationNode) {
|
||||
processAnnotation(LoggingFramework.LOG4J2, annotation, annotationNode, annotation.getInstance().value());
|
||||
processAnnotation(LoggingFramework.LOG4J2, annotation, annotationNode, annotation.getInstance().topic());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,7 +149,7 @@ public class HandleLog {
|
||||
@ProviderFor(JavacAnnotationHandler.class)
|
||||
public static class HandleSlf4jLog extends JavacAnnotationHandler<lombok.extern.slf4j.Slf4j> {
|
||||
@Override public void handle(AnnotationValues<lombok.extern.slf4j.Slf4j> annotation, JCAnnotation ast, JavacNode annotationNode) {
|
||||
processAnnotation(LoggingFramework.SLF4J, annotation, annotationNode, annotation.getInstance().value());
|
||||
processAnnotation(LoggingFramework.SLF4J, annotation, annotationNode, annotation.getInstance().topic());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -161,7 +159,7 @@ public class HandleLog {
|
||||
@ProviderFor(JavacAnnotationHandler.class)
|
||||
public static class HandleXSlf4jLog extends JavacAnnotationHandler<lombok.extern.slf4j.XSlf4j> {
|
||||
@Override public void handle(AnnotationValues<lombok.extern.slf4j.XSlf4j> annotation, JCAnnotation ast, JavacNode annotationNode) {
|
||||
processAnnotation(LoggingFramework.XSLF4J, annotation, annotationNode, annotation.getInstance().value());
|
||||
processAnnotation(LoggingFramework.XSLF4J, annotation, annotationNode, annotation.getInstance().topic());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -225,8 +225,8 @@ public abstract class AbstractRunTests {
|
||||
actualLines = removeBlanks(actualLines);
|
||||
int size = Math.min(expectedLines.length, actualLines.length);
|
||||
for (int i = 0; i < size; i++) {
|
||||
String expected = expectedLines[i];
|
||||
String actual = actualLines[i];
|
||||
String expected = trimRight(expectedLines[i]);
|
||||
String actual = trimRight(actualLines[i]);
|
||||
assertEquals(String.format("Difference in %s on line %d", name, i + 1), expected, actual);
|
||||
}
|
||||
if (expectedLines.length > actualLines.length) {
|
||||
@@ -237,6 +237,15 @@ public abstract class AbstractRunTests {
|
||||
}
|
||||
}
|
||||
|
||||
private static String trimRight(String in) {
|
||||
int endIdx = in.length() - 1;
|
||||
while (endIdx > -1 && Character.isWhitespace(in.charAt(endIdx))) {
|
||||
endIdx--;
|
||||
}
|
||||
|
||||
return in.substring(0, endIdx);
|
||||
}
|
||||
|
||||
private static String[] removeBlanks(String[] in) {
|
||||
List<String> out = new ArrayList<String>();
|
||||
for (String s : in) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2010-2013 The Project Lombok Authors.
|
||||
* Copyright (C) 2010-2014 The Project Lombok Authors.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -70,6 +70,7 @@ public class RunTestsViaEcj extends AbstractRunTests {
|
||||
warnings.put(CompilerOptions.OPTION_ReportUnusedLabel, "ignore");
|
||||
warnings.put(CompilerOptions.OPTION_ReportUnusedImport, "ignore");
|
||||
warnings.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, "ignore");
|
||||
warnings.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_7);
|
||||
options.set(warnings);
|
||||
return options;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ import lombok.extern.apachecommons.CommonsLog;
|
||||
super();
|
||||
}
|
||||
}
|
||||
@CommonsLog("DifferentName") class LoggerCommonsWithDifferentName {
|
||||
@CommonsLog(topic = "DifferentName") class LoggerCommonsWithDifferentName {
|
||||
private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog("DifferentName");
|
||||
<clinit>() {
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ import lombok.extern.java.Log;
|
||||
super();
|
||||
}
|
||||
}
|
||||
@Log("DifferentName") class LoggerJulWithDifferentName {
|
||||
@Log(topic = "DifferentName") class LoggerJulWithDifferentName {
|
||||
private static final java.util.logging.Logger log = java.util.logging.Logger.getLogger("DifferentName");
|
||||
<clinit>() {
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ import lombok.extern.log4j.Log4j;
|
||||
super();
|
||||
}
|
||||
}
|
||||
@Log4j("DifferentName") class LoggerLog4jWithDifferentName {
|
||||
@Log4j(topic = "DifferentName") class LoggerLog4jWithDifferentName {
|
||||
private static final org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger("DifferentName");
|
||||
<clinit>() {
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ import lombok.extern.log4j.Log4j2;
|
||||
super();
|
||||
}
|
||||
}
|
||||
@Log4j2("DifferentName") class LoggerLog4j2WithDifferentName {
|
||||
@Log4j2(topic = "DifferentName") class LoggerLog4j2WithDifferentName {
|
||||
private static final org.apache.logging.log4j.Logger log = org.apache.logging.log4j.LogManager.getLogger("DifferentName");
|
||||
<clinit>() {
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ class LoggerSlf4jOuter {
|
||||
}
|
||||
}
|
||||
|
||||
@Slf4j("DifferentLogger") class LoggerSlf4jWithDifferentLoggerName {
|
||||
@Slf4j(topic = "DifferentLogger") class LoggerSlf4jWithDifferentLoggerName {
|
||||
private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger("DifferentLogger");
|
||||
<clinit>() {
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ import lombok.extern.slf4j.XSlf4j;
|
||||
super();
|
||||
}
|
||||
}
|
||||
@XSlf4j("DifferentName") class LoggerXSlf4jWithDifferentName {
|
||||
@XSlf4j(topic = "DifferentName") class LoggerXSlf4jWithDifferentName {
|
||||
private static final org.slf4j.ext.XLogger log = org.slf4j.ext.XLoggerFactory.getXLogger("DifferentName");
|
||||
<clinit>() {
|
||||
}
|
||||
|
||||
@@ -11,7 +11,8 @@ class NonNullWithSneakyThrows {
|
||||
}
|
||||
System.out.println(in);
|
||||
}
|
||||
catch (final java.lang.Throwable $ex) {
|
||||
catch (final java.lang.Throwable $ex)
|
||||
{
|
||||
throw lombok.Lombok.sneakyThrow($ex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,11 +13,13 @@ class SneakyThrowsMultiple {
|
||||
System.out.println("test1");
|
||||
throw new IOException();
|
||||
}
|
||||
catch (final IOException $ex) {
|
||||
catch (final IOException $ex)
|
||||
{
|
||||
throw lombok.Lombok.sneakyThrow($ex);
|
||||
}
|
||||
}
|
||||
catch (final Throwable $ex) {
|
||||
catch (final Throwable $ex)
|
||||
{
|
||||
throw lombok.Lombok.sneakyThrow($ex);
|
||||
}
|
||||
}
|
||||
@@ -36,11 +38,13 @@ class SneakyThrowsMultiple {
|
||||
throw new AWTException("WHAT");
|
||||
}
|
||||
}
|
||||
catch (final AWTException $ex) {
|
||||
catch (final AWTException $ex)
|
||||
{
|
||||
throw lombok.Lombok.sneakyThrow($ex);
|
||||
}
|
||||
}
|
||||
catch (final IOException $ex) {
|
||||
catch (final IOException $ex)
|
||||
{
|
||||
throw lombok.Lombok.sneakyThrow($ex);
|
||||
}
|
||||
}
|
||||
@@ -52,11 +56,13 @@ class SneakyThrowsMultiple {
|
||||
System.out.println("test3");
|
||||
throw new IOException();
|
||||
}
|
||||
catch (final IOException $ex) {
|
||||
catch (final IOException $ex)
|
||||
{
|
||||
throw lombok.Lombok.sneakyThrow($ex);
|
||||
}
|
||||
}
|
||||
catch (final Throwable $ex) {
|
||||
catch (final Throwable $ex)
|
||||
{
|
||||
throw lombok.Lombok.sneakyThrow($ex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,8 @@ class SneakyThrowsPlain {
|
||||
{
|
||||
System.out.println("constructor");
|
||||
}
|
||||
catch (final java.lang.Throwable $ex) {
|
||||
catch (final java.lang.Throwable $ex)
|
||||
{
|
||||
throw lombok.Lombok.sneakyThrow($ex);
|
||||
}
|
||||
}
|
||||
@@ -16,7 +17,8 @@ class SneakyThrowsPlain {
|
||||
{
|
||||
System.out.println("constructor2");
|
||||
}
|
||||
catch (final java.lang.Throwable $ex) {
|
||||
catch (final java.lang.Throwable $ex)
|
||||
{
|
||||
throw lombok.Lombok.sneakyThrow($ex);
|
||||
}
|
||||
}
|
||||
@@ -25,7 +27,8 @@ class SneakyThrowsPlain {
|
||||
{
|
||||
System.out.println("test1");
|
||||
}
|
||||
catch (final java.lang.Throwable $ex) {
|
||||
catch (final java.lang.Throwable $ex)
|
||||
{
|
||||
throw lombok.Lombok.sneakyThrow($ex);
|
||||
}
|
||||
}
|
||||
@@ -34,7 +37,8 @@ class SneakyThrowsPlain {
|
||||
{
|
||||
System.out.println("test2");
|
||||
}
|
||||
catch (final java.lang.Throwable $ex) {
|
||||
catch (final java.lang.Throwable $ex)
|
||||
{
|
||||
throw lombok.Lombok.sneakyThrow($ex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,8 @@ class SneakyThrowsSingle {
|
||||
{
|
||||
System.out.println("test1");
|
||||
}
|
||||
catch (final Throwable $ex) {
|
||||
catch (final Throwable $ex)
|
||||
{
|
||||
throw lombok.Lombok.sneakyThrow($ex);
|
||||
}
|
||||
}
|
||||
@@ -18,7 +19,8 @@ class SneakyThrowsSingle {
|
||||
System.out.println("test2");
|
||||
throw new IOException();
|
||||
}
|
||||
catch (final IOException $ex) {
|
||||
catch (final IOException $ex)
|
||||
{
|
||||
throw lombok.Lombok.sneakyThrow($ex);
|
||||
}
|
||||
}
|
||||
@@ -28,7 +30,8 @@ class SneakyThrowsSingle {
|
||||
System.out.println("test3");
|
||||
throw new IOException();
|
||||
}
|
||||
catch (final IOException $ex) {
|
||||
catch (final IOException $ex)
|
||||
{
|
||||
throw lombok.Lombok.sneakyThrow($ex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ public class ValComplex {
|
||||
final @val int field = 20;
|
||||
final @val int inner = 10;
|
||||
switch (field) {
|
||||
case 5 : ;
|
||||
case 5 :
|
||||
final @val char[] shouldBeCharArray2 = shouldBeCharArray;
|
||||
final @val int innerInner = inner;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
import lombok.val;
|
||||
import java.io.IOException;
|
||||
public class ValInTryWithResources {
|
||||
public ValInTryWithResources() {
|
||||
super();
|
||||
}
|
||||
public void whyTryInsteadOfCleanup() throws IOException {
|
||||
try (final @val java.io.InputStream in = getClass().getResourceAsStream("ValInTryWithResources.class"))
|
||||
{
|
||||
final @val java.io.InputStream i = in;
|
||||
final @val int j = in.read();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -32,7 +32,8 @@ public class ValLessSimple {
|
||||
{
|
||||
final @val int x = (1 / 0);
|
||||
}
|
||||
catch (ArithmeticException e) {
|
||||
catch (ArithmeticException e)
|
||||
{
|
||||
final @val int y = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,6 @@ class LoggerCommons {
|
||||
class LoggerCommonsWithImport {
|
||||
}
|
||||
|
||||
@CommonsLog("DifferentName")
|
||||
@CommonsLog(topic="DifferentName")
|
||||
class LoggerCommonsWithDifferentName {
|
||||
}
|
||||
@@ -8,6 +8,6 @@ class LoggerJul {
|
||||
class LoggerJulWithImport {
|
||||
}
|
||||
|
||||
@Log("DifferentName")
|
||||
@Log(topic="DifferentName")
|
||||
class LoggerJulWithDifferentName {
|
||||
}
|
||||
@@ -8,6 +8,6 @@ class LoggerLog4j {
|
||||
class LoggerLog4jWithImport {
|
||||
}
|
||||
|
||||
@Log4j("DifferentName")
|
||||
@Log4j(topic="DifferentName")
|
||||
class LoggerLog4jWithDifferentName {
|
||||
}
|
||||
@@ -8,6 +8,6 @@ class LoggerLog4j2 {
|
||||
class LoggerLog4j2WithImport {
|
||||
}
|
||||
|
||||
@Log4j2("DifferentName")
|
||||
@Log4j2(topic="DifferentName")
|
||||
class LoggerLog4j2WithDifferentName {
|
||||
}
|
||||
@@ -15,6 +15,6 @@ class LoggerSlf4jOuter {
|
||||
}
|
||||
}
|
||||
|
||||
@Slf4j("DifferentLogger")
|
||||
@Slf4j(topic="DifferentLogger")
|
||||
class LoggerSlf4jWithDifferentLoggerName {
|
||||
}
|
||||
@@ -8,6 +8,6 @@ class LoggerXSlf4j {
|
||||
class LoggerXSlf4jWithImport {
|
||||
}
|
||||
|
||||
@XSlf4j("DifferentName")
|
||||
@XSlf4j(topic="DifferentName")
|
||||
class LoggerXSlf4jWithDifferentName {
|
||||
}
|
||||
@@ -17,7 +17,7 @@ public class LogExampleOther {
|
||||
}
|
||||
}
|
||||
|
||||
@CommonsLog("CounterLog")
|
||||
@CommonsLog(topic="CounterLog")
|
||||
public class LogExampleCategory {
|
||||
|
||||
public static void main(String... args) {
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
<dd>Creates <code><span class="keyword">private static final </span><a href="http://www.slf4j.org/api/org/slf4j/ext/XLogger.html">org.slf4j.ext.XLogger</a> <span class="staticfield">log</span> = <a href="http://www.slf4j.org/apidocs/org/slf4j/ext/XLoggerFactory.html#getXLogger(java.lang.Class)">org.slf4j.ext.XLoggerFactory.getXLogger</a>(LogExample.<span class="keyword">class</span>);</code></dd>
|
||||
</dl>
|
||||
</p><p>
|
||||
By default, the category (or name) of the logger will be the type where the annotation was placed. This can be customised by specifying a value for the category.
|
||||
By default, the topic (or name) of the logger will be the class name of the class annotated with the <code>@Log</code> annotation. This can be customised by specifying the <code>topic</code> parameter. For example: <code>@XSlf4j(topic="reporting")</code>.
|
||||
</p>
|
||||
</div>
|
||||
<div class="snippets">
|
||||
@@ -54,10 +54,7 @@
|
||||
<p>
|
||||
If a field called <code>log</code> already exists, a warning will be emitted and no code will be generated.
|
||||
</p><p>
|
||||
A future feature of lombok's diverse log annotations is to find calls to the logger field and, if the chosen logging framework supports
|
||||
it and the log level can be compile-time determined from the log call, guard it with an <code>if</code> statement. This way if
|
||||
the log statement ends up being ignored, the potentially expensive calculation of the log string is avoided entirely. This does mean
|
||||
that you should <em>NOT</em> put any side-effects in the expression that you log.
|
||||
A future feature of lombok's diverse log annotations is to find calls to the logger field and, if the chosen logging framework supports it and the log level can be compile-time determined from the log call, guard it with an <code>if</code> statement. This way if the log statement ends up being ignored, the potentially expensive calculation of the log string is avoided entirely. This does mean that you should <em>NOT</em> put any side-effects in the expression that you log.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user