diff options
-rw-r--r-- | doc/changelog.markdown | 1 | ||||
-rw-r--r-- | src/core/lombok/javac/handlers/HandleBuilder.java | 7 |
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()); |