aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/lombok/javac/handlers/HandleConstructor.java11
-rw-r--r--test/transform/resource/after-delombok/ConstructorInner.java11
-rw-r--r--test/transform/resource/after-ecj/ConstructorInner.java13
-rw-r--r--test/transform/resource/before/ConstructorInner.java5
4 files changed, 31 insertions, 9 deletions
diff --git a/src/core/lombok/javac/handlers/HandleConstructor.java b/src/core/lombok/javac/handlers/HandleConstructor.java
index d022995a..e0abb53b 100644
--- a/src/core/lombok/javac/handlers/HandleConstructor.java
+++ b/src/core/lombok/javac/handlers/HandleConstructor.java
@@ -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();
diff --git a/test/transform/resource/after-delombok/ConstructorInner.java b/test/transform/resource/after-delombok/ConstructorInner.java
new file mode 100644
index 00000000..fb0852dc
--- /dev/null
+++ b/test/transform/resource/after-delombok/ConstructorInner.java
@@ -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();
+ }
+ }
+} \ No newline at end of file
diff --git a/test/transform/resource/after-ecj/ConstructorInner.java b/test/transform/resource/after-ecj/ConstructorInner.java
new file mode 100644
index 00000000..be8ea17e
--- /dev/null
+++ b/test/transform/resource/after-ecj/ConstructorInner.java
@@ -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();
+ }
+} \ No newline at end of file
diff --git a/test/transform/resource/before/ConstructorInner.java b/test/transform/resource/before/ConstructorInner.java
new file mode 100644
index 00000000..dd74d43a
--- /dev/null
+++ b/test/transform/resource/before/ConstructorInner.java
@@ -0,0 +1,5 @@
+class ConstructorInner {
+ @lombok.AllArgsConstructor(staticName = "of")
+ static class Inner {
+ }
+} \ No newline at end of file