aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok/eclipse/handlers
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/lombok/eclipse/handlers')
-rwxr-xr-xsrc/core/lombok/eclipse/handlers/HandleBuilder.java8
-rw-r--r--src/core/lombok/eclipse/handlers/HandleSuperBuilder.java12
2 files changed, 13 insertions, 7 deletions
diff --git a/src/core/lombok/eclipse/handlers/HandleBuilder.java b/src/core/lombok/eclipse/handlers/HandleBuilder.java
index 189c5a69..59862f2c 100755
--- a/src/core/lombok/eclipse/handlers/HandleBuilder.java
+++ b/src/core/lombok/eclipse/handlers/HandleBuilder.java
@@ -202,8 +202,12 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> {
}
String replaceBuilderClassName(char[] name) {
- if (builderClassName.indexOf('*') == -1) return builderClassName;
- return builderClassName.replace("*", new String(name));
+ return replaceBuilderClassName(name, builderClassName);
+ }
+
+ String replaceBuilderClassName(char[] name, String template) {
+ if (template.indexOf('*') == -1) return template;
+ return template.replace("*", new String(name));
}
String replaceBuilderClassName(String name) {
diff --git a/src/core/lombok/eclipse/handlers/HandleSuperBuilder.java b/src/core/lombok/eclipse/handlers/HandleSuperBuilder.java
index 8fdfd315..e489c258 100644
--- a/src/core/lombok/eclipse/handlers/HandleSuperBuilder.java
+++ b/src/core/lombok/eclipse/handlers/HandleSuperBuilder.java
@@ -272,8 +272,9 @@ public class HandleSuperBuilder extends EclipseAnnotationHandler<SuperBuilder> {
};
if (extendsClause instanceof QualifiedTypeReference) {
QualifiedTypeReference qualifiedTypeReference = (QualifiedTypeReference)extendsClause;
- String superclassClassName = String.valueOf(qualifiedTypeReference.getLastToken());
- String superclassBuilderClassName = job.replaceBuilderClassName(superclassClassName);
+ char[] superclassClassName = qualifiedTypeReference.getLastToken();
+ String builderClassNameTemplate = BuilderJob.fixBuilderClassName(annotationNode, "");
+ String superclassBuilderClassName = job.replaceBuilderClassName(superclassClassName, builderClassNameTemplate);
char[][] tokens = Arrays.copyOf(qualifiedTypeReference.tokens, qualifiedTypeReference.tokens.length + 1);
tokens[tokens.length-1] = superclassBuilderClassName.toCharArray();
@@ -289,10 +290,11 @@ public class HandleSuperBuilder extends EclipseAnnotationHandler<SuperBuilder> {
superclassBuilderClass = new ParameterizedQualifiedTypeReference(tokens, typeArgsForTokens, 0, poss);
} else if (extendsClause != null) {
- String superClass = String.valueOf(extendsClause.getTypeName()[0]);
- String superclassBuilderClassName = superClass + "Builder";
+ char[] superclassClassName = extendsClause.getTypeName()[0];
+ String builderClassNameTemplate = BuilderJob.fixBuilderClassName(annotationNode, "");
+ String superclassBuilderClassName = job.replaceBuilderClassName(superclassClassName, builderClassNameTemplate);
- char[][] tokens = new char[][] {superClass.toCharArray(), superclassBuilderClassName.toCharArray()};
+ char[][] tokens = new char[][] {superclassClassName, superclassBuilderClassName.toCharArray()};
long[] poss = new long[tokens.length];
Arrays.fill(poss, job.getPos());