aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2015-05-15 12:14:14 +0200
committerReinier Zwitserloot <reinier@zwitserloot.com>2015-05-15 12:14:14 +0200
commit49d7986a02866a422045304d9cec126629181f20 (patch)
tree08cced3ff78bbc12944527d6afd6c271c75895c6
parentff3ac901683165e24c35247179eaef78d1101152 (diff)
downloadlombok-49d7986a02866a422045304d9cec126629181f20.tar.gz
lombok-49d7986a02866a422045304d9cec126629181f20.tar.bz2
lombok-49d7986a02866a422045304d9cec126629181f20.zip
[i793] Parameterized static methods with Builder would produce compiler errors in javac.
-rw-r--r--doc/changelog.markdown1
-rw-r--r--src/core/lombok/javac/handlers/HandleBuilder.java7
2 files changed, 4 insertions, 4 deletions
diff --git a/doc/changelog.markdown b/doc/changelog.markdown
index 0a72d9b8..c08f564b 100644
--- a/doc/changelog.markdown
+++ b/doc/changelog.markdown
@@ -2,6 +2,7 @@ Lombok Changelog
----------------
### v1.16.5 "Edgy Guinea Pig"
+* BUGFIX: Parameterized static methods with `@Builder` would produce compiler errors in javac. [Issue #793](https://code.google.com/p/projectlombok/issues/detail?id=793).
### v1.16.4 (April 14th, 2015)
* BUGFIX: Lombok now works with Eclipse Mars.
diff --git a/src/core/lombok/javac/handlers/HandleBuilder.java b/src/core/lombok/javac/handlers/HandleBuilder.java
index 30fec45b..7ef7b859 100644
--- a/src/core/lombok/javac/handlers/HandleBuilder.java
+++ b/src/core/lombok/javac/handlers/HandleBuilder.java
@@ -175,10 +175,10 @@ public class HandleBuilder extends JavacAnnotationHandler<Builder> {
typeParams = jmd.typarams;
thrownExceptions = jmd.thrown;
nameOfStaticBuilderMethod = jmd.name;
+ if (returnType instanceof JCTypeApply) {
+ returnType = ((JCTypeApply) returnType).clazz;
+ }
if (builderClassName.isEmpty()) {
- if (returnType instanceof JCTypeApply) {
- returnType = ((JCTypeApply) returnType).clazz;
- }
if (returnType instanceof JCFieldAccess) {
builderClassName = ((JCFieldAccess) returnType).name.toString() + "Builder";
} else if (returnType instanceof JCIdent) {
@@ -196,7 +196,6 @@ public class HandleBuilder extends JavacAnnotationHandler<Builder> {
if (Character.isLowerCase(builderClassName.charAt(0))) {
builderClassName = Character.toTitleCase(builderClassName.charAt(0)) + builderClassName.substring(1);
}
-
} else {
// This shouldn't happen.
System.err.println("Lombok bug ID#20140614-1651: javac HandleBuilder: return type to name conversion failed: " + returnType.getClass());