mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-16 06:14:36 +00:00
[trivial] improving consistency between javac vs. ecj output
wasn't worth an issue on the tracker: javac and ecj handlers for static constructors would differ; ecjs would specify the return type and constructor invocation using fully qualified types, whereas the handler for javac did not.
This commit is contained in:
4 files changed
+31
-9
No files matched your search
@@ -459,22 +459,15 @@ public class HandleConstructor {
|
||||
|
||||
ListBuffer<JCTypeParameter> typeParams = new ListBuffer<JCTypeParameter>();
|
||||
ListBuffer<JCVariableDecl> params = new ListBuffer<JCVariableDecl>();
|
||||
ListBuffer<JCExpression> typeArgs1 = new ListBuffer<JCExpression>();
|
||||
ListBuffer<JCExpression> typeArgs2 = new ListBuffer<JCExpression>();
|
||||
ListBuffer<JCExpression> args = new ListBuffer<JCExpression>();
|
||||
|
||||
if (!type.typarams.isEmpty()) {
|
||||
for (JCTypeParameter param : type.typarams) {
|
||||
typeArgs1.append(maker.Ident(param.name));
|
||||
typeArgs2.append(maker.Ident(param.name));
|
||||
typeParams.append(maker.TypeParameter(param.name, param.bounds));
|
||||
}
|
||||
returnType = maker.TypeApply(maker.Ident(type.name), typeArgs1.toList());
|
||||
constructorType = maker.TypeApply(maker.Ident(type.name), typeArgs2.toList());
|
||||
} else {
|
||||
returnType = maker.Ident(type.name);
|
||||
constructorType = maker.Ident(type.name);
|
||||
}
|
||||
returnType = namePlusTypeParamsToTypeReference(maker, typeNode, type.typarams);
|
||||
constructorType = namePlusTypeParamsToTypeReference(maker, typeNode, type.typarams);
|
||||
|
||||
for (JavacNode fieldNode : fields) {
|
||||
JCVariableDecl field = (JCVariableDecl) fieldNode.get();
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
class ConstructorInner {
|
||||
static class Inner {
|
||||
@java.lang.SuppressWarnings("all")
|
||||
private Inner() {
|
||||
}
|
||||
@java.lang.SuppressWarnings("all")
|
||||
public static ConstructorInner.Inner of() {
|
||||
return new ConstructorInner.Inner();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
class ConstructorInner {
|
||||
static @lombok.AllArgsConstructor(staticName = "of") class Inner {
|
||||
private @java.lang.SuppressWarnings("all") Inner() {
|
||||
super();
|
||||
}
|
||||
public static @java.lang.SuppressWarnings("all") ConstructorInner.Inner of() {
|
||||
return new ConstructorInner.Inner();
|
||||
}
|
||||
}
|
||||
ConstructorInner() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
class ConstructorInner {
|
||||
@lombok.AllArgsConstructor(staticName = "of")
|
||||
static class Inner {
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user