mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-15 02:17:12 +00:00
Have j.u.l. be invoked with TargetType.class.getName() instead of "TargetType"
This commit is contained in:
1 parent
529a480ca9
commit
5915032899
4 files changed
+26
-13
No files matched your search
@@ -42,7 +42,6 @@ import org.eclipse.jdt.internal.compiler.ast.MessageSend;
|
||||
import org.eclipse.jdt.internal.compiler.ast.NameReference;
|
||||
import org.eclipse.jdt.internal.compiler.ast.QualifiedNameReference;
|
||||
import org.eclipse.jdt.internal.compiler.ast.QualifiedTypeReference;
|
||||
import org.eclipse.jdt.internal.compiler.ast.StringLiteral;
|
||||
import org.eclipse.jdt.internal.compiler.ast.TypeDeclaration;
|
||||
import org.eclipse.jdt.internal.compiler.ast.TypeReference;
|
||||
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
|
||||
@@ -216,12 +215,23 @@ public class HandleLog {
|
||||
// private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog(TargetType.class);
|
||||
COMMONS(lombok.jul.Log.class, "org.apache.commons.logging.Log", "org.apache.commons.logging.LogFactory", "getLog"),
|
||||
|
||||
// private static final java.util.logging.Logger log = java.util.logging.Logger.getLogger("TargetType");
|
||||
// private static final java.util.logging.Logger log = java.util.logging.Logger.getLogger(TargetType.class.getName());
|
||||
JUL(lombok.jul.Log.class, "java.util.logging.Logger", "java.util.logging.Logger", "getLogger") {
|
||||
@Override public Expression createFactoryParameter(String typeName, Annotation source) {
|
||||
Expression current = new StringLiteral(typeName.toCharArray(), source.sourceStart, source.sourceEnd, 0);
|
||||
Eclipse.setGeneratedBy(current, source);
|
||||
return current;
|
||||
int pS = source.sourceStart, pE = source.sourceEnd;
|
||||
long p = (long)pS << 32 | pE;
|
||||
|
||||
MessageSend factoryParameterCall = new MessageSend();
|
||||
Eclipse.setGeneratedBy(factoryParameterCall, source);
|
||||
|
||||
factoryParameterCall.receiver = super.createFactoryParameter(typeName, source);
|
||||
factoryParameterCall.selector = "getName".toCharArray();
|
||||
|
||||
factoryParameterCall.nameSourcePosition = p;
|
||||
factoryParameterCall.sourceStart = pS;
|
||||
factoryParameterCall.sourceEnd = factoryParameterCall.statementEnd = pE;
|
||||
|
||||
return factoryParameterCall;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -155,10 +155,13 @@ public class HandleLog {
|
||||
// private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog(TargetType.class);
|
||||
COMMONS(lombok.jul.Log.class, "org.apache.commons.logging.Log", "org.apache.commons.logging.LogFactory.getLog"),
|
||||
|
||||
// private static final java.util.logging.Logger log = java.util.logging.Logger.getLogger("TargetType");
|
||||
// private static final java.util.logging.Logger log = java.util.logging.Logger.getLogger(TargetType.class.getName());
|
||||
JUL(lombok.jul.Log.class, "java.util.logging.Logger", "java.util.logging.Logger.getLogger") {
|
||||
@Override public JCExpression createFactoryParameter(JavacNode typeNode, String typeName) {
|
||||
return typeNode.getTreeMaker().Literal(typeName);
|
||||
TreeMaker maker = typeNode.getTreeMaker();
|
||||
JCExpression classAccess = super.createFactoryParameter(typeNode, typeName);
|
||||
JCExpression method = maker.Select(classAccess, typeNode.toName("getName"));
|
||||
return maker.Apply(List.<JCExpression>nil(), method, List.<JCExpression>nil());
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
class LoggerJul {
|
||||
private static final java.util.logging.Logger log = java.util.logging.Logger.getLogger("LoggerJul");
|
||||
private static final java.util.logging.Logger log = java.util.logging.Logger.getLogger(LoggerJul.class.getName());
|
||||
}
|
||||
class LoggerJulString {
|
||||
private static final java.util.logging.Logger log = java.util.logging.Logger.getLogger("String");
|
||||
private static final java.util.logging.Logger log = java.util.logging.Logger.getLogger(String.class.getName());
|
||||
}
|
||||
class LoggerJulJavaLangString {
|
||||
private static final java.util.logging.Logger log = java.util.logging.Logger.getLogger("java.lang.String");
|
||||
private static final java.util.logging.Logger log = java.util.logging.Logger.getLogger(java.lang.String.class.getName());
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
@lombok.jul.Log class LoggerJul {
|
||||
private static final java.util.logging.Logger log = java.util.logging.Logger.getLogger("LoggerJul");
|
||||
private static final java.util.logging.Logger log = java.util.logging.Logger.getLogger(LoggerJul.class.getName());
|
||||
<clinit>() {
|
||||
}
|
||||
LoggerJul() {
|
||||
@@ -7,7 +7,7 @@
|
||||
}
|
||||
}
|
||||
@lombok.jul.Log(String.class) class LoggerJulString {
|
||||
private static final java.util.logging.Logger log = java.util.logging.Logger.getLogger("String");
|
||||
private static final java.util.logging.Logger log = java.util.logging.Logger.getLogger(String.class.getName());
|
||||
<clinit>() {
|
||||
}
|
||||
LoggerJulString() {
|
||||
@@ -15,7 +15,7 @@
|
||||
}
|
||||
}
|
||||
@lombok.jul.Log(java.lang.String.class) class LoggerJulJavaLangString {
|
||||
private static final java.util.logging.Logger log = java.util.logging.Logger.getLogger("java.lang.String");
|
||||
private static final java.util.logging.Logger log = java.util.logging.Logger.getLogger(java.lang.String.class.getName());
|
||||
<clinit>() {
|
||||
}
|
||||
LoggerJulJavaLangString() {
|
||||
|
||||
Reference in new issue
Block a user