aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/lombok/eclipse/handlers/HandleBuilder.java12
-rw-r--r--src/core/lombok/javac/handlers/HandleBuilder.java2
2 files changed, 12 insertions, 2 deletions
diff --git a/src/core/lombok/eclipse/handlers/HandleBuilder.java b/src/core/lombok/eclipse/handlers/HandleBuilder.java
index 280afc26..5fb98800 100644
--- a/src/core/lombok/eclipse/handlers/HandleBuilder.java
+++ b/src/core/lombok/eclipse/handlers/HandleBuilder.java
@@ -536,7 +536,17 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> {
boolean obtainIsStatic = bfd.obtainVia.isStatic();
for (int i = 0; i < tgt.length; i++) {
MessageSend obtainExpr = new MessageSend();
- obtainExpr.receiver = obtainIsStatic ? new SingleNameReference(type.getName().toCharArray(), 0) : new ThisReference(0, 0);
+ if (obtainIsStatic) {
+ if (typeParams != null && typeParams.length > 0) {
+ obtainExpr.typeArguments = new TypeReference[typeParams.length];
+ for (int j = 0; j<typeParams.length; j++) {
+ obtainExpr.typeArguments[j] = new SingleTypeReference(typeParams[j].name, 0);
+ }
+ }
+ obtainExpr.receiver = new SingleNameReference(type.getName().toCharArray(), 0);
+ } else {
+ obtainExpr.receiver = new ThisReference(0, 0);
+ }
obtainExpr.selector = obtainName.toCharArray();
if (obtainIsStatic) obtainExpr.arguments = new Expression[] {new ThisReference(0, 0)};
tgt[i] = obtainExpr;
diff --git a/src/core/lombok/javac/handlers/HandleBuilder.java b/src/core/lombok/javac/handlers/HandleBuilder.java
index 6dd98c6f..903844d2 100644
--- a/src/core/lombok/javac/handlers/HandleBuilder.java
+++ b/src/core/lombok/javac/handlers/HandleBuilder.java
@@ -506,7 +506,7 @@ public class HandleBuilder extends JavacAnnotationHandler<Builder> {
if (bfd.obtainVia.isStatic()) {
for (int i = 0; i < tgt.length; i++) {
JCExpression c = maker.Select(maker.Ident(type.toName(type.getName())), type.toName(bfd.obtainVia.method()));
- tgt[i] = maker.Apply(List.<JCExpression>nil(), c, List.<JCExpression>of(maker.Ident(type.toName("this"))));
+ tgt[i] = maker.Apply(typeParameterNames(maker, typeParams), c, List.<JCExpression>of(maker.Ident(type.toName("this"))));
}
} else {
for (int i = 0; i < tgt.length; i++) {