diff options
26 files changed, 474 insertions, 454 deletions
diff --git a/src/core/lombok/eclipse/handlers/EclipseSingularsRecipes.java b/src/core/lombok/eclipse/handlers/EclipseSingularsRecipes.java index da0bf471..0f463ae2 100755 --- a/src/core/lombok/eclipse/handlers/EclipseSingularsRecipes.java +++ b/src/core/lombok/eclipse/handlers/EclipseSingularsRecipes.java @@ -120,6 +120,7 @@ public class EclipseSingularsRecipes { private final EclipseNode annotation; private final char[] singularName; private final char[] pluralName; + private final char[] setterPrefix; private final List<TypeReference> typeArgs; private final String targetFqn; private final EclipseSingularizer singularizer; @@ -133,8 +134,20 @@ public class EclipseSingularsRecipes { this.targetFqn = targetFqn; this.singularizer = singularizer; this.source = source; + this.setterPrefix = new char[0]; } - + + public SingularData(EclipseNode annotation, char[] singularName, char[] pluralName, List<TypeReference> typeArgs, String targetFqn, EclipseSingularizer singularizer, ASTNode source, char[] setterPrefix) { + this.annotation = annotation; + this.singularName = singularName; + this.pluralName = pluralName; + this.typeArgs = typeArgs; + this.targetFqn = targetFqn; + this.singularizer = singularizer; + this.source = source; + this.setterPrefix = setterPrefix; + } + public void setGeneratedByRecursive(ASTNode target) { SetGeneratedByVisitor visitor = new SetGeneratedByVisitor(source); @@ -162,7 +175,11 @@ public class EclipseSingularsRecipes { public char[] getPluralName() { return pluralName; } - + + public char[] getSetterPrefix() { + return setterPrefix; + } + public List<TypeReference> getTypeArgs() { return typeArgs; } diff --git a/src/core/lombok/eclipse/handlers/HandleBuilder.java b/src/core/lombok/eclipse/handlers/HandleBuilder.java index 05686429..ec2be523 100755 --- a/src/core/lombok/eclipse/handlers/HandleBuilder.java +++ b/src/core/lombok/eclipse/handlers/HandleBuilder.java @@ -1,16 +1,16 @@ /* * Copyright (C) 2013-2019 The Project Lombok Authors. - * + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -101,17 +101,17 @@ import lombok.experimental.NonFinal; @HandlerPriority(-1024) //-2^10; to ensure we've picked up @FieldDefault's changes (-2048) but @Value hasn't removed itself yet (-512), so that we can error on presence of it on the builder classes. public class HandleBuilder extends EclipseAnnotationHandler<Builder> { private HandleConstructor handleConstructor = new HandleConstructor(); - + private static final char[] CLEAN_FIELD_NAME = "$lombokUnclean".toCharArray(); private static final char[] CLEAN_METHOD_NAME = "$lombokClean".toCharArray(); - + private static final boolean toBoolean(Object expr, boolean defaultValue) { if (expr == null) return defaultValue; if (expr instanceof FalseLiteral) return false; if (expr instanceof TrueLiteral) return true; return ((Boolean) expr).booleanValue(); } - + static class BuilderFieldData { Annotation[] annotations; TypeReference type; @@ -124,10 +124,10 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { ObtainVia obtainVia; EclipseNode obtainViaNode; EclipseNode originalFieldNode; - + List<EclipseNode> createdFields = new ArrayList<EclipseNode>(); } - + private static boolean equals(String a, char[] b) { if (a.length() != b.length) return false; for (int i = 0; i < b.length; i++) { @@ -135,7 +135,7 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { } return true; } - + private static boolean equals(String a, char[][] b) { if (a == null || a.isEmpty()) return b.length == 0; String[] aParts = a.split("\\."); @@ -145,24 +145,24 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { } return true; } - + private static final char[] DEFAULT_PREFIX = {'$', 'd', 'e', 'f', 'a', 'u', 'l', 't', '$'}; private static final char[] SET_PREFIX = {'$', 's', 'e', 't'}; private static final char[] VALUE_PREFIX = {'$', 'v', 'a', 'l', 'u', 'e'}; - + private static final char[] prefixWith(char[] prefix, char[] name) { char[] out = new char[prefix.length + name.length]; System.arraycopy(prefix, 0, out, 0, prefix.length); System.arraycopy(name, 0, out, prefix.length, name.length); return out; } - + @Override public void handle(AnnotationValues<Builder> annotation, Annotation ast, EclipseNode annotationNode) { handleFlagUsage(annotationNode, ConfigurationKeys.BUILDER_FLAG_USAGE, "@Builder"); CheckerFrameworkVersion cfv = getCheckerFrameworkVersion(annotationNode); long p = (long) ast.sourceStart << 32 | ast.sourceEnd; - + Builder builderInstance = annotation.getInstance(); AccessLevel accessForOuters = builderInstance.access(); if (accessForOuters == null) accessForOuters = AccessLevel.PUBLIC; @@ -171,22 +171,22 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { accessForOuters = AccessLevel.PUBLIC; } AccessLevel accessForInners = accessForOuters == AccessLevel.PROTECTED ? AccessLevel.PUBLIC : accessForOuters; - + // These exist just to support the 'old' lombok.experimental.Builder, which had these properties. lombok.Builder no longer has them. boolean fluent = toBoolean(annotation.getActualExpression("fluent"), true); boolean chain = toBoolean(annotation.getActualExpression("chain"), true); - + String builderMethodName = builderInstance.builderMethodName(); String buildMethodName = builderInstance.buildMethodName(); String builderClassName = builderInstance.builderClassName(); String toBuilderMethodName = "toBuilder"; boolean toBuilder = builderInstance.toBuilder(); List<char[]> typeArgsForToBuilder = null; - + if (builderMethodName == null) builderMethodName = "builder"; if (buildMethodName == null) buildMethodName = "build"; if (builderClassName == null) builderClassName = ""; - + boolean generateBuilderMethod; if (builderMethodName.isEmpty()) { generateBuilderMethod = false; @@ -195,74 +195,74 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { } else { generateBuilderMethod = true; } - + if (!checkName("buildMethodName", buildMethodName, annotationNode)) return; if (!builderClassName.isEmpty()) { if (!checkName("builderClassName", builderClassName, annotationNode)) return; } - + EclipseNode parent = annotationNode.up(); - + List<BuilderFieldData> builderFields = new ArrayList<BuilderFieldData>(); TypeReference returnType; TypeParameter[] typeParams; TypeReference[] thrownExceptions; char[] nameOfStaticBuilderMethod; EclipseNode tdParent; - + EclipseNode fillParametersFrom = parent.get() instanceof AbstractMethodDeclaration ? parent : null; boolean addCleaning = false; boolean isStatic = true; - + List<EclipseNode> nonFinalNonDefaultedFields = null; - + if (builderClassName.isEmpty()) builderClassName = annotationNode.getAst().readConfiguration(ConfigurationKeys.BUILDER_CLASS_NAME); if (builderClassName == null || builderClassName.isEmpty()) builderClassName = "*Builder"; boolean replaceNameInBuilderClassName = builderClassName.contains("*"); - + if (parent.get() instanceof TypeDeclaration) { tdParent = parent; TypeDeclaration td = (TypeDeclaration) tdParent.get(); - + List<EclipseNode> allFields = new ArrayList<EclipseNode>(); boolean valuePresent = (hasAnnotation(lombok.Value.class, parent) || hasAnnotation("lombok.experimental.Value", parent)); for (EclipseNode fieldNode : HandleConstructor.findAllFields(tdParent, true)) { FieldDeclaration fd = (FieldDeclaration) fieldNode.get(); EclipseNode isDefault = findAnnotation(Builder.Default.class, fieldNode); boolean isFinal = ((fd.modifiers & ClassFileConstants.AccFinal) != 0) || (valuePresent && !hasAnnotation(NonFinal.class, fieldNode)); - + Annotation[] copyableAnnotations = findCopyableAnnotations(fieldNode); - + BuilderFieldData bfd = new BuilderFieldData(); bfd.rawName = fieldNode.getName().toCharArray(); bfd.name = removePrefixFromField(fieldNode); bfd.builderFieldName = bfd.name; bfd.annotations = copyAnnotations(fd, copyableAnnotations); bfd.type = fd.type; - bfd.singularData = getSingularData(fieldNode, ast); + bfd.singularData = getSingularData(fieldNode, ast, builderInstance.setterPrefix()); bfd.originalFieldNode = fieldNode; - + if (bfd.singularData != null && isDefault != null) { isDefault.addError("@Builder.Default and @Singular cannot be mixed."); isDefault = null; } - + if (fd.initialization == null && isDefault != null) { isDefault.addWarning("@Builder.Default requires an initializing expression (' = something;')."); isDefault = null; } - + if (fd.initialization != null && isDefault == null) { if (isFinal) continue; if (nonFinalNonDefaultedFields == null) nonFinalNonDefaultedFields = new ArrayList<EclipseNode>(); nonFinalNonDefaultedFields.add(fieldNode); } - + if (isDefault != null) { bfd.nameOfDefaultProvider = prefixWith(DEFAULT_PREFIX, bfd.name); bfd.nameOfSetFlag = prefixWith(bfd.name, SET_PREFIX); bfd.builderFieldName = prefixWith(bfd.name, VALUE_PREFIX); - + MethodDeclaration md = generateDefaultProvider(bfd.nameOfDefaultProvider, td.typeParameters, fieldNode, ast); if (md != null) injectMethod(tdParent, md); } @@ -270,10 +270,10 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { builderFields.add(bfd); allFields.add(fieldNode); } - + handleConstructor.generateConstructor(tdParent, AccessLevel.PACKAGE, allFields, false, null, SkipIfConstructorExists.I_AM_BUILDER, Collections.<Annotation>emptyList(), annotationNode); - + returnType = namePlusTypeParamsToTypeReference(td.name, td.typeParameters, p); typeParams = td.typeParameters; thrownExceptions = null; @@ -286,7 +286,7 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { annotationNode.addError("@Builder is not supported on constructors with constructor type parameters."); return; } - + tdParent = parent.up(); TypeDeclaration td = (TypeDeclaration) tdParent.get(); returnType = namePlusTypeParamsToTypeReference(td.name, td.typeParameters, p); @@ -299,7 +299,7 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { MethodDeclaration md = (MethodDeclaration) parent.get(); tdParent = parent.up(); isStatic = md.isStatic(); - + if (toBuilder) { final String TO_BUILDER_NOT_SUPPORTED = "@Builder(toBuilder=true) is only supported if you return your own type."; char[] token; @@ -308,7 +308,7 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { annotationNode.addError(TO_BUILDER_NOT_SUPPORTED); return; } - + if (md.returnType instanceof SingleTypeReference) { token = ((SingleTypeReference) md.returnType).token; } else if (md.returnType instanceof QualifiedTypeReference) { @@ -321,17 +321,17 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { annotationNode.addError(TO_BUILDER_NOT_SUPPORTED); return; } - + if (pkg != null && !equals(parent.getPackageDeclaration(), pkg)) { annotationNode.addError(TO_BUILDER_NOT_SUPPORTED); return; } - + if (tdParent == null || !equals(tdParent.getName(), token)) { annotationNode.addError(TO_BUILDER_NOT_SUPPORTED); return; } - + TypeParameter[] tpOnType = ((TypeDeclaration) tdParent.get()).typeParameters; TypeParameter[] tpOnMethod = md.typeParameters; TypeReference[][] tpOnRet_ = null; @@ -341,7 +341,7 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { } else if (md.returnType instanceof ParameterizedQualifiedTypeReference) { tpOnRet_ = ((ParameterizedQualifiedTypeReference) md.returnType).typeArguments; } - + if (tpOnRet_ != null) for (int i = 0; i < tpOnRet_.length - 1; i++) { if (tpOnRet_[i] != null && tpOnRet_[i].length > 0) { annotationNode.addError("@Builder(toBuilder=true) is not supported if returning a type with generics applied to an intermediate."); @@ -350,11 +350,11 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { } TypeReference[] tpOnRet = tpOnRet_ == null ? null : tpOnRet_[tpOnRet_.length - 1]; typeArgsForToBuilder = new ArrayList<char[]>(); - + // Every typearg on this method needs to be found in the return type, but the reverse is not true. // We also need to 'map' them. - - + + if (tpOnMethod != null) for (TypeParameter onMethod : tpOnMethod) { int pos = -1; if (tpOnRet != null) for (int i = 0; i < tpOnRet.length; i++) { @@ -366,11 +366,11 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { annotationNode.addError("@Builder(toBuilder=true) requires that each type parameter on the static method is part of the typeargs of the return value. Type parameter " + new String(onMethod.name) + " is not part of the return type."); return; } - + typeArgsForToBuilder.add(tpOnType[pos].name); } } - + returnType = copyType(md.returnType, ast); typeParams = md.typeParameters; thrownExceptions = md.thrownExceptions; @@ -394,41 +394,41 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { annotationNode.addError("Unexpected kind of return type on annotated method. Specify 'builderClassName' to solve this problem."); return; } - + if (Character.isLowerCase(token[0])) { char[] newToken = new char[token.length]; System.arraycopy(token, 1, newToken, 1, token.length - 1); newToken[0] = Character.toTitleCase(token[0]); token = newToken; } - + builderClassName = builderClassName.replace("*", new String(token)); } } else { annotationNode.addError("@Builder is only supported on types, constructors, and methods."); return; } - + if (fillParametersFrom != null) { for (EclipseNode param : fillParametersFrom.down()) { if (param.getKind() != Kind.ARGUMENT) continue; BuilderFieldData bfd = new BuilderFieldData(); Argument arg = (Argument) param.get(); - + Annotation[] copyableAnnotations = findCopyableAnnotations(param); - + bfd.rawName = arg.name; bfd.name = arg.name; bfd.builderFieldName = bfd.name; bfd.annotations = copyAnnotations(arg, copyableAnnotations); bfd.type = arg.type; - bfd.singularData = getSingularData(param, ast); + bfd.singularData = getSingularData(param, ast, builderInstance.setterPrefix()); bfd.originalFieldNode = param; addObtainVia(bfd, param); builderFields.add(bfd); } } - + EclipseNode builderType = findInnerClass(tdParent, builderClassName); if (builderType == null) { builderType = makeBuilderClass(isStatic, tdParent, builderClassName, typeParams, ast, accessForOuters); @@ -454,7 +454,7 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { } } } - + for (BuilderFieldData bfd : builderFields) { if (bfd.singularData != null && bfd.singularData.getSingularizer() != null) { if (bfd.singularData.getSingularizer().requiresCleaning()) { @@ -473,7 +473,7 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { } } } - + generateBuilderFields(builderType, builderFields, ast); if (addCleaning) { FieldDeclaration cleanDecl = new FieldDeclaration(CLEAN_FIELD_NAME, 0, -1); @@ -483,18 +483,18 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { cleanDecl.traverse(new SetGeneratedByVisitor(ast), (MethodScope) null); injectFieldAndMarkGenerated(builderType, cleanDecl); } - + if (constructorExists(builderType) == MemberExistsResult.NOT_EXISTS) { ConstructorDeclaration cd = HandleConstructor.createConstructor( AccessLevel.PACKAGE, builderType, Collections.<EclipseNode>emptyList(), false, annotationNode, Collections.<Annotation>emptyList()); if (cd != null) injectMethod(builderType, cd); } - + for (BuilderFieldData bfd : builderFields) { makePrefixedSetterMethodsForBuilder(cfv, builderType, bfd, annotationNode, fluent, chain, accessForInners, bfd.originalFieldNode, builderInstance.setterPrefix()); } - + { MemberExistsResult methodExists = methodExists(buildMethodName, builderType, -1); if (methodExists == MemberExistsResult.EXISTS_BY_LOMBOK) methodExists = methodExists(buildMethodName, builderType, 0); @@ -503,7 +503,7 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { if (md != null) injectMethod(builderType, md); } } - + if (methodExists("toString", builderType, 0) == MemberExistsResult.NOT_EXISTS) { List<Included<EclipseNode, ToString.Include>> fieldNodes = new ArrayList<Included<EclipseNode, ToString.Include>>(); for (BuilderFieldData bfd : builderFields) { @@ -514,18 +514,18 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { MethodDeclaration md = HandleToString.createToString(builderType, fieldNodes, true, false, ast, FieldAccess.ALWAYS_FIELD); if (md != null) injectMethod(builderType, md); } - + if (addCleaning) { MethodDeclaration cleanMethod = generateCleanMethod(builderFields, builderType, ast); if (cleanMethod != null) injectMethod(builderType, cleanMethod); } - + if (generateBuilderMethod && methodExists(builderMethodName, tdParent, -1) != MemberExistsResult.NOT_EXISTS) generateBuilderMethod = false; if (generateBuilderMethod) { MethodDeclaration md = generateBuilderMethod(cfv, isStatic, builderMethodName, builderClassName, tdParent, typeParams, ast, accessForOuters); if (md != null) injectMethod(tdParent, md); } - + if (toBuilder) switch (methodExists(toBuilderMethodName, tdParent, 0)) { case EXISTS_BY_USER: annotationNode.addWarning("Not generating toBuilder() as it already exists."); @@ -540,22 +540,22 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { } } MethodDeclaration md = generateToBuilderMethod(cfv, toBuilderMethodName, builderClassName, tdParent, tps, builderFields, fluent, ast, accessForOuters); - + if (md != null) injectMethod(tdParent, md); } - + if (nonFinalNonDefaultedFields != null && generateBuilderMethod) { for (EclipseNode fieldNode : nonFinalNonDefaultedFields) { fieldNode.addWarning("@Builder will ignore the initializing expression entirely. If you want the initializing expression to serve as default, add @Builder.Default. If it is not supposed to be settable during building, make the field final."); } } } - + private static final char[] BUILDER_TEMP_VAR = {'b', 'u', 'i', 'l', 'd', 'e', 'r'}; private MethodDeclaration generateToBuilderMethod(CheckerFrameworkVersion cfv, String methodName, String builderClassName, EclipseNode type, TypeParameter[] typeParams, List<BuilderFieldData> builderFields, boolean fluent, ASTNode source, AccessLevel access) { int pS = source.sourceStart, pE = source.sourceEnd; long p = (long) pS << 32 | pE; - + MethodDeclaration out = new MethodDeclaration(((CompilationUnitDeclaration) type.top().get()).compilationResult); out.selector = methodName.toCharArray(); out.modifiers = toEclipseModifier(access); @@ -563,14 +563,14 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { out.returnType = namePlusTypeParamsToTypeReference(builderClassName.toCharArray(), typeParams, p); AllocationExpression invoke = new AllocationExpression(); invoke.type = namePlusTypeParamsToTypeReference(builderClassName.toCharArray(), typeParams, p); - + Expression receiver = invoke; List<Statement> statements = null; for (BuilderFieldData bfd : builderFields) { char[] setterName = fluent ? bfd.name : HandlerUtil.buildAccessorName("set", new String(bfd.name)).toCharArray(); MessageSend ms = new MessageSend(); Expression[] tgt = new Expression[bfd.singularData == null ? 1 : 2]; - + if (bfd.obtainVia == null || !bfd.obtainVia.field().isEmpty()) { char[] fieldName = bfd.obtainVia == null ? bfd.rawName : bfd.obtainVia.field().toCharArray(); for (int i = 0; i < tgt.length; i++) { @@ -599,7 +599,7 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { tgt[i] = obtainExpr; } } - + ms.selector = setterName; if (bfd.singularData == null) { ms.arguments = tgt; @@ -613,7 +613,7 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { statements.add(new IfStatement(isNotNull, ms, pS, pE)); } } - + if (statements != null) { out.statements = new Statement[statements.size() + 2]; for (int i = 0; i < statements.size(); i++) out.statements[i + 1] = statements.get(i); @@ -627,7 +627,7 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { } else { out.statements = new Statement[] {new ReturnStatement(receiver, pS, pE)}; } - + if (cfv.generateUnique()) { out.annotations = new Annotation[] {generateNamedAnnotation(source, CheckerFrameworkVersion.NAME__UNIQUE)}; } @@ -636,16 +636,16 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { return out; } - + private MethodDeclaration generateCleanMethod(List<BuilderFieldData> builderFields, EclipseNode builderType, ASTNode source) { List<Statement> statements = new ArrayList<Statement>(); - + for (BuilderFieldData bfd : builderFields) { if (bfd.singularData != null && bfd.singularData.getSingularizer() != null) { bfd.singularData.getSingularizer().appendCleaningCode(bfd.singularData, builderType, statements); } } - + FieldReference thisUnclean = new FieldReference(CLEAN_FIELD_NAME, 0); thisUnclean.receiver = new ThisReference(0, 0); statements.add(new Assignment(thisUnclean, new FalseLiteral(0, 0), 0)); @@ -658,7 +658,7 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { decl.traverse(new SetGeneratedByVisitor(source), (ClassScope) null); return decl; } - + static Argument[] generateBuildArgs(CheckerFrameworkVersion cfv, EclipseNode type, List<BuilderFieldData> builderFields, ASTNode source) { if (!cfv.generateCalledMethods()) return null; @@ -691,7 +691,7 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { MethodDeclaration out = new MethodDeclaration(((CompilationUnitDeclaration) type.top().get()).compilationResult); out.bits |= ECLIPSE_DO_NOT_TOUCH_FLAG; List<Statement> statements = new ArrayList<Statement>(); - + if (addCleaning) { FieldReference thisUnclean = new FieldReference(CLEAN_FIELD_NAME, 0); thisUnclean.receiver = new ThisReference(0, 0); @@ -700,13 +700,13 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { invokeClean.selector = CLEAN_METHOD_NAME; statements.add(new IfStatement(notClean, invokeClean, 0, 0)); } - + for (BuilderFieldData bfd : builderFields) { if (bfd.singularData != null && bfd.singularData.getSingularizer() != null) { bfd.singularData.getSingularizer().appendBuildCode(bfd.singularData, type, statements, bfd.builderFieldName, "this"); } } - + List<Expression> args = new ArrayList<Expression>(); for (BuilderFieldData bfd : builderFields) { if (bfd.nameOfSetFlag != null) { @@ -716,7 +716,7 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { inv.receiver = new SingleNameReference(((TypeDeclaration) tdParent.get()).name, 0L); inv.selector = bfd.nameOfDefaultProvider; inv.typeArguments = typeParameterNames(((TypeDeclaration) type.get()).typeParameters); - + args.add(new ConditionalExpression( new SingleNameReference(bfd.nameOfSetFlag, 0L), new SingleNameReference(bfd.builderFieldName, 0L), @@ -725,19 +725,19 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { args.add(new SingleNameReference(bfd.builderFieldName, 0L)); } } - + if (addCleaning) { FieldReference thisUnclean = new FieldReference(CLEAN_FIELD_NAME, 0); thisUnclean.receiver = new ThisReference(0, 0); statements.add(new Assignment(thisUnclean, new TrueLiteral(0, 0), 0)); } - + out.modifiers = toEclipseModifier(access); out.selector = name.toCharArray(); out.thrownExceptions = copyTypes(thrownExceptions); out.bits |= ECLIPSE_DO_NOT_TOUCH_FLAG; out.returnType = returnType; - + if (staticName == null) { AllocationExpression allocationStatement = new AllocationExpression(); allocationStatement.type = copyType(out.returnType); @@ -750,7 +750,7 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { invoke.receiver = new SingleNameReference(type.up().getName().toCharArray(), 0); else invoke.receiver = new QualifiedThisReference(new SingleTypeReference(type.up().getName().toCharArray(), 0) , 0, 0); - + invoke.typeArguments = typeParameterNames(((TypeDeclaration) type.get()).typeParameters); invoke.arguments = args.isEmpty() ? null : args.toArray(new Expression[0]); if (returnType instanceof SingleTypeReference && Arrays.equals(TypeConstants.VOID, ((SingleTypeReference) returnType).token)) { @@ -767,20 +767,20 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { out.traverse(new SetGeneratedByVisitor(source), (ClassScope) null); return out; } - + private TypeReference[] typeParameterNames(TypeParameter[] typeParameters) { if (typeParameters == null) return null; - + TypeReference[] trs = new TypeReference[typeParameters.length]; for (int i = 0; i < trs.length; i++) { trs[i] = new SingleTypeReference(typeParameters[i].name, 0); } return trs; } - + public static MethodDeclaration generateDefaultProvider(char[] methodName, TypeParameter[] typeParameters, EclipseNode fieldNode, ASTNode source) { int pS = source.sourceStart, pE = source.sourceEnd; - + MethodDeclaration out = new MethodDeclaration(((CompilationUnitDeclaration) fieldNode.top().get()).compilationResult); out.typeParameters = copyTypeParams(typeParameters, source); out.selector = methodName; @@ -790,15 +790,15 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { out.returnType = copyType(fd.type, source); out.statements = new Statement[] {new ReturnStatement(fd.initialization, pS, pE)}; fd.initialization = null; - + out.traverse(new SetGeneratedByVisitor(source), ((TypeDeclaration) fieldNode.up().get()).scope); return out; } - + public MethodDeclaration generateBuilderMethod(CheckerFrameworkVersion cfv, boolean isStatic, String builderMethodName, String builderClassName, EclipseNode type, TypeParameter[] typeParams, ASTNode source, AccessLevel access) { int pS = source.sourceStart, pE = source.sourceEnd; long p = (long) pS << 32 | pE; - + MethodDeclaration out = new MethodDeclaration(((CompilationUnitDeclaration) type.top().get()).compilationResult); out.selector = builderMethodName.toCharArray(); out.modifiers = toEclipseModifier(access); @@ -821,13 +821,13 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { out.traverse(new SetGeneratedByVisitor(source), ((TypeDeclaration) type.get()).scope); return out; } - + public void generateBuilderFields(EclipseNode builderType, List<BuilderFieldData> builderFields, ASTNode source) { List<EclipseNode> existing = new ArrayList<EclipseNode>(); for (EclipseNode child : builderType.down()) { if (child.getKind() == Kind.FIELD) existing.add(child); } - + for (BuilderFieldData bfd : builderFields) { if (bfd.singularData != null && bfd.singularData.getSingularizer() != null) { bfd.createdFields.addAll(bfd.singularData.getSingularizer().generateFields(bfd.singularData, builderType)); @@ -838,7 +838,7 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { if (Arrays.equals(n, bfd.builderFieldName)) field = exists; if (bfd.nameOfSetFlag != null && Arrays.equals(n, bfd.nameOfSetFlag)) setFlag = exists; } - + if (field == null) { FieldDeclaration fd = new FieldDeclaration(bfd.builderFieldName, 0, 0); fd.bits |= Eclipse.ECLIPSE_DO_NOT_TOUCH_FLAG; @@ -859,9 +859,9 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { } } } - + private static final AbstractMethodDeclaration[] EMPTY = {}; - + public void makeSetterMethodsForBuilder(CheckerFrameworkVersion cfv, EclipseNode builderType, BuilderFieldData bfd, EclipseNode sourceNode, boolean fluent, boolean chain, AccessLevel access, EclipseNode originalFieldNode) { boolean deprecate = isFieldDeprecated(bfd.originalFieldNode); if (bfd.singularData == null || bfd.singularData.getSingularizer() == null) { @@ -870,7 +870,7 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { bfd.singularData.getSingularizer().generateMethods(cfv, bfd.singularData, deprecate, builderType, fluent, chain, access); } } - + private void makeSimpleSetterMethodForBuilder(CheckerFrameworkVersion cfv, EclipseNode builderType, boolean deprecate, EclipseNode fieldNode, char[] paramName, char[] nameOfSetFlag, EclipseNode sourceNode, boolean fluent, boolean chain, Annotation[] annotations, AccessLevel access, EclipseNode originalFieldNode) { TypeDeclaration td = (TypeDeclaration) builderType.get(); AbstractMethodDeclaration[] existing = td.methods; @@ -879,15 +879,15 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { int len = existing.length; FieldDeclaration fd = (FieldDeclaration) fieldNode.get(); char[] name = fd.name; - + for (int i = 0; i < len; i++) { if (!(existing[i] instanceof MethodDeclaration)) continue; char[] existingName = existing[i].selector; if (Arrays.equals(name, existingName) && !isTolerate(fieldNode, existing[i])) return; } - + String setterName = fluent ? new String(paramName) : HandlerUtil.buildAccessorName("set", new String(paramName)); - + List<Annotation> methodAnnsList = Arrays.asList(EclipseHandlerUtil.findCopyableToSetterAnnotations(originalFieldNode)); Annotation[] methodAnns = EclipseHandlerUtil.findCopyableToSetterAnnotations(originalFieldNode); if (methodAnns != null && methodAnns.length > 0) methodAnnsList = Arrays.asList(methodAnns); @@ -970,7 +970,7 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { builder.traverse(new SetGeneratedByVisitor(source), (ClassScope) null); return injectType(tdParent, builder); } - + private void addObtainVia(BuilderFieldData bfd, EclipseNode node) { for (EclipseNode child : node.down()) { if (!annotationTypeMatches(ObtainVia.class, child)) continue; @@ -980,14 +980,15 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { return; } } - + /** * Returns the explicitly requested singular annotation on this node (field * or parameter), or null if there's no {@code @Singular} annotation on it. - * + * * @param node The node (field or method param) to inspect for its name and potential {@code @Singular} annotation. + * @param setterPrefix */ - private SingularData getSingularData(EclipseNode node, ASTNode source) { + private SingularData getSingularData(EclipseNode node, ASTNode source, final String setterPrefix) { for (EclipseNode child : node.down()) { if (!annotationTypeMatches(Singular.class, child)) continue; char[] pluralName = node.getKind() == Kind.FIELD ? removePrefixFromField(node) : ((AbstractVariableDeclaration) node.get()).name; @@ -1006,7 +1007,7 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { } } char[] singularName = explicitSingular.toCharArray(); - + TypeReference type = ((AbstractVariableDeclaration) node.get()).type; TypeReference[] typeArgs = null; String typeName; @@ -1026,7 +1027,7 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { } else { typeName = type.toString(); } - + String targetFqn = EclipseSingularsRecipes.get().toQualified(typeName); EclipseSingularizer singularizer = EclipseSingularsRecipes.get().getSingularizer(targetFqn); if (singularizer == null) { @@ -1034,9 +1035,9 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { return null; } - return new SingularData(child, singularName, pluralName, typeArgs == null ? Collections.<TypeReference>emptyList() : Arrays.asList(typeArgs), targetFqn, singularizer, source); + return new SingularData(child, singularName, pluralName, typeArgs == null ? Collections.<TypeReference>emptyList() : Arrays.asList(typeArgs), targetFqn, singularizer, source, setterPrefix.toCharArray()); } - + return null; } } diff --git a/src/core/lombok/eclipse/handlers/singulars/EclipseJavaUtilListSetSingularizer.java b/src/core/lombok/eclipse/handlers/singulars/EclipseJavaUtilListSetSingularizer.java index 53ea15a6..e3a99008 100755 --- a/src/core/lombok/eclipse/handlers/singulars/EclipseJavaUtilListSetSingularizer.java +++ b/src/core/lombok/eclipse/handlers/singulars/EclipseJavaUtilListSetSingularizer.java @@ -150,7 +150,8 @@ abstract class EclipseJavaUtilListSetSingularizer extends EclipseJavaUtilSingula param.annotations = typeUseAnns; md.arguments = new Argument[] {param}; md.returnType = returnType; - md.selector = fluent ? data.getSingularName() : HandlerUtil.buildAccessorName("add", new String(data.getSingularName())).toCharArray(); + char[] prefixedSingularName = data.getSetterPrefix().length == 0 ? data.getSingularName() : HandlerUtil.buildAccessorName(new String(data.getSetterPrefix()), new String(data.getSingularName())).toCharArray(); + md.selector = fluent ? prefixedSingularName : HandlerUtil.buildAccessorName("add", new String(data.getSingularName())).toCharArray(); md.annotations = generateSelfReturnAnnotations(deprecate, cfv, data.getSource()); data.setGeneratedByRecursive(md); @@ -181,7 +182,8 @@ abstract class EclipseJavaUtilListSetSingularizer extends EclipseJavaUtilSingula Argument param = new Argument(data.getPluralName(), 0, paramType, ClassFileConstants.AccFinal); md.arguments = new Argument[] {param}; md.returnType = returnType; - md.selector = fluent ? data.getPluralName() : HandlerUtil.buildAccessorName("addAll", new String(data.getPluralName())).toCharArray(); + char[] prefixedSelector = data.getSetterPrefix().length == 0 ? data.getPluralName() : HandlerUtil.buildAccessorName(new String(data.getSetterPrefix()), new String(data.getPluralName())).toCharArray(); + md.selector = fluent ? prefixedSelector : HandlerUtil.buildAccessorName("addAll", new String(data.getPluralName())).toCharArray(); md.annotations = generateSelfReturnAnnotations(deprecate, cfv, data.getSource()); data.setGeneratedByRecursive(md); diff --git a/test/transform/resource/after-ecj/BuilderSingularAnnotatedTypesWithSetterPrefix.java b/test/transform/resource/after-ecj/BuilderSingularAnnotatedTypesWithSetterPrefix.java index 02369861..c978ff40 100644 --- a/test/transform/resource/after-ecj/BuilderSingularAnnotatedTypesWithSetterPrefix.java +++ b/test/transform/resource/after-ecj/BuilderSingularAnnotatedTypesWithSetterPrefix.java @@ -6,15 +6,15 @@ import lombok.NonNull; import lombok.Singular; @Target(ElementType.TYPE_USE) @interface MyAnnotation { } -@lombok.Builder(setterPrefix = "with") class BuilderSingularAnnotatedTypes { - public static @java.lang.SuppressWarnings("all") class BuilderSingularAnnotatedTypesBuilder { +@lombok.Builder(setterPrefix = "with") class BuilderSingularAnnotatedTypesWithSetterPrefix { + public static @java.lang.SuppressWarnings("all") class BuilderSingularAnnotatedTypesWithSetterPrefixBuilder { private @java.lang.SuppressWarnings("all") java.util.ArrayList<@MyAnnotation @NonNull String> foos; private @java.lang.SuppressWarnings("all") java.util.ArrayList<@MyAnnotation @NonNull String> bars$key; private @java.lang.SuppressWarnings("all") java.util.ArrayList<@MyAnnotation @NonNull Integer> bars$value; - @java.lang.SuppressWarnings("all") BuilderSingularAnnotatedTypesBuilder() { + @java.lang.SuppressWarnings("all") BuilderSingularAnnotatedTypesWithSetterPrefixBuilder() { super(); } - public @java.lang.SuppressWarnings("all") BuilderSingularAnnotatedTypesBuilder withFoo(final @MyAnnotation @NonNull String foo) { + public @java.lang.SuppressWarnings("all") BuilderSingularAnnotatedTypesWithSetterPrefixBuilder withFoo(final @MyAnnotation @NonNull String foo) { if ((foo == null)) { throw new java.lang.NullPointerException("foo is marked non-null but is null"); @@ -24,18 +24,18 @@ import lombok.Singular; this.foos.add(foo); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularAnnotatedTypesBuilder withFoos(final java.util.Collection<? extends @MyAnnotation @NonNull String> foos) { + public @java.lang.SuppressWarnings("all") BuilderSingularAnnotatedTypesWithSetterPrefixBuilder withFoos(final java.util.Collection<? extends @MyAnnotation @NonNull String> foos) { if ((this.foos == null)) this.foos = new java.util.ArrayList<@MyAnnotation @NonNull String>(); this.foos.addAll(foos); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularAnnotatedTypesBuilder clearFoos() { + public @java.lang.SuppressWarnings("all") BuilderSingularAnnotatedTypesWithSetterPrefixBuilder clearFoos() { if ((this.foos != null)) this.foos.clear(); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularAnnotatedTypesBuilder withBar(final @MyAnnotation @NonNull String barKey, final @MyAnnotation @NonNull Integer barValue) { + public @java.lang.SuppressWarnings("all") BuilderSingularAnnotatedTypesWithSetterPrefixBuilder withBar(final @MyAnnotation @NonNull String barKey, final @MyAnnotation @NonNull Integer barValue) { if ((barKey == null)) { throw new java.lang.NullPointerException("barKey is marked non-null but is null"); @@ -53,7 +53,7 @@ import lombok.Singular; this.bars$value.add(barValue); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularAnnotatedTypesBuilder withBars(final java.util.Map<? extends @MyAnnotation @NonNull String, ? extends @MyAnnotation @NonNull Integer> bars) { + public @java.lang.SuppressWarnings("all") BuilderSingularAnnotatedTypesWithSetterPrefixBuilder withBars(final java.util.Map<? extends @MyAnnotation @NonNull String, ? extends @MyAnnotation @NonNull Integer> bars) { if ((this.bars$key == null)) { this.bars$key = new java.util.ArrayList<@MyAnnotation @NonNull String>(); @@ -66,7 +66,7 @@ import lombok.Singular; } return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularAnnotatedTypesBuilder clearBars() { + public @java.lang.SuppressWarnings("all") BuilderSingularAnnotatedTypesWithSetterPrefixBuilder clearBars() { if ((this.bars$key != null)) { this.bars$key.clear(); @@ -74,7 +74,7 @@ import lombok.Singular; } return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularAnnotatedTypes build() { + public @java.lang.SuppressWarnings("all") BuilderSingularAnnotatedTypesWithSetterPrefix build() { java.util.Set<@MyAnnotation @NonNull String> foos; switch (((this.foos == null) ? 0 : this.foos.size())) { case 0 : @@ -102,20 +102,20 @@ import lombok.Singular; bars.put(this.bars$key.get($i), this.bars$value.get($i)); bars = java.util.Collections.unmodifiableMap(bars); } - return new BuilderSingularAnnotatedTypes(foos, bars); + return new BuilderSingularAnnotatedTypesWithSetterPrefix(foos, bars); } public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { - return (((((("BuilderSingularAnnotatedTypes.BuilderSingularAnnotatedTypesBuilder(foos=" + this.foos) + ", bars$key=") + this.bars$key) + ", bars$value=") + this.bars$value) + ")"); + return (((((("BuilderSingularAnnotatedTypesWithSetterPrefix.BuilderSingularAnnotatedTypesWithSetterPrefixBuilder(foos=" + this.foos) + ", bars$key=") + this.bars$key) + ", bars$value=") + this.bars$value) + ")"); } } private @Singular Set<@MyAnnotation @NonNull String> foos; private @Singular Map<@MyAnnotation @NonNull String, @MyAnnotation @NonNull Integer> bars; - @java.lang.SuppressWarnings("all") BuilderSingularAnnotatedTypes(final Set<@MyAnnotation @NonNull String> foos, final Map<@MyAnnotation @NonNull String, @MyAnnotation @NonNull Integer> bars) { + @java.lang.SuppressWarnings("all") BuilderSingularAnnotatedTypesWithSetterPrefix(final Set<@MyAnnotation @NonNull String> foos, final Map<@MyAnnotation @NonNull String, @MyAnnotation @NonNull Integer> bars) { super(); this.foos = foos; this.bars = bars; } - public static @java.lang.SuppressWarnings("all") BuilderSingularAnnotatedTypesBuilder builder() { - return new BuilderSingularAnnotatedTypesBuilder(); + public static @java.lang.SuppressWarnings("all") BuilderSingularAnnotatedTypesWithSetterPrefixBuilder builder() { + return new BuilderSingularAnnotatedTypesWithSetterPrefixBuilder(); } } diff --git a/test/transform/resource/after-ecj/BuilderSingularGuavaListsSetsWithSetterPrefix.java b/test/transform/resource/after-ecj/BuilderSingularGuavaListsSetsWithSetterPrefix.java index e9b0205d..ec700874 100644 --- a/test/transform/resource/after-ecj/BuilderSingularGuavaListsSetsWithSetterPrefix.java +++ b/test/transform/resource/after-ecj/BuilderSingularGuavaListsSetsWithSetterPrefix.java @@ -4,106 +4,106 @@ import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSortedSet; import com.google.common.collect.ImmutableTable; import lombok.Singular; -@lombok.Builder(setterPrefix = "with") class BuilderSingularGuavaListsSets<T> { - public static @java.lang.SuppressWarnings("all") class BuilderSingularGuavaListsSetsBuilder<T> { +@lombok.Builder(setterPrefix = "with") class BuilderSingularGuavaListsSetsWithSetterPrefix<T> { + public static @java.lang.SuppressWarnings("all") class BuilderSingularGuavaListsSetsWithSetterPrefixBuilder<T> { private @java.lang.SuppressWarnings("all") com.google.common.collect.ImmutableList.Builder<T> cards; private @java.lang.SuppressWarnings("all") com.google.common.collect.ImmutableList.Builder<Number> frogs; private @java.lang.SuppressWarnings("all") com.google.common.collect.ImmutableSet.Builder<java.lang.Object> rawSet; private @java.lang.SuppressWarnings("all") com.google.common.collect.ImmutableSortedSet.Builder<String> passes; private @java.lang.SuppressWarnings("all") com.google.common.collect.ImmutableTable.Builder<Number, Number, String> users; - @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsBuilder() { + @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsWithSetterPrefixBuilder() { super(); } - public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsBuilder<T> withCard(final T card) { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsWithSetterPrefixBuilder<T> withCard(final T card) { if ((this.cards == null)) this.cards = com.google.common.collect.ImmutableList.builder(); this.cards.add(card); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsBuilder<T> withCards(final java.lang.Iterable<? extends T> cards) { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsWithSetterPrefixBuilder<T> withCards(final java.lang.Iterable<? extends T> cards) { if ((this.cards == null)) this.cards = com.google.common.collect.ImmutableList.builder(); this.cards.addAll(cards); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsBuilder<T> clearCards() { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsWithSetterPrefixBuilder<T> clearCards() { this.cards = null; return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsBuilder<T> withFrog(final Number frog) { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsWithSetterPrefixBuilder<T> withFrog(final Number frog) { if ((this.frogs == null)) this.frogs = com.google.common.collect.ImmutableList.builder(); this.frogs.add(frog); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsBuilder<T> withFrogs(final java.lang.Iterable<? extends Number> frogs) { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsWithSetterPrefixBuilder<T> withFrogs(final java.lang.Iterable<? extends Number> frogs) { if ((this.frogs == null)) this.frogs = com.google.common.collect.ImmutableList.builder(); this.frogs.addAll(frogs); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsBuilder<T> clearFrogs() { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsWithSetterPrefixBuilder<T> clearFrogs() { this.frogs = null; return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsBuilder<T> withRawSet(final java.lang.Object rawSet) { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsWithSetterPrefixBuilder<T> withRawSet(final java.lang.Object rawSet) { if ((this.rawSet == null)) this.rawSet = com.google.common.collect.ImmutableSet.builder(); this.rawSet.add(rawSet); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsBuilder<T> withRawSet(final java.lang.Iterable<?> rawSet) { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsWithSetterPrefixBuilder<T> withRawSet(final java.lang.Iterable<?> rawSet) { if ((this.rawSet == null)) this.rawSet = com.google.common.collect.ImmutableSet.builder(); this.rawSet.addAll(rawSet); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsBuilder<T> clearRawSet() { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsWithSetterPrefixBuilder<T> clearRawSet() { this.rawSet = null; return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsBuilder<T> withPass(final String pass) { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsWithSetterPrefixBuilder<T> withPass(final String pass) { if ((this.passes == null)) this.passes = com.google.common.collect.ImmutableSortedSet.naturalOrder(); this.passes.add(pass); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsBuilder<T> withPasses(final java.lang.Iterable<? extends String> passes) { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsWithSetterPrefixBuilder<T> withPasses(final java.lang.Iterable<? extends String> passes) { if ((this.passes == null)) this.passes = com.google.common.collect.ImmutableSortedSet.naturalOrder(); this.passes.addAll(passes); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsBuilder<T> clearPasses() { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsWithSetterPrefixBuilder<T> clearPasses() { this.passes = null; return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsBuilder<T> withUser(final Number rowKey, final Number columnKey, final String value) { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsWithSetterPrefixBuilder<T> withUser(final Number rowKey, final Number columnKey, final String value) { if ((this.users == null)) this.users = com.google.common.collect.ImmutableTable.builder(); this.users.put(rowKey, columnKey, value); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsBuilder<T> withUsers(final com.google.common.collect.Table<? extends Number, ? extends Number, ? extends String> users) { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsWithSetterPrefixBuilder<T> withUsers(final com.google.common.collect.Table<? extends Number, ? extends Number, ? extends String> users) { if ((this.users == null)) this.users = com.google.common.collect.ImmutableTable.builder(); this.users.putAll(users); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsBuilder<T> clearUsers() { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsWithSetterPrefixBuilder<T> clearUsers() { this.users = null; return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSets<T> build() { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsWithSetterPrefix<T> build() { com.google.common.collect.ImmutableList<T> cards = ((this.cards == null) ? com.google.common.collect.ImmutableList.<T>of() : this.cards.build()); com.google.common.collect.ImmutableCollection<Number> frogs = ((this.frogs == null) ? com.google.common.collect.ImmutableList.<Number>of() : this.frogs.build()); com.google.common.collect.ImmutableSet<java.lang.Object> rawSet = ((this.rawSet == null) ? com.google.common.collect.ImmutableSet.<java.lang.Object>of() : this.rawSet.build()); com.google.common.collect.ImmutableSortedSet<String> passes = ((this.passes == null) ? com.google.common.collect.ImmutableSortedSet.<String>of() : this.passes.build()); com.google.common.collect.ImmutableTable<Number, Number, String> users = ((this.users == null) ? com.google.common.collect.ImmutableTable.<Number, Number, String>of() : this.users.build()); - return new BuilderSingularGuavaListsSets<T>(cards, frogs, rawSet, passes, users); + return new BuilderSingularGuavaListsSetsWithSetterPrefix<T>(cards, frogs, rawSet, passes, users); } public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { - return (((((((((("BuilderSingularGuavaListsSets.BuilderSingularGuavaListsSetsBuilder(cards=" + this.cards) + ", frogs=") + this.frogs) + ", rawSet=") + this.rawSet) + ", passes=") + this.passes) + ", users=") + this.users) + ")"); + return (((((((((("BuilderSingularGuavaListsSetsWithSetterPrefix.BuilderSingularGuavaListsSetsWithSetterPrefixBuilder(cards=" + this.cards) + ", frogs=") + this.frogs) + ", rawSet=") + this.rawSet) + ", passes=") + this.passes) + ", users=") + this.users) + ")"); } } private @Singular ImmutableList<T> cards; @@ -111,7 +111,7 @@ import lombok.Singular; private @SuppressWarnings("all") @Singular("rawSet") ImmutableSet rawSet; private @Singular ImmutableSortedSet<String> passes; private @Singular ImmutableTable<? extends Number, ? extends Number, String> users; - @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSets(final ImmutableList<T> cards, final ImmutableCollection<? extends Number> frogs, final ImmutableSet rawSet, final ImmutableSortedSet<String> passes, final ImmutableTable<? extends Number, ? extends Number, String> users) { + @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsWithSetterPrefix(final ImmutableList<T> cards, final ImmutableCollection<? extends Number> frogs, final ImmutableSet rawSet, final ImmutableSortedSet<String> passes, final ImmutableTable<? extends Number, ? extends Number, String> users) { super(); this.cards = cards; this.frogs = frogs; @@ -119,7 +119,7 @@ import lombok.Singular; this.passes = passes; this.users = users; } - public static @java.lang.SuppressWarnings("all") <T>BuilderSingularGuavaListsSetsBuilder<T> builder() { - return new BuilderSingularGuavaListsSetsBuilder<T>(); + public static @java.lang.SuppressWarnings("all") <T>BuilderSingularGuavaListsSetsWithSetterPrefixBuilder<T> builder() { + return new BuilderSingularGuavaListsSetsWithSetterPrefixBuilder<T>(); } } diff --git a/test/transform/resource/after-ecj/BuilderSingularGuavaMapsWithSetterPrefix.java b/test/transform/resource/after-ecj/BuilderSingularGuavaMapsWithSetterPrefix.java index fe1f0036..0f58f7a4 100644 --- a/test/transform/resource/after-ecj/BuilderSingularGuavaMapsWithSetterPrefix.java +++ b/test/transform/resource/after-ecj/BuilderSingularGuavaMapsWithSetterPrefix.java @@ -2,82 +2,82 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableBiMap; import com.google.common.collect.ImmutableSortedMap; import lombok.Singular; -@lombok.Builder(setterPrefix = "with") class BuilderSingularGuavaMaps<K, V> { - public static @java.lang.SuppressWarnings("all") class BuilderSingularGuavaMapsBuilder<K, V> { +@lombok.Builder(setterPrefix = "with") class BuilderSingularGuavaMapsWithSetterPrefix<K, V> { + public static @java.lang.SuppressWarnings("all") class BuilderSingularGuavaMapsWithSetterPrefixBuilder<K, V> { private @java.lang.SuppressWarnings("all") com.google.common.collect.ImmutableMap.Builder<K, V> battleaxes; private @java.lang.SuppressWarnings("all") com.google.common.collect.ImmutableSortedMap.Builder<Integer, V> vertices; private @java.lang.SuppressWarnings("all") com.google.common.collect.ImmutableBiMap.Builder<java.lang.Object, java.lang.Object> rawMap; - @java.lang.SuppressWarnings("all") BuilderSingularGuavaMapsBuilder() { + @java.lang.SuppressWarnings("all") BuilderSingularGuavaMapsWithSetterPrefixBuilder() { super(); } - public @java.lang.SuppressWarnings("all") BuilderSingularGuavaMapsBuilder<K, V> withBattleaxe(final K key, final V value) { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaMapsWithSetterPrefixBuilder<K, V> withBattleaxe(final K key, final V value) { if ((this.battleaxes == null)) this.battleaxes = com.google.common.collect.ImmutableMap.builder(); this.battleaxes.put(key, value); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularGuavaMapsBuilder<K, V> withBattleaxes(final java.util.Map<? extends K, ? extends V> battleaxes) { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaMapsWithSetterPrefixBuilder<K, V> withBattleaxes(final java.util.Map<? extends K, ? extends V> battleaxes) { if ((this.battleaxes == null)) this.battleaxes = com.google.common.collect.ImmutableMap.builder(); this.battleaxes.putAll(battleaxes); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularGuavaMapsBuilder<K, V> clearBattleaxes() { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaMapsWithSetterPrefixBuilder<K, V> clearBattleaxes() { this.battleaxes = null; return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularGuavaMapsBuilder<K, V> withVertex(final Integer key, final V value) { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaMapsWithSetterPrefixBuilder<K, V> withVertex(final Integer key, final V value) { if ((this.vertices == null)) this.vertices = com.google.common.collect.ImmutableSortedMap.naturalOrder(); this.vertices.put(key, value); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularGuavaMapsBuilder<K, V> withVertices(final java.util.Map<? extends Integer, ? extends V> vertices) { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaMapsWithSetterPrefixBuilder<K, V> withVertices(final java.util.Map<? extends Integer, ? extends V> vertices) { if ((this.vertices == null)) this.vertices = com.google.common.collect.ImmutableSortedMap.naturalOrder(); this.vertices.putAll(vertices); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularGuavaMapsBuilder<K, V> clearVertices() { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaMapsWithSetterPrefixBuilder<K, V> clearVertices() { this.vertices = null; return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularGuavaMapsBuilder<K, V> withRawMap(final java.lang.Object key, final java.lang.Object value) { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaMapsWithSetterPrefixBuilder<K, V> withRawMap(final java.lang.Object key, final java.lang.Object value) { if ((this.rawMap == null)) this.rawMap = com.google.common.collect.ImmutableBiMap.builder(); this.rawMap.put(key, value); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularGuavaMapsBuilder<K, V> withRawMap(final java.util.Map<?, ?> rawMap) { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaMapsWithSetterPrefixBuilder<K, V> withRawMap(final java.util.Map<?, ?> rawMap) { if ((this.rawMap == null)) this.rawMap = com.google.common.collect.ImmutableBiMap.builder(); this.rawMap.putAll(rawMap); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularGuavaMapsBuilder<K, V> clearRawMap() { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaMapsWithSetterPrefixBuilder<K, V> clearRawMap() { this.rawMap = null; return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularGuavaMaps<K, V> build() { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaMapsWithSetterPrefix<K, V> build() { com.google.common.collect.ImmutableMap<K, V> battleaxes = ((this.battleaxes == null) ? com.google.common.collect.ImmutableMap.<K, V>of() : this.battleaxes.build()); com.google.common.collect.ImmutableSortedMap<Integer, V> vertices = ((this.vertices == null) ? com.google.common.collect.ImmutableSortedMap.<Integer, V>of() : this.vertices.build()); com.google.common.collect.ImmutableBiMap<java.lang.Object, java.lang.Object> rawMap = ((this.rawMap == null) ? com.google.common.collect.ImmutableBiMap.<java.lang.Object, java.lang.Object>of() : this.rawMap.build()); - return new BuilderSingularGuavaMaps<K, V>(battleaxes, vertices, rawMap); + return new BuilderSingularGuavaMapsWithSetterPrefix<K, V>(battleaxes, vertices, rawMap); } public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { - return (((((("BuilderSingularGuavaMaps.BuilderSingularGuavaMapsBuilder(battleaxes=" + this.battleaxes) + ", vertices=") + this.vertices) + ", rawMap=") + this.rawMap) + ")"); + return (((((("BuilderSingularGuavaMapsWithSetterPrefix.BuilderSingularGuavaMapsWithSetterPrefixBuilder(battleaxes=" + this.battleaxes) + ", vertices=") + this.vertices) + ", rawMap=") + this.rawMap) + ")"); } } private @Singular ImmutableMap<K, V> battleaxes; private @Singular ImmutableSortedMap<Integer, ? extends V> vertices; private @SuppressWarnings("all") @Singular("rawMap") ImmutableBiMap rawMap; - @java.lang.SuppressWarnings("all") BuilderSingularGuavaMaps(final ImmutableMap<K, V> battleaxes, final ImmutableSortedMap<Integer, ? extends V> vertices, final ImmutableBiMap rawMap) { + @java.lang.SuppressWarnings("all") BuilderSingularGuavaMapsWithSetterPrefix(final ImmutableMap<K, V> battleaxes, final ImmutableSortedMap<Integer, ? extends V> vertices, final ImmutableBiMap rawMap) { super(); this.battleaxes = battleaxes; this.vertices = vertices; this.rawMap = rawMap; } - public static @java.lang.SuppressWarnings("all") <K, V>BuilderSingularGuavaMapsBuilder<K, V> builder() { - return new BuilderSingularGuavaMapsBuilder<K, V>(); + public static @java.lang.SuppressWarnings("all") <K, V>BuilderSingularGuavaMapsWithSetterPrefixBuilder<K, V> builder() { + return new BuilderSingularGuavaMapsWithSetterPrefixBuilder<K, V>(); } } diff --git a/test/transform/resource/after-ecj/BuilderSingularListsWithSetterPrefix.java b/test/transform/resource/after-ecj/BuilderSingularListsWithSetterPrefix.java index 110cc2c3..ab90cb48 100644 --- a/test/transform/resource/after-ecj/BuilderSingularListsWithSetterPrefix.java +++ b/test/transform/resource/after-ecj/BuilderSingularListsWithSetterPrefix.java @@ -2,66 +2,66 @@ import java.util.List; import java.util.Collection; import lombok.Singular; -@lombok.Builder(setterPrefix = "with") class BuilderSingularLists<T> { - public static @java.lang.SuppressWarnings("all") class BuilderSingularListsBuilder<T> { +@lombok.Builder(setterPrefix = "with") class BuilderSingularListsWithSetterPrefix<T> { + public static @java.lang.SuppressWarnings("all") class BuilderSingularListsWithSetterPrefixBuilder<T> { private @java.lang.SuppressWarnings("all") java.util.ArrayList<T> children; private @java.lang.SuppressWarnings("all") java.util.ArrayList<Number> scarves; private @java.lang.SuppressWarnings("all") java.util.ArrayList<java.lang.Object> rawList; - @java.lang.SuppressWarnings("all") BuilderSingularListsBuilder() { + @java.lang.SuppressWarnings("all") BuilderSingularListsWithSetterPrefixBuilder() { super(); } - public @java.lang.SuppressWarnings("all") BuilderSingularListsBuilder<T> withChild(final T child) { + public @java.lang.SuppressWarnings("all") BuilderSingularListsWithSetterPrefixBuilder<T> withChild(final T child) { if ((this.children == null)) this.children = new java.util.ArrayList<T>(); this.children.add(child); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularListsBuilder<T> withChildren(final java.util.Collection<? extends T> children) { + public @java.lang.SuppressWarnings("all") BuilderSingularListsWithSetterPrefixBuilder<T> withChildren(final java.util.Collection<? extends T> children) { if ((this.children == null)) this.children = new java.util.ArrayList<T>(); this.children.addAll(children); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularListsBuilder<T> clearChildren() { + public @java.lang.SuppressWarnings("all") BuilderSingularListsWithSetterPrefixBuilder<T> clearChildren() { if ((this.children != null)) this.children.clear(); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularListsBuilder<T> withScarf(final Number scarf) { + public @java.lang.SuppressWarnings("all") BuilderSingularListsWithSetterPrefixBuilder<T> withScarf(final Number scarf) { if ((this.scarves == null)) this.scarves = new java.util.ArrayList<Number>(); this.scarves.add(scarf); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularListsBuilder<T> withScarves(final java.util.Collection<? extends Number> scarves) { + public @java.lang.SuppressWarnings("all") BuilderSingularListsWithSetterPrefixBuilder<T> withScarves(final java.util.Collection<? extends Number> scarves) { if ((this.scarves == null)) this.scarves = new java.util.ArrayList<Number>(); this.scarves.addAll(scarves); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularListsBuilder<T> clearScarves() { + public @java.lang.SuppressWarnings("all") BuilderSingularListsWithSetterPrefixBuilder<T> clearScarves() { if ((this.scarves != null)) this.scarves.clear(); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularListsBuilder<T> withRawList(final java.lang.Object rawList) { + public @java.lang.SuppressWarnings("all") BuilderSingularListsWithSetterPrefixBuilder<T> withRawList(final java.lang.Object rawList) { if ((this.rawList == null)) this.rawList = new java.util.ArrayList<java.lang.Object>(); this.rawList.add(rawList); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularListsBuilder<T> withRawList(final java.util.Collection<?> rawList) { + public @java.lang.SuppressWarnings("all") BuilderSingularListsWithSetterPrefixBuilder<T> withRawList(final java.util.Collection<?> rawList) { if ((this.rawList == null)) this.rawList = new java.util.ArrayList<java.lang.Object>(); this.rawList.addAll(rawList); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularListsBuilder<T> clearRawList() { + public @java.lang.SuppressWarnings("all") BuilderSingularListsWithSetterPrefixBuilder<T> clearRawList() { if ((this.rawList != null)) this.rawList.clear(); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularLists<T> build() { + public @java.lang.SuppressWarnings("all") BuilderSingularListsWithSetterPrefix<T> build() { java.util.List<T> children; switch (((this.children == null) ? 0 : this.children.size())) { case 0 : @@ -95,22 +95,22 @@ import lombok.Singular; default : rawList = java.util.Collections.unmodifiableList(new java.util.ArrayList<java.lang.Object>(this.rawList)); } - return new BuilderSingularLists<T>(children, scarves, rawList); + return new BuilderSingularListsWithSetterPrefix<T>(children, scarves, rawList); } public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { - return (((((("BuilderSingularLists.BuilderSingularListsBuilder(children=" + this.children) + ", scarves=") + this.scarves) + ", rawList=") + this.rawList) + ")"); + return (((((("BuilderSingularListsWithSetterPrefix.BuilderSingularListsWithSetterPrefixBuilder(children=" + this.children) + ", scarves=") + this.scarves) + ", rawList=") + this.rawList) + ")"); } } private @Singular List<T> children; private @Singular Collection<? extends Number> scarves; private @SuppressWarnings("all") @Singular("rawList") List rawList; - @java.lang.SuppressWarnings("all") BuilderSingularLists(final List<T> children, final Collection<? extends Number> scarves, final List rawList) { + @java.lang.SuppressWarnings("all") BuilderSingularListsWithSetterPrefix(final List<T> children, final Collection<? extends Number> scarves, final List rawList) { super(); this.children = children; this.scarves = scarves; this.rawList = rawList; } - public static @java.lang.SuppressWarnings("all") <T>BuilderSingularListsBuilder<T> builder() { - return new BuilderSingularListsBuilder<T>(); + public static @java.lang.SuppressWarnings("all") <T>BuilderSingularListsWithSetterPrefixBuilder<T> builder() { + return new BuilderSingularListsWithSetterPrefixBuilder<T>(); } } diff --git a/test/transform/resource/after-ecj/BuilderSingularMapsWithSetterPrefix.java b/test/transform/resource/after-ecj/BuilderSingularMapsWithSetterPrefix.java index 9193ccf9..7848b154 100644 --- a/test/transform/resource/after-ecj/BuilderSingularMapsWithSetterPrefix.java +++ b/test/transform/resource/after-ecj/BuilderSingularMapsWithSetterPrefix.java @@ -1,8 +1,8 @@ import java.util.Map; import java.util.SortedMap; import lombok.Singular; -@lombok.Builder(setterPrefix = "with") class BuilderSingularMaps<K, V> { - public static @java.lang.SuppressWarnings("all") class BuilderSingularMapsBuilder<K, V> { +@lombok.Builder(setterPrefix = "with") class BuilderSingularMapsWithSetterPrefix<K, V> { + public static @java.lang.SuppressWarnings("all") class BuilderSingularMapsWithSetterPrefixBuilder<K, V> { private @java.lang.SuppressWarnings("all") java.util.ArrayList<K> women$key; private @java.lang.SuppressWarnings("all") java.util.ArrayList<V> women$value; private @java.lang.SuppressWarnings("all") java.util.ArrayList<K> men$key; @@ -11,10 +11,10 @@ import lombok.Singular; private @java.lang.SuppressWarnings("all") java.util.ArrayList<java.lang.Object> rawMap$value; private @java.lang.SuppressWarnings("all") java.util.ArrayList<String> stringMap$key; private @java.lang.SuppressWarnings("all") java.util.ArrayList<V> stringMap$value; - @java.lang.SuppressWarnings("all") BuilderSingularMapsBuilder() { + @java.lang.SuppressWarnings("all") BuilderSingularMapsWithSetterPrefixBuilder() { super(); } - public @java.lang.SuppressWarnings("all") BuilderSingularMapsBuilder<K, V> withWoman(final K womanKey, final V womanValue) { + public @java.lang.SuppressWarnings("all") BuilderSingularMapsWithSetterPrefixBuilder<K, V> withWoman(final K womanKey, final V womanValue) { if ((this.women$key == null)) { this.women$key = new java.util.ArrayList<K>(); @@ -24,7 +24,7 @@ import lombok.Singular; this.women$value.add(womanValue); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularMapsBuilder<K, V> withWomen(final java.util.Map<? extends K, ? extends V> women) { + public @java.lang.SuppressWarnings("all") BuilderSingularMapsWithSetterPrefixBuilder<K, V> withWomen(final java.util.Map<? extends K, ? extends V> women) { if ((this.women$key == null)) { this.women$key = new java.util.ArrayList<K>(); @@ -37,7 +37,7 @@ import lombok.Singular; } return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularMapsBuilder<K, V> clearWomen() { + public @java.lang.SuppressWarnings("all") BuilderSingularMapsWithSetterPrefixBuilder<K, V> clearWomen() { if ((this.women$key != null)) { this.women$key.clear(); @@ -45,7 +45,7 @@ import lombok.Singular; } return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularMapsBuilder<K, V> withMan(final K manKey, final Number manValue) { + public @java.lang.SuppressWarnings("all") BuilderSingularMapsWithSetterPrefixBuilder<K, V> withMan(final K manKey, final Number manValue) { if ((this.men$key == null)) { this.men$key = new java.util.ArrayList<K>(); @@ -55,7 +55,7 @@ import lombok.Singular; this.men$value.add(manValue); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularMapsBuilder<K, V> withMen(final java.util.Map<? extends K, ? extends Number> men) { + public @java.lang.SuppressWarnings("all") BuilderSingularMapsWithSetterPrefixBuilder<K, V> withMen(final java.util.Map<? extends K, ? extends Number> men) { if ((this.men$key == null)) { this.men$key = new java.util.ArrayList<K>(); @@ -68,7 +68,7 @@ import lombok.Singular; } return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularMapsBuilder<K, V> clearMen() { + public @java.lang.SuppressWarnings("all") BuilderSingularMapsWithSetterPrefixBuilder<K, V> clearMen() { if ((this.men$key != null)) { this.men$key.clear(); @@ -76,7 +76,7 @@ import lombok.Singular; } return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularMapsBuilder<K, V> withRawMap(final java.lang.Object rawMapKey, final java.lang.Object rawMapValue) { + public @java.lang.SuppressWarnings("all") BuilderSingularMapsWithSetterPrefixBuilder<K, V> withRawMap(final java.lang.Object rawMapKey, final java.lang.Object rawMapValue) { if ((this.rawMap$key == null)) { this.rawMap$key = new java.util.ArrayList<java.lang.Object>(); @@ -86,7 +86,7 @@ import lombok.Singular; this.rawMap$value.add(rawMapValue); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularMapsBuilder<K, V> withRawMap(final java.util.Map<?, ?> rawMap) { + public @java.lang.SuppressWarnings("all") BuilderSingularMapsWithSetterPrefixBuilder<K, V> withRawMap(final java.util.Map<?, ?> rawMap) { if ((this.rawMap$key == null)) { this.rawMap$key = new java.util.ArrayList<java.lang.Object>(); @@ -99,7 +99,7 @@ import lombok.Singular; } return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularMapsBuilder<K, V> clearRawMap() { + public @java.lang.SuppressWarnings("all") BuilderSingularMapsWithSetterPrefixBuilder<K, V> clearRawMap() { if ((this.rawMap$key != null)) { this.rawMap$key.clear(); @@ -107,7 +107,7 @@ import lombok.Singular; } return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularMapsBuilder<K, V> withStringMap(final String stringMapKey, final V stringMapValue) { + public @java.lang.SuppressWarnings("all") BuilderSingularMapsWithSetterPrefixBuilder<K, V> withStringMap(final String stringMapKey, final V stringMapValue) { if ((this.stringMap$key == null)) { this.stringMap$key = new java.util.ArrayList<String>(); @@ -117,7 +117,7 @@ import lombok.Singular; this.stringMap$value.add(stringMapValue); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularMapsBuilder<K, V> withStringMap(final java.util.Map<? extends String, ? extends V> stringMap) { + public @java.lang.SuppressWarnings("all") BuilderSingularMapsWithSetterPrefixBuilder<K, V> withStringMap(final java.util.Map<? extends String, ? extends V> stringMap) { if ((this.stringMap$key == null)) { this.stringMap$key = new java.util.ArrayList<String>(); @@ -130,7 +130,7 @@ import lombok.Singular; } return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularMapsBuilder<K, V> clearStringMap() { + public @java.lang.SuppressWarnings("all") BuilderSingularMapsWithSetterPrefixBuilder<K, V> clearStringMap() { if ((this.stringMap$key != null)) { this.stringMap$key.clear(); @@ -138,7 +138,7 @@ import lombok.Singular; } return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularMaps<K, V> build() { + public @java.lang.SuppressWarnings("all") BuilderSingularMapsWithSetterPrefix<K, V> build() { java.util.Map<K, V> women; switch (((this.women$key == null) ? 0 : this.women$key.size())) { case 0 : @@ -186,24 +186,24 @@ import lombok.Singular; stringMap.put(this.stringMap$key.get($i), this.stringMap$value.get($i)); stringMap = java.util.Collections.unmodifiableMap(stringMap); } - return new BuilderSingularMaps<K, V>(women, men, rawMap, stringMap); + return new BuilderSingularMapsWithSetterPrefix<K, V>(women, men, rawMap, stringMap); } public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { - return (((((((((((((((("BuilderSingularMaps.BuilderSingularMapsBuilder(women$key=" + this.women$key) + ", women$value=") + this.women$value) + ", men$key=") + this.men$key) + ", men$value=") + this.men$value) + ", rawMap$key=") + this.rawMap$key) + ", rawMap$value=") + this.rawMap$value) + ", stringMap$key=") + this.stringMap$key) + ", stringMap$value=") + this.stringMap$value) + ")"); + return (((((((((((((((("BuilderSingularMapsWithSetterPrefix.BuilderSingularMapsWithSetterPrefixBuilder(women$key=" + this.women$key) + ", women$value=") + this.women$value) + ", men$key=") + this.men$key) + ", men$value=") + this.men$value) + ", rawMap$key=") + this.rawMap$key) + ", rawMap$value=") + this.rawMap$value) + ", stringMap$key=") + this.stringMap$key) + ", stringMap$value=") + this.stringMap$value) + ")"); } } private @Singular Map<K, V> women; private @Singular SortedMap<K, ? extends Number> men; private @SuppressWarnings("all") @Singular("rawMap") Map rawMap; private @Singular("stringMap") Map<String, V> stringMap; - @java.lang.SuppressWarnings("all") BuilderSingularMaps(final Map<K, V> women, final SortedMap<K, ? extends Number> men, final Map rawMap, final Map<String, V> stringMap) { + @java.lang.SuppressWarnings("all") BuilderSingularMapsWithSetterPrefix(final Map<K, V> women, final SortedMap<K, ? extends Number> men, final Map rawMap, final Map<String, V> stringMap) { super(); this.women = women; this.men = men; this.rawMap = rawMap; this.stringMap = stringMap; } - public static @java.lang.SuppressWarnings("all") <K, V>BuilderSingularMapsBuilder<K, V> builder() { - return new BuilderSingularMapsBuilder<K, V>(); + public static @java.lang.SuppressWarnings("all") <K, V>BuilderSingularMapsWithSetterPrefixBuilder<K, V> builder() { + return new BuilderSingularMapsWithSetterPrefixBuilder<K, V>(); } } diff --git a/test/transform/resource/after-ecj/BuilderSingularNoAutoWithSetterPrefix.java b/test/transform/resource/after-ecj/BuilderSingularNoAutoWithSetterPrefix.java index a7754a99..f24b1640 100644 --- a/test/transform/resource/after-ecj/BuilderSingularNoAutoWithSetterPrefix.java +++ b/test/transform/resource/after-ecj/BuilderSingularNoAutoWithSetterPrefix.java @@ -1,65 +1,65 @@ import java.util.List; import lombok.Singular; -@lombok.Builder(setterPrefix = "with") class BuilderSingularNoAuto { - public static @java.lang.SuppressWarnings("all") class BuilderSingularNoAutoBuilder { +@lombok.Builder(setterPrefix = "with") class BuilderSingularNoAutoWithSetterPrefix { + public static @java.lang.SuppressWarnings("all") class BuilderSingularNoAutoWithSetterPrefixBuilder { private @java.lang.SuppressWarnings("all") java.util.ArrayList<String> things; private @java.lang.SuppressWarnings("all") java.util.ArrayList<String> widgets; private @java.lang.SuppressWarnings("all") java.util.ArrayList<String> items; - @java.lang.SuppressWarnings("all") BuilderSingularNoAutoBuilder() { + @java.lang.SuppressWarnings("all") BuilderSingularNoAutoWithSetterPrefixBuilder() { super(); } - public @java.lang.SuppressWarnings("all") BuilderSingularNoAutoBuilder withThings(final String things) { + public @java.lang.SuppressWarnings("all") BuilderSingularNoAutoWithSetterPrefixBuilder withThings(final String things) { if ((this.things == null)) this.things = new java.util.ArrayList<String>(); this.things.add(things); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularNoAutoBuilder withThings(final java.util.Collection<? extends String> things) { + public @java.lang.SuppressWarnings("all") BuilderSingularNoAutoWithSetterPrefixBuilder withThings(final java.util.Collection<? extends String> things) { if ((this.things == null)) this.things = new java.util.ArrayList<String>(); this.things.addAll(things); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularNoAutoBuilder clearThings() { + public @java.lang.SuppressWarnings("all") BuilderSingularNoAutoWithSetterPrefixBuilder clearThings() { if ((this.things != null)) this.things.clear(); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularNoAutoBuilder withWidget(final String widget) { + public @java.lang.SuppressWarnings("all") BuilderSingularNoAutoWithSetterPrefixBuilder withWidget(final String widget) { if ((this.widgets == null)) this.widgets = new java.util.ArrayList<String>(); this.widgets.add(widget); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularNoAutoBuilder withWidgets(final java.util.Collection<? extends String> widgets) { + public @java.lang.SuppressWarnings("all") BuilderSingularNoAutoWithSetterPrefixBuilder withWidgets(final java.util.Collection<? extends String> widgets) { if ((this.widgets == null)) this.widgets = new java.util.ArrayList<String>(); this.widgets.addAll(widgets); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularNoAutoBuilder clearWidgets() { + public @java.lang.SuppressWarnings("all") BuilderSingularNoAutoWithSetterPrefixBuilder clearWidgets() { if ((this.widgets != null)) this.widgets.clear(); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularNoAutoBuilder withItems(final String items) { + public @java.lang.SuppressWarnings("all") BuilderSingularNoAutoWithSetterPrefixBuilder withItems(final String items) { if ((this.items == null)) this.items = new java.util.ArrayList<String>(); this.items.add(items); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularNoAutoBuilder withItems(final java.util.Collection<? extends String> items) { + public @java.lang.SuppressWarnings("all") BuilderSingularNoAutoWithSetterPrefixBuilder withItems(final java.util.Collection<? extends String> items) { if ((this.items == null)) this.items = new java.util.ArrayList<String>(); this.items.addAll(items); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularNoAutoBuilder clearItems() { + public @java.lang.SuppressWarnings("all") BuilderSingularNoAutoWithSetterPrefixBuilder clearItems() { if ((this.items != null)) this.items.clear(); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularNoAuto build() { + public @java.lang.SuppressWarnings("all") BuilderSingularNoAutoWithSetterPrefix build() { java.util.List<String> things; switch (((this.things == null) ? 0 : this.things.size())) { case 0 : @@ -93,22 +93,22 @@ import lombok.Singular; default : items = java.util.Collections.unmodifiableList(new java.util.ArrayList<String>(this.items)); } - return new BuilderSingularNoAuto(things, widgets, items); + return new BuilderSingularNoAutoWithSetterPrefix(things, widgets, items); } public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { - return (((((("BuilderSingularNoAuto.BuilderSingularNoAutoBuilder(things=" + this.things) + ", widgets=") + this.widgets) + ", items=") + this.items) + ")"); + return (((((("BuilderSingularNoAutoWithSetterPrefix.BuilderSingularNoAutoWithSetterPrefixBuilder(things=" + this.things) + ", widgets=") + this.widgets) + ", items=") + this.items) + ")"); } } private @Singular List<String> things; private @Singular("widget") List<String> widgets; private @Singular List<String> items; - @java.lang.SuppressWarnings("all") BuilderSingularNoAuto(final List<String> things, final List<String> widgets, final List<String> items) { + @java.lang.SuppressWarnings("all") BuilderSingularNoAutoWithSetterPrefix(final List<String> things, final List<String> widgets, final List<String> items) { super(); this.things = things; this.widgets = widgets; this.items = items; } - public static @java.lang.SuppressWarnings("all") BuilderSingularNoAutoBuilder builder() { - return new BuilderSingularNoAutoBuilder(); + public static @java.lang.SuppressWarnings("all") BuilderSingularNoAutoWithSetterPrefixBuilder builder() { + return new BuilderSingularNoAutoWithSetterPrefixBuilder(); } } diff --git a/test/transform/resource/after-ecj/BuilderSingularRedirectToGuavaWithSetterPrefix.java b/test/transform/resource/after-ecj/BuilderSingularRedirectToGuavaWithSetterPrefix.java index 6f12f986..c6e163cb 100644 --- a/test/transform/resource/after-ecj/BuilderSingularRedirectToGuavaWithSetterPrefix.java +++ b/test/transform/resource/after-ecj/BuilderSingularRedirectToGuavaWithSetterPrefix.java @@ -2,82 +2,82 @@ import java.util.Set; import java.util.NavigableMap; import java.util.Collection; import lombok.Singular; -@lombok.Builder(setterPrefix = "with") class BuilderSingularRedirectToGuava { - public static @java.lang.SuppressWarnings("all") class BuilderSingularRedirectToGuavaBuilder { +@lombok.Builder(setterPrefix = "with") class BuilderSingularRedirectToGuavaWithSetterPrefix { + public static @java.lang.SuppressWarnings("all") class BuilderSingularRedirectToGuavaWithSetterPrefixBuilder { private @java.lang.SuppressWarnings("all") com.google.common.collect.ImmutableSet.Builder<String> dangerMice; private @java.lang.SuppressWarnings("all") com.google.common.collect.ImmutableSortedMap.Builder<Integer, Number> things; private @java.lang.SuppressWarnings("all") com.google.common.collect.ImmutableList.Builder<Class<?>> doohickeys; - @java.lang.SuppressWarnings("all") BuilderSingularRedirectToGuavaBuilder() { + @java.lang.SuppressWarnings("all") BuilderSingularRedirectToGuavaWithSetterPrefixBuilder() { super(); } - public @java.lang.SuppressWarnings("all") BuilderSingularRedirectToGuavaBuilder withDangerMouse(final String dangerMouse) { + public @java.lang.SuppressWarnings("all") BuilderSingularRedirectToGuavaWithSetterPrefixBuilder withDangerMouse(final String dangerMouse) { if ((this.dangerMice == null)) this.dangerMice = com.google.common.collect.ImmutableSet.builder(); this.dangerMice.add(dangerMouse); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularRedirectToGuavaBuilder withDangerMice(final java.lang.Iterable<? extends String> dangerMice) { + public @java.lang.SuppressWarnings("all") BuilderSingularRedirectToGuavaWithSetterPrefixBuilder withDangerMice(final java.lang.Iterable<? extends String> dangerMice) { if ((this.dangerMice == null)) this.dangerMice = com.google.common.collect.ImmutableSet.builder(); this.dangerMice.addAll(dangerMice); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularRedirectToGuavaBuilder clearDangerMice() { + public @java.lang.SuppressWarnings("all") BuilderSingularRedirectToGuavaWithSetterPrefixBuilder clearDangerMice() { this.dangerMice = null; return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularRedirectToGuavaBuilder withThing(final Integer key, final Number value) { + public @java.lang.SuppressWarnings("all") BuilderSingularRedirectToGuavaWithSetterPrefixBuilder withThing(final Integer key, final Number value) { if ((this.things == null)) this.things = com.google.common.collect.ImmutableSortedMap.naturalOrder(); this.things.put(key, value); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularRedirectToGuavaBuilder withThings(final java.util.Map<? extends Integer, ? extends Number> things) { + public @java.lang.SuppressWarnings("all") BuilderSingularRedirectToGuavaWithSetterPrefixBuilder withThings(final java.util.Map<? extends Integer, ? extends Number> things) { if ((this.things == null)) this.things = com.google.common.collect.ImmutableSortedMap.naturalOrder(); this.things.putAll(things); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularRedirectToGuavaBuilder clearThings() { + public @java.lang.SuppressWarnings("all") BuilderSingularRedirectToGuavaWithSetterPrefixBuilder clearThings() { this.things = null; return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularRedirectToGuavaBuilder withDoohickey(final Class<?> doohickey) { + public @java.lang.SuppressWarnings("all") BuilderSingularRedirectToGuavaWithSetterPrefixBuilder withDoohickey(final Class<?> doohickey) { if ((this.doohickeys == null)) this.doohickeys = com.google.common.collect.ImmutableList.builder(); this.doohickeys.add(doohickey); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularRedirectToGuavaBuilder withDoohickeys(final java.lang.Iterable<? extends Class<?>> doohickeys) { + public @java.lang.SuppressWarnings("all") BuilderSingularRedirectToGuavaWithSetterPrefixBuilder withDoohickeys(final java.lang.Iterable<? extends Class<?>> doohickeys) { if ((this.doohickeys == null)) this.doohickeys = com.google.common.collect.ImmutableList.builder(); this.doohickeys.addAll(doohickeys); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularRedirectToGuavaBuilder clearDoohickeys() { + public @java.lang.SuppressWarnings("all") BuilderSingularRedirectToGuavaWithSetterPrefixBuilder clearDoohickeys() { this.doohickeys = null; return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularRedirectToGuava build() { + public @java.lang.SuppressWarnings("all") BuilderSingularRedirectToGuavaWithSetterPrefix build() { java.util.Set<String> dangerMice = ((this.dangerMice == null) ? com.google.common.collect.ImmutableSet.<String>of() : this.dangerMice.build()); java.util.NavigableMap<Integer, Number> things = ((this.things == null) ? com.google.common.collect.ImmutableSortedMap.<Integer, Number>of() : this.things.build()); java.util.Collection<Class<?>> doohickeys = ((this.doohickeys == null) ? com.google.common.collect.ImmutableList.<Class<?>>of() : this.doohickeys.build()); - return new BuilderSingularRedirectToGuava(dangerMice, things, doohickeys); + return new BuilderSingularRedirectToGuavaWithSetterPrefix(dangerMice, things, doohickeys); } public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { - return (((((("BuilderSingularRedirectToGuava.BuilderSingularRedirectToGuavaBuilder(dangerMice=" + this.dangerMice) + ", things=") + this.things) + ", doohickeys=") + this.doohickeys) + ")"); + return (((((("BuilderSingularRedirectToGuavaWithSetterPrefix.BuilderSingularRedirectToGuavaWithSetterPrefixBuilder(dangerMice=" + this.dangerMice) + ", things=") + this.things) + ", doohickeys=") + this.doohickeys) + ")"); } } private @Singular Set<String> dangerMice; private @Singular NavigableMap<Integer, Number> things; private @Singular Collection<Class<?>> doohickeys; - @java.lang.SuppressWarnings("all") BuilderSingularRedirectToGuava(final Set<String> dangerMice, final NavigableMap<Integer, Number> things, final Collection<Class<?>> doohickeys) { + @java.lang.SuppressWarnings("all") BuilderSingularRedirectToGuavaWithSetterPrefix(final Set<String> dangerMice, final NavigableMap<Integer, Number> things, final Collection<Class<?>> doohickeys) { super(); this.dangerMice = dangerMice; this.things = things; this.doohickeys = doohickeys; } - public static @java.lang.SuppressWarnings("all") BuilderSingularRedirectToGuavaBuilder builder() { - return new BuilderSingularRedirectToGuavaBuilder(); + public static @java.lang.SuppressWarnings("all") BuilderSingularRedirectToGuavaWithSetterPrefixBuilder builder() { + return new BuilderSingularRedirectToGuavaWithSetterPrefixBuilder(); } } diff --git a/test/transform/resource/after-ecj/BuilderSingularSetsWithSetterPrefix.java b/test/transform/resource/after-ecj/BuilderSingularSetsWithSetterPrefix.java index 1bf552c5..cb5041a7 100644 --- a/test/transform/resource/after-ecj/BuilderSingularSetsWithSetterPrefix.java +++ b/test/transform/resource/after-ecj/BuilderSingularSetsWithSetterPrefix.java @@ -1,84 +1,84 @@ import java.util.Set; import java.util.SortedSet; import lombok.Singular; -@lombok.Builder(setterPrefix = "with") class BuilderSingularSets<T> { - public static @java.lang.SuppressWarnings("all") class BuilderSingularSetsBuilder<T> { +@lombok.Builder(setterPrefix = "with") class BuilderSingularSetsWithSetterPrefix<T> { + public static @java.lang.SuppressWarnings("all") class BuilderSingularSetsWithSetterPrefixBuilder<T> { private @java.lang.SuppressWarnings("all") java.util.ArrayList<T> dangerMice; private @java.lang.SuppressWarnings("all") java.util.ArrayList<Number> octopodes; private @java.lang.SuppressWarnings("all") java.util.ArrayList<java.lang.Object> rawSet; private @java.lang.SuppressWarnings("all") java.util.ArrayList<String> stringSet; - @java.lang.SuppressWarnings("all") BuilderSingularSetsBuilder() { + @java.lang.SuppressWarnings("all") BuilderSingularSetsWithSetterPrefixBuilder() { super(); } - public @java.lang.SuppressWarnings("all") BuilderSingularSetsBuilder<T> dangerMouse(final T dangerMouse) { + public @java.lang.SuppressWarnings("all") BuilderSingularSetsWithSetterPrefixBuilder<T> dangerMouse(final T dangerMouse) { if ((this.dangerMice == null)) this.dangerMice = new java.util.ArrayList<T>(); this.dangerMice.add(dangerMouse); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularSetsBuilder<T> dangerMice(final java.util.Collection<? extends T> dangerMice) { + public @java.lang.SuppressWarnings("all") BuilderSingularSetsWithSetterPrefixBuilder<T> dangerMice(final java.util.Collection<? extends T> dangerMice) { if ((this.dangerMice == null)) this.dangerMice = new java.util.ArrayList<T>(); this.dangerMice.addAll(dangerMice); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularSetsBuilder<T> clearDangerMice() { + public @java.lang.SuppressWarnings("all") BuilderSingularSetsWithSetterPrefixBuilder<T> clearDangerMice() { if ((this.dangerMice != null)) this.dangerMice.clear(); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularSetsBuilder<T> octopus(final Number octopus) { + public @java.lang.SuppressWarnings("all") BuilderSingularSetsWithSetterPrefixBuilder<T> octopus(final Number octopus) { if ((this.octopodes == null)) this.octopodes = new java.util.ArrayList<Number>(); this.octopodes.add(octopus); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularSetsBuilder<T> octopodes(final java.util.Collection<? extends Number> octopodes) { + public @java.lang.SuppressWarnings("all") BuilderSingularSetsWithSetterPrefixBuilder<T> octopodes(final java.util.Collection<? extends Number> octopodes) { if ((this.octopodes == null)) this.octopodes = new java.util.ArrayList<Number>(); this.octopodes.addAll(octopodes); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularSetsBuilder<T> clearOctopodes() { + public @java.lang.SuppressWarnings("all") BuilderSingularSetsWithSetterPrefixBuilder<T> clearOctopodes() { if ((this.octopodes != null)) this.octopodes.clear(); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularSetsBuilder<T> rawSet(final java.lang.Object rawSet) { + public @java.lang.SuppressWarnings("all") BuilderSingularSetsWithSetterPrefixBuilder<T> rawSet(final java.lang.Object rawSet) { if ((this.rawSet == null)) this.rawSet = new java.util.ArrayList<java.lang.Object>(); this.rawSet.add(rawSet); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularSetsBuilder<T> rawSet(final java.util.Collection<?> rawSet) { + public @java.lang.SuppressWarnings("all") BuilderSingularSetsWithSetterPrefixBuilder<T> rawSet(final java.util.Collection<?> rawSet) { if ((this.rawSet == null)) this.rawSet = new java.util.ArrayList<java.lang.Object>(); this.rawSet.addAll(rawSet); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularSetsBuilder<T> clearRawSet() { + public @java.lang.SuppressWarnings("all") BuilderSingularSetsWithSetterPrefixBuilder<T> clearRawSet() { if ((this.rawSet != null)) this.rawSet.clear(); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularSetsBuilder<T> stringSet(final String stringSet) { + public @java.lang.SuppressWarnings("all") BuilderSingularSetsWithSetterPrefixBuilder<T> stringSet(final String stringSet) { if ((this.stringSet == null)) this.stringSet = new java.util.ArrayList<String>(); this.stringSet.add(stringSet); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularSetsBuilder<T> stringSet(final java.util.Collection<? extends String> stringSet) { + public @java.lang.SuppressWarnings("all") BuilderSingularSetsWithSetterPrefixBuilder<T> stringSet(final java.util.Collection<? extends String> stringSet) { if ((this.stringSet == null)) this.stringSet = new java.util.ArrayList<String>(); this.stringSet.addAll(stringSet); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularSetsBuilder<T> clearStringSet() { + public @java.lang.SuppressWarnings("all") BuilderSingularSetsWithSetterPrefixBuilder<T> clearStringSet() { if ((this.stringSet != null)) this.stringSet.clear(); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularSets<T> build() { + public @java.lang.SuppressWarnings("all") BuilderSingularSetsWithSetterPrefix<T> build() { java.util.Set<T> dangerMice; switch (((this.dangerMice == null) ? 0 : this.dangerMice.size())) { case 0 : @@ -122,24 +122,24 @@ import lombok.Singular; stringSet.addAll(this.stringSet); stringSet = java.util.Collections.unmodifiableSet(stringSet); } - return new BuilderSingularSets<T>(dangerMice, octopodes, rawSet, stringSet); + return new BuilderSingularSetsWithSetterPrefix<T>(dangerMice, octopodes, rawSet, stringSet); } public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { - return (((((((("BuilderSingularSets.BuilderSingularSetsBuilder(dangerMice=" + this.dangerMice) + ", octopodes=") + this.octopodes) + ", rawSet=") + this.rawSet) + ", stringSet=") + this.stringSet) + ")"); + return (((((((("BuilderSingularSetsWithSetterPrefix.BuilderSingularSetsWithSetterPrefixBuilder(dangerMice=" + this.dangerMice) + ", octopodes=") + this.octopodes) + ", rawSet=") + this.rawSet) + ", stringSet=") + this.stringSet) + ")"); } } private @Singular Set<T> dangerMice; private @Singular SortedSet<? extends Number> octopodes; private @SuppressWarnings("all") @Singular("rawSet") Set rawSet; private @Singular("stringSet") Set<String> stringSet; - @java.lang.SuppressWarnings("all") BuilderSingularSets(final Set<T> dangerMice, final SortedSet<? extends Number> octopodes, final Set rawSet, final Set<String> stringSet) { + @java.lang.SuppressWarnings("all") BuilderSingularSetsWithSetterPrefix(final Set<T> dangerMice, final SortedSet<? extends Number> octopodes, final Set rawSet, final Set<String> stringSet) { super(); this.dangerMice = dangerMice; this.octopodes = octopodes; this.rawSet = rawSet; this.stringSet = stringSet; } - public static @java.lang.SuppressWarnings("all") <T>BuilderSingularSetsBuilder<T> builder() { - return new BuilderSingularSetsBuilder<T>(); + public static @java.lang.SuppressWarnings("all") <T>BuilderSingularSetsWithSetterPrefixBuilder<T> builder() { + return new BuilderSingularSetsWithSetterPrefixBuilder<T>(); } } diff --git a/test/transform/resource/after-ecj/BuilderSingularToBuilderWithNullWithSetterPrefix.java b/test/transform/resource/after-ecj/BuilderSingularToBuilderWithNullWithSetterPrefix.java index 086e0701..03f8adf9 100644 --- a/test/transform/resource/after-ecj/BuilderSingularToBuilderWithNullWithSetterPrefix.java +++ b/test/transform/resource/after-ecj/BuilderSingularToBuilderWithNullWithSetterPrefix.java @@ -1,28 +1,28 @@ import lombok.Singular; -@lombok.Builder(toBuilder = true, setterPrefix = "with") class BuilderSingularToBuilderWithNull { - public static @java.lang.SuppressWarnings("all") class BuilderSingularToBuilderWithNullBuilder { +@lombok.Builder(toBuilder = true, setterPrefix = "with") class BuilderSingularToBuilderWithNullWithSetterPrefix { + public static @java.lang.SuppressWarnings("all") class BuilderSingularToBuilderWithNullWithSetterPrefixBuilder { private @java.lang.SuppressWarnings("all") java.util.ArrayList<String> elems; - @java.lang.SuppressWarnings("all") BuilderSingularToBuilderWithNullBuilder() { + @java.lang.SuppressWarnings("all") BuilderSingularToBuilderWithNullWithSetterPrefixBuilder() { super(); } - public @java.lang.SuppressWarnings("all") BuilderSingularToBuilderWithNullBuilder withElem(final String elem) { + public @java.lang.SuppressWarnings("all") BuilderSingularToBuilderWithNullWithSetterPrefixBuilder withElem(final String elem) { if ((this.elems == null)) this.elems = new java.util.ArrayList<String>(); this.elems.add(elem); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularToBuilderWithNullBuilder withElems(final java.util.Collection<? extends String> elems) { + public @java.lang.SuppressWarnings("all") BuilderSingularToBuilderWithNullWithSetterPrefixBuilder withElems(final java.util.Collection<? extends String> elems) { if ((this.elems == null)) this.elems = new java.util.ArrayList<String>(); this.elems.addAll(elems); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularToBuilderWithNullBuilder clearElems() { + public @java.lang.SuppressWarnings("all") BuilderSingularToBuilderWithNullWithSetterPrefixBuilder clearElems() { if ((this.elems != null)) this.elems.clear(); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularToBuilderWithNull build() { + public @java.lang.SuppressWarnings("all") BuilderSingularToBuilderWithNullWithSetterPrefix build() { java.util.List<String> elems; switch (((this.elems == null) ? 0 : this.elems.size())) { case 0 : @@ -34,25 +34,25 @@ import lombok.Singular; default : elems = java.util.Collections.unmodifiableList(new java.util.ArrayList<String>(this.elems)); } - return new BuilderSingularToBuilderWithNull(elems); + return new BuilderSingularToBuilderWithNullWithSetterPrefix(elems); } public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { - return (("BuilderSingularToBuilderWithNull.BuilderSingularToBuilderWithNullBuilder(elems=" + this.elems) + ")"); + return (("BuilderSingularToBuilderWithNullWithSetterPrefix.BuilderSingularToBuilderWithNullWithSetterPrefixBuilder(elems=" + this.elems) + ")"); } } private @Singular java.util.List<String> elems; public static void test() { - new BuilderSingularToBuilderWithNull(null).toBuilder(); + new BuilderSingularToBuilderWithNullWithSetterPrefix(null).toBuilder(); } - @java.lang.SuppressWarnings("all") BuilderSingularToBuilderWithNull(final java.util.List<String> elems) { + @java.lang.SuppressWarnings("all") BuilderSingularToBuilderWithNullWithSetterPrefix(final java.util.List<String> elems) { super(); this.elems = elems; } - public static @java.lang.SuppressWarnings("all") BuilderSingularToBuilderWithNullBuilder builder() { - return new BuilderSingularToBuilderWithNullBuilder(); + public static @java.lang.SuppressWarnings("all") BuilderSingularToBuilderWithNullWithSetterPrefixBuilder builder() { + return new BuilderSingularToBuilderWithNullWithSetterPrefixBuilder(); } - public @java.lang.SuppressWarnings("all") BuilderSingularToBuilderWithNullBuilder toBuilder() { - final BuilderSingularToBuilderWithNullBuilder builder = new BuilderSingularToBuilderWithNullBuilder(); + public @java.lang.SuppressWarnings("all") BuilderSingularToBuilderWithNullWithSetterPrefixBuilder toBuilder() { + final BuilderSingularToBuilderWithNullWithSetterPrefixBuilder builder = new BuilderSingularToBuilderWithNullWithSetterPrefixBuilder(); if ((this.elems != null)) builder.elems(this.elems); return builder; diff --git a/test/transform/resource/after-ecj/BuilderSingularWildcardListsWithToBuilderWithSetterPrefix.java b/test/transform/resource/after-ecj/BuilderSingularWildcardListsWithToBuilderWithSetterPrefix.java index 635b6a79..358e6910 100644 --- a/test/transform/resource/after-ecj/BuilderSingularWildcardListsWithToBuilderWithSetterPrefix.java +++ b/test/transform/resource/after-ecj/BuilderSingularWildcardListsWithToBuilderWithSetterPrefix.java @@ -1,48 +1,48 @@ import java.util.List; import java.util.Collection; import lombok.Singular; -@lombok.Builder(toBuilder = true, setterPrefix = "with") class BuilderSingularWildcardListsWithToBuilder { - public static @java.lang.SuppressWarnings("all") class BuilderSingularWildcardListsWithToBuilderBuilder { +@lombok.Builder(toBuilder = true, setterPrefix = "with") class BuilderSingularWildcardListsWithToBuilderWithSetterPrefix { + public static @java.lang.SuppressWarnings("all") class BuilderSingularWildcardListsWithToBuilderWithSetterPrefixBuilder { private @java.lang.SuppressWarnings("all") java.util.ArrayList<java.lang.Object> objects; private @java.lang.SuppressWarnings("all") java.util.ArrayList<Number> numbers; - @java.lang.SuppressWarnings("all") BuilderSingularWildcardListsWithToBuilderBuilder() { + @java.lang.SuppressWarnings("all") BuilderSingularWildcardListsWithToBuilderWithSetterPrefixBuilder() { super(); } - public @java.lang.SuppressWarnings("all") BuilderSingularWildcardListsWithToBuilderBuilder withObject(final java.lang.Object object) { + public @java.lang.SuppressWarnings("all") BuilderSingularWildcardListsWithToBuilderWithSetterPrefixBuilder withObject(final java.lang.Object object) { if ((this.objects == null)) this.objects = new java.util.ArrayList<java.lang.Object>(); this.objects.add(object); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularWildcardListsWithToBuilderBuilder withObjects(final java.util.Collection<?> objects) { + public @java.lang.SuppressWarnings("all") BuilderSingularWildcardListsWithToBuilderWithSetterPrefixBuilder withObjects(final java.util.Collection<?> objects) { if ((this.objects == null)) this.objects = new java.util.ArrayList<java.lang.Object>(); this.objects.addAll(objects); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularWildcardListsWithToBuilderBuilder clearObjects() { + public @java.lang.SuppressWarnings("all") BuilderSingularWildcardListsWithToBuilderWithSetterPrefixBuilder clearObjects() { if ((this.objects != null)) this.objects.clear(); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularWildcardListsWithToBuilderBuilder withNumber(final Number number) { + public @java.lang.SuppressWarnings("all") BuilderSingularWildcardListsWithToBuilderWithSetterPrefixBuilder withNumber(final Number number) { if ((this.numbers == null)) this.numbers = new java.util.ArrayList<Number>(); this.numbers.add(number); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularWildcardListsWithToBuilderBuilder withNumbers(final java.util.Collection<? extends Number> numbers) { + public @java.lang.SuppressWarnings("all") BuilderSingularWildcardListsWithToBuilderWithSetterPrefixBuilder withNumbers(final java.util.Collection<? extends Number> numbers) { if ((this.numbers == null)) this.numbers = new java.util.ArrayList<Number>(); this.numbers.addAll(numbers); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularWildcardListsWithToBuilderBuilder clearNumbers() { + public @java.lang.SuppressWarnings("all") BuilderSingularWildcardListsWithToBuilderWithSetterPrefixBuilder clearNumbers() { if ((this.numbers != null)) this.numbers.clear(); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularWildcardListsWithToBuilder build() { + public @java.lang.SuppressWarnings("all") BuilderSingularWildcardListsWithToBuilderWithSetterPrefix build() { java.util.List<java.lang.Object> objects; switch (((this.objects == null) ? 0 : this.objects.size())) { case 0 : @@ -65,24 +65,24 @@ import lombok.Singular; default : numbers = java.util.Collections.unmodifiableList(new java.util.ArrayList<Number>(this.numbers)); } - return new BuilderSingularWildcardListsWithToBuilder(objects, numbers); + return new BuilderSingularWildcardListsWithToBuilderWithSetterPrefix(objects, numbers); } public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { - return (((("BuilderSingularWildcardListsWithToBuilder.BuilderSingularWildcardListsWithToBuilderBuilder(objects=" + this.objects) + ", numbers=") + this.numbers) + ")"); + return (((("BuilderSingularWildcardListsWithToBuilderWithSetterPrefix.BuilderSingularWildcardListsWithToBuilderWithSetterPrefixBuilder(objects=" + this.objects) + ", numbers=") + this.numbers) + ")"); } } private @Singular List<?> objects; private @Singular Collection<? extends Number> numbers; - @java.lang.SuppressWarnings("all") BuilderSingularWildcardListsWithToBuilder(final List<?> objects, final Collection<? extends Number> numbers) { + @java.lang.SuppressWarnings("all") BuilderSingularWildcardListsWithToBuilderWithSetterPrefix(final List<?> objects, final Collection<? extends Number> numbers) { super(); this.objects = objects; this.numbers = numbers; } - public static @java.lang.SuppressWarnings("all") BuilderSingularWildcardListsWithToBuilderBuilder builder() { - return new BuilderSingularWildcardListsWithToBuilderBuilder(); + public static @java.lang.SuppressWarnings("all") BuilderSingularWildcardListsWithToBuilderWithSetterPrefixBuilder builder() { + return new BuilderSingularWildcardListsWithToBuilderWithSetterPrefixBuilder(); } - public @java.lang.SuppressWarnings("all") BuilderSingularWildcardListsWithToBuilderBuilder toBuilder() { - final BuilderSingularWildcardListsWithToBuilderBuilder builder = new BuilderSingularWildcardListsWithToBuilderBuilder(); + public @java.lang.SuppressWarnings("all") BuilderSingularWildcardListsWithToBuilderWithSetterPrefixBuilder toBuilder() { + final BuilderSingularWildcardListsWithToBuilderWithSetterPrefixBuilder builder = new BuilderSingularWildcardListsWithToBuilderWithSetterPrefixBuilder(); if ((this.objects != null)) builder.objects(this.objects); if ((this.numbers != null)) diff --git a/test/transform/resource/after-ecj/BuilderSingularWithPrefixesWithSetterPrefix.java b/test/transform/resource/after-ecj/BuilderSingularWithPrefixesWithSetterPrefix.java index d9cea692..88f64f34 100644 --- a/test/transform/resource/after-ecj/BuilderSingularWithPrefixesWithSetterPrefix.java +++ b/test/transform/resource/after-ecj/BuilderSingularWithPrefixesWithSetterPrefix.java @@ -1,28 +1,28 @@ import lombok.Singular; -@lombok.Builder(setterPrefix = "with") @lombok.experimental.Accessors(prefix = "_") class BuilderSingularWithPrefixes { - public static @java.lang.SuppressWarnings("all") class BuilderSingularWithPrefixesBuilder { +@lombok.Builder(setterPrefix = "with") @lombok.experimental.Accessors(prefix = "_") class BuilderSingularWithPrefixesWithSetterPrefixes { + public static @java.lang.SuppressWarnings("all") class BuilderSingularWithPrefixesWithSetterPrefixesBuilder { private @java.lang.SuppressWarnings("all") java.util.ArrayList<String> elems; - @java.lang.SuppressWarnings("all") BuilderSingularWithPrefixesBuilder() { + @java.lang.SuppressWarnings("all") BuilderSingularWithPrefixesWithSetterPrefixesBuilder() { super(); } - public @java.lang.SuppressWarnings("all") BuilderSingularWithPrefixesBuilder withElem(final String elem) { + public @java.lang.SuppressWarnings("all") BuilderSingularWithPrefixesWithSetterPrefixesBuilder withElem(final String elem) { if ((this.elems == null)) this.elems = new java.util.ArrayList<String>(); this.elems.add(elem); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularWithPrefixesBuilder withElems(final java.util.Collection<? extends String> elems) { + public @java.lang.SuppressWarnings("all") BuilderSingularWithPrefixesWithSetterPrefixesBuilder withElems(final java.util.Collection<? extends String> elems) { if ((this.elems == null)) this.elems = new java.util.ArrayList<String>(); this.elems.addAll(elems); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularWithPrefixesBuilder clearElems() { + public @java.lang.SuppressWarnings("all") BuilderSingularWithPrefixesWithSetterPrefixesBuilder clearElems() { if ((this.elems != null)) this.elems.clear(); return this; } - public @java.lang.SuppressWarnings("all") BuilderSingularWithPrefixes build() { + public @java.lang.SuppressWarnings("all") BuilderSingularWithPrefixesWithSetterPrefixes build() { java.util.List<String> elems; switch (((this.elems == null) ? 0 : this.elems.size())) { case 0 : @@ -34,18 +34,18 @@ import lombok.Singular; default : elems = java.util.Collections.unmodifiableList(new java.util.ArrayList<String>(this.elems)); } - return new BuilderSingularWithPrefixes(elems); + return new BuilderSingularWithPrefixesWithSetterPrefixes(elems); } public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { - return (("BuilderSingularWithPrefixes.BuilderSingularWithPrefixesBuilder(elems=" + this.elems) + ")"); + return (("BuilderSingularWithPrefixesWithSetterPrefixes.BuilderSingularWithPrefixesWithSetterPrefixesBuilder(elems=" + this.elems) + ")"); } } private @Singular java.util.List<String> _elems; - @java.lang.SuppressWarnings("all") BuilderSingularWithPrefixes(final java.util.List<String> elems) { + @java.lang.SuppressWarnings("all") BuilderSingularWithPrefixesWithSetterPrefixes(final java.util.List<String> elems) { super(); this._elems = elems; } - public static @java.lang.SuppressWarnings("all") BuilderSingularWithPrefixesBuilder builder() { - return new BuilderSingularWithPrefixesBuilder(); + public static @java.lang.SuppressWarnings("all") BuilderSingularWithPrefixesWithSetterPrefixesBuilder builder() { + return new BuilderSingularWithPrefixesWithSetterPrefixesBuilder(); } } diff --git a/test/transform/resource/after-ecj/BuilderTypeAnnosWithSetterPrefix.java b/test/transform/resource/after-ecj/BuilderTypeAnnosWithSetterPrefix.java index ed62dc85..db44aa12 100644 --- a/test/transform/resource/after-ecj/BuilderTypeAnnosWithSetterPrefix.java +++ b/test/transform/resource/after-ecj/BuilderTypeAnnosWithSetterPrefix.java @@ -5,29 +5,29 @@ import java.util.List; } @Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER}) @interface TB { } -@lombok.Builder(setterPrefix = "with") class BuilderTypeAnnos { - public static @java.lang.SuppressWarnings("all") class BuilderTypeAnnosBuilder { +@lombok.Builder(setterPrefix = "with") class BuilderTypeAnnosWithSetterPrefix { + public static @java.lang.SuppressWarnings("all") class BuilderTypeAnnosWithSetterPrefixBuilder { private @java.lang.SuppressWarnings("all") List<String> foo; - @java.lang.SuppressWarnings("all") BuilderTypeAnnosBuilder() { + @java.lang.SuppressWarnings("all") BuilderTypeAnnosWithSetterPrefixBuilder() { super(); } - public @java.lang.SuppressWarnings("all") BuilderTypeAnnosBuilder withFoo(final @TA List<String> foo) { + public @java.lang.SuppressWarnings("all") BuilderTypeAnnosWithSetterPrefixBuilder withFoo(final @TA List<String> foo) { this.foo = foo; return this; } - public @java.lang.SuppressWarnings("all") BuilderTypeAnnos build() { - return new BuilderTypeAnnos(foo); + public @java.lang.SuppressWarnings("all") BuilderTypeAnnosWithSetterPrefix build() { + return new BuilderTypeAnnosWithSetterPrefix(foo); } public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { - return (("BuilderTypeAnnos.BuilderTypeAnnosBuilder(foo=" + this.foo) + ")"); + return (("BuilderTypeAnnosWithSetterPrefix.BuilderTypeAnnosWithSetterPrefixBuilder(foo=" + this.foo) + ")"); } } private @TA @TB List<String> foo; - @java.lang.SuppressWarnings("all") BuilderTypeAnnos(final @TA List<String> foo) { + @java.lang.SuppressWarnings("all") BuilderTypeAnnosWithSetterPrefix(final @TA List<String> foo) { super(); this.foo = foo; } - public static @java.lang.SuppressWarnings("all") BuilderTypeAnnosBuilder builder() { - return new BuilderTypeAnnosBuilder(); + public static @java.lang.SuppressWarnings("all") BuilderTypeAnnosWithSetterPrefixBuilder builder() { + return new BuilderTypeAnnosWithSetterPrefixBuilder(); } } diff --git a/test/transform/resource/after-ecj/BuilderValueDataWithSetterPrefix.java b/test/transform/resource/after-ecj/BuilderValueDataWithSetterPrefix.java index ffecad46..679591a4 100644 --- a/test/transform/resource/after-ecj/BuilderValueDataWithSetterPrefix.java +++ b/test/transform/resource/after-ecj/BuilderValueDataWithSetterPrefix.java @@ -1,22 +1,22 @@ import java.util.List; -final @lombok.Builder(setterPrefix = "with") @lombok.Value class BuilderAndValue { - public static @java.lang.SuppressWarnings("all") class BuilderAndValueBuilder { - @java.lang.SuppressWarnings("all") BuilderAndValueBuilder() { +final @lombok.Builder(setterPrefix = "with") @lombok.Value class BuilderAndValueWithSetterPrefix { + public static @java.lang.SuppressWarnings("all") class BuilderAndValueWithSetterPrefixBuilder { + @java.lang.SuppressWarnings("all") BuilderAndValueWithSetterPrefixBuilder() { super(); } - public @java.lang.SuppressWarnings("all") BuilderAndValue build() { - return new BuilderAndValue(); + public @java.lang.SuppressWarnings("all") BuilderAndValueWithSetterPrefix build() { + return new BuilderAndValueWithSetterPrefix(); } public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { - return "BuilderAndValue.BuilderAndValueBuilder()"; + return "BuilderAndValueWithSetterPrefix.BuilderAndValueWithSetterPrefixBuilder()"; } } private final int zero = 0; - @java.lang.SuppressWarnings("all") BuilderAndValue() { + @java.lang.SuppressWarnings("all") BuilderAndValueWithSetterPrefix() { super(); } - public static @java.lang.SuppressWarnings("all") BuilderAndValueBuilder builder() { - return new BuilderAndValueBuilder(); + public static @java.lang.SuppressWarnings("all") BuilderAndValueWithSetterPrefixBuilder builder() { + return new BuilderAndValueWithSetterPrefixBuilder(); } public @java.lang.SuppressWarnings("all") int getZero() { return this.zero; @@ -24,9 +24,9 @@ final @lombok.Builder(setterPrefix = "with") @lombok.Value class BuilderAndValue public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { if ((o == this)) return true; - if ((! (o instanceof BuilderAndValue))) + if ((! (o instanceof BuilderAndValueWithSetterPrefix))) return false; - final BuilderAndValue other = (BuilderAndValue) o; + final BuilderAndValueWithSetterPrefix other = (BuilderAndValueWithSetterPrefix) o; if ((this.getZero() != other.getZero())) return false; return true; @@ -38,27 +38,27 @@ final @lombok.Builder(setterPrefix = "with") @lombok.Value class BuilderAndValue return result; } public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { - return (("BuilderAndValue(zero=" + this.getZero()) + ")"); + return (("BuilderAndValueWithSetterPrefix(zero=" + this.getZero()) + ")"); } } -@lombok.Builder @lombok.Data class BuilderAndData { - public static @java.lang.SuppressWarnings("all") class BuilderAndDataBuilder { - @java.lang.SuppressWarnings("all") BuilderAndDataBuilder() { +@lombok.Builder @lombok.Data class BuilderAndDataWithSetterPrefix { + public static @java.lang.SuppressWarnings("all") class BuilderAndDataWithSetterPrefixBuilder { + @java.lang.SuppressWarnings("all") BuilderAndDataWithSetterPrefixBuilder() { super(); } - public @java.lang.SuppressWarnings("all") BuilderAndData build() { - return new BuilderAndData(); + public @java.lang.SuppressWarnings("all") BuilderAndDataWithSetterPrefix build() { + return new BuilderAndDataWithSetterPrefix(); } public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { - return "BuilderAndData.BuilderAndDataBuilder()"; + return "BuilderAndDataWithSetterPrefix.BuilderAndDataWithSetterPrefixBuilder()"; } } private final int zero = 0; - @java.lang.SuppressWarnings("all") BuilderAndData() { + @java.lang.SuppressWarnings("all") BuilderAndDataWithSetterPrefix() { super(); } - public static @java.lang.SuppressWarnings("all") BuilderAndDataBuilder builder() { - return new BuilderAndDataBuilder(); + public static @java.lang.SuppressWarnings("all") BuilderAndDataWithSetterPrefixBuilder builder() { + return new BuilderAndDataWithSetterPrefixBuilder(); } public @java.lang.SuppressWarnings("all") int getZero() { return this.zero; @@ -66,9 +66,9 @@ final @lombok.Builder(setterPrefix = "with") @lombok.Value class BuilderAndValue public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { if ((o == this)) return true; - if ((! (o instanceof BuilderAndData))) + if ((! (o instanceof BuilderAndDataWithSetterPrefix))) return false; - final BuilderAndData other = (BuilderAndData) o; + final BuilderAndDataWithSetterPrefix other = (BuilderAndDataWithSetterPrefix) o; if ((! other.canEqual((java.lang.Object) this))) return false; if ((this.getZero() != other.getZero())) @@ -76,7 +76,7 @@ final @lombok.Builder(setterPrefix = "with") @lombok.Value class BuilderAndValue return true; } protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { - return (other instanceof BuilderAndData); + return (other instanceof BuilderAndDataWithSetterPrefix); } public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { final int PRIME = 59; @@ -85,6 +85,6 @@ final @lombok.Builder(setterPrefix = "with") @lombok.Value class BuilderAndValue return result; } public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { - return (("BuilderAndData(zero=" + this.getZero()) + ")"); + return (("BuilderAndDataWithSetterPrefix(zero=" + this.getZero()) + ")"); } } diff --git a/test/transform/resource/after-ecj/BuilderWithAccessorsWithSetterPrefix.java b/test/transform/resource/after-ecj/BuilderWithAccessorsWithSetterPrefix.java index 388e813d..5894a4a2 100644 --- a/test/transform/resource/after-ecj/BuilderWithAccessorsWithSetterPrefix.java +++ b/test/transform/resource/after-ecj/BuilderWithAccessorsWithSetterPrefix.java @@ -1,47 +1,47 @@ -@lombok.Builder(setterPrefix = "with") @lombok.experimental.Accessors(prefix = {"p", "_"}) class BuilderWithAccessors { - public static @java.lang.SuppressWarnings("all") class BuilderWithAccessorsBuilder { +@lombok.Builder(setterPrefix = "with") @lombok.experimental.Accessors(prefix = {"p", "_"}) class BuilderWithAccessorsWithSetterPrefix { + public static @java.lang.SuppressWarnings("all") class BuilderWithAccessorsWithSetterPrefixBuilder { private @java.lang.SuppressWarnings("all") int plower; private @java.lang.SuppressWarnings("all") int upper; private @java.lang.SuppressWarnings("all") int foo; private @java.lang.SuppressWarnings("all") int _bar; - @java.lang.SuppressWarnings("all") BuilderWithAccessorsBuilder() { + @java.lang.SuppressWarnings("all") BuilderWithAccessorsWithSetterPrefixBuilder() { super(); } - public @java.lang.SuppressWarnings("all") BuilderWithAccessorsBuilder withPlower(final int plower) { + public @java.lang.SuppressWarnings("all") BuilderWithAccessorsWithSetterPrefixBuilder withPlower(final int plower) { this.plower = plower; return this; } - public @java.lang.SuppressWarnings("all") BuilderWithAccessorsBuilder withUpper(final int upper) { + public @java.lang.SuppressWarnings("all") BuilderWithAccessorsWithSetterPrefixBuilder withUpper(final int upper) { this.upper = upper; return this; } - public @java.lang.SuppressWarnings("all") BuilderWithAccessorsBuilder withFoo(final int foo) { + public @java.lang.SuppressWarnings("all") BuilderWithAccessorsWithSetterPrefixBuilder withFoo(final int foo) { this.foo = foo; return this; } - public @java.lang.SuppressWarnings("all") BuilderWithAccessorsBuilder with_Bar(final int _bar) { + public @java.lang.SuppressWarnings("all") BuilderWithAccessorsWithSetterPrefixBuilder with_Bar(final int _bar) { this._bar = _bar; return this; } - public @java.lang.SuppressWarnings("all") BuilderWithAccessors build() { - return new BuilderWithAccessors(plower, upper, foo, _bar); + public @java.lang.SuppressWarnings("all") BuilderWithAccessorsWithSetterPrefix build() { + return new BuilderWithAccessorsWithSetterPrefix(plower, upper, foo, _bar); } public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { - return (((((((("BuilderWithAccessors.BuilderWithAccessorsBuilder(plower=" + this.plower) + ", upper=") + this.upper) + ", foo=") + this.foo) + ", _bar=") + this._bar) + ")"); + return (((((((("BuilderWithAccessorsWithSetterPrefix.BuilderWithAccessorsWithSetterPrefixBuilder(plower=" + this.plower) + ", upper=") + this.upper) + ", foo=") + this.foo) + ", _bar=") + this._bar) + ")"); } } private final int plower; private final int pUpper; private int _foo; private int __bar; - @java.lang.SuppressWarnings("all") BuilderWithAccessors(final int plower, final int upper, final int foo, final int _bar) { + @java.lang.SuppressWarnings("all") BuilderWithAccessorsWithSetterPrefix(final int plower, final int upper, final int foo, final int _bar) { super(); this.plower = plower; this.pUpper = upper; this._foo = foo; this.__bar = _bar; } - public static @java.lang.SuppressWarnings("all") BuilderWithAccessorsBuilder builder() { - return new BuilderWithAccessorsBuilder(); + public static @java.lang.SuppressWarnings("all") BuilderWithAccessorsWithSetterPrefixBuilder builder() { + return new BuilderWithAccessorsWithSetterPrefixBuilder(); } } diff --git a/test/transform/resource/after-ecj/BuilderWithBadNamesWithSetterPrefix.java b/test/transform/resource/after-ecj/BuilderWithBadNamesWithSetterPrefix.java index 465517f7..248c77ad 100644 --- a/test/transform/resource/after-ecj/BuilderWithBadNamesWithSetterPrefix.java +++ b/test/transform/resource/after-ecj/BuilderWithBadNamesWithSetterPrefix.java @@ -1,33 +1,33 @@ -public @lombok.Builder(setterPrefix = "with") class BuilderWithBadNames { - public static @java.lang.SuppressWarnings("all") class BuilderWithBadNamesBuilder { +public @lombok.Builder(setterPrefix = "with") class BuilderWithBadNamesWithSetterPrefix { + public static @java.lang.SuppressWarnings("all") class BuilderWithBadNamesWithSetterPrefixBuilder { private @java.lang.SuppressWarnings("all") String build; private @java.lang.SuppressWarnings("all") String toString; - @java.lang.SuppressWarnings("all") BuilderWithBadNamesBuilder() { + @java.lang.SuppressWarnings("all") BuilderWithBadNamesWithSetterPrefixBuilder() { super(); } - public @java.lang.SuppressWarnings("all") BuilderWithBadNamesBuilder withBuild(final String build) { + public @java.lang.SuppressWarnings("all") BuilderWithBadNamesWithSetterPrefixBuilder withBuild(final String build) { this.build = build; return this; } - public @java.lang.SuppressWarnings("all") BuilderWithBadNamesBuilder withToString(final String toString) { + public @java.lang.SuppressWarnings("all") BuilderWithBadNamesWithSetterPrefixBuilder withToString(final String toString) { this.toString = toString; return this; } - public @java.lang.SuppressWarnings("all") BuilderWithBadNames build() { - return new BuilderWithBadNames(build, toString); + public @java.lang.SuppressWarnings("all") BuilderWithBadNamesWithSetterPrefix build() { + return new BuilderWithBadNamesWithSetterPrefix(build, toString); } public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { - return (((("BuilderWithBadNames.BuilderWithBadNamesBuilder(build=" + this.build) + ", toString=") + this.toString) + ")"); + return (((("BuilderWithBadNamesWithSetterPrefix.BuilderWithBadNamesWithSetterPrefixBuilder(build=" + this.build) + ", toString=") + this.toString) + ")"); } } String build; String toString; - @java.lang.SuppressWarnings("all") BuilderWithBadNames(final String build, final String toString) { + @java.lang.SuppressWarnings("all") BuilderWithBadNamesWithSetterPrefix(final String build, final String toString) { super(); this.build = build; this.toString = toString; } - public static @java.lang.SuppressWarnings("all") BuilderWithBadNamesBuilder builder() { - return new BuilderWithBadNamesBuilder(); + public static @java.lang.SuppressWarnings("all") BuilderWithBadNamesWithSetterPrefixBuilder builder() { + return new BuilderWithBadNamesWithSetterPrefixBuilder(); } } diff --git a/test/transform/resource/after-ecj/BuilderWithDeprecatedWithSetterPrefix.java b/test/transform/resource/after-ecj/BuilderWithDeprecatedWithSetterPrefix.java index 0d8e023f..83fa2e4e 100644 --- a/test/transform/resource/after-ecj/BuilderWithDeprecatedWithSetterPrefix.java +++ b/test/transform/resource/after-ecj/BuilderWithDeprecatedWithSetterPrefix.java @@ -1,57 +1,57 @@ import com.google.common.collect.ImmutableList; import lombok.Builder; import lombok.Singular; -public @Builder(setterPrefix = "with") class BuilderWithDeprecated { - public static @java.lang.SuppressWarnings("all") class BuilderWithDeprecatedBuilder { +public @Builder(setterPrefix = "with") class BuilderWithDeprecatedWithSetterPrefix { + public static @java.lang.SuppressWarnings("all") class BuilderWithDeprecatedWithSetterPrefixBuilder { private @java.lang.SuppressWarnings("all") String dep1; private @java.lang.SuppressWarnings("all") int dep2; private @java.lang.SuppressWarnings("all") java.util.ArrayList<String> strings; private @java.lang.SuppressWarnings("all") com.google.common.collect.ImmutableList.Builder<Integer> numbers; - @java.lang.SuppressWarnings("all") BuilderWithDeprecatedBuilder() { + @java.lang.SuppressWarnings("all") BuilderWithDeprecatedWithSetterPrefixBuilder() { super(); } - public @java.lang.Deprecated @java.lang.SuppressWarnings("all") BuilderWithDeprecatedBuilder withDep1(final String dep1) { + public @java.lang.Deprecated @java.lang.SuppressWarnings("all") BuilderWithDeprecatedWithSetterPrefixBuilder withDep1(final String dep1) { this.dep1 = dep1; return this; } - public @java.lang.Deprecated @java.lang.SuppressWarnings("all") BuilderWithDeprecatedBuilder withDep2(final int dep2) { + public @java.lang.Deprecated @java.lang.SuppressWarnings("all") BuilderWithDeprecatedWithSetterPrefixBuilder withDep2(final int dep2) { this.dep2 = dep2; return this; } - public @java.lang.Deprecated @java.lang.SuppressWarnings("all") BuilderWithDeprecatedBuilder withString(final String string) { + public @java.lang.Deprecated @java.lang.SuppressWarnings("all") BuilderWithDeprecatedWithSetterPrefixBuilder withString(final String string) { if ((this.strings == null)) this.strings = new java.util.ArrayList<String>(); this.strings.add(string); return this; } - public @java.lang.Deprecated @java.lang.SuppressWarnings("all") BuilderWithDeprecatedBuilder withStrings(final java.util.Collection<? extends String> strings) { + public @java.lang.Deprecated @java.lang.SuppressWarnings("all") BuilderWithDeprecatedWithSetterPrefixBuilder withStrings(final java.util.Collection<? extends String> strings) { if ((this.strings == null)) this.strings = new java.util.ArrayList<String>(); this.strings.addAll(strings); return this; } - public @java.lang.Deprecated @java.lang.SuppressWarnings("all") BuilderWithDeprecatedBuilder clearStrings() { + public @java.lang.Deprecated @java.lang.SuppressWarnings("all") BuilderWithDeprecatedWithSetterPrefixBuilder clearStrings() { if ((this.strings != null)) this.strings.clear(); return this; } - public @java.lang.Deprecated @java.lang.SuppressWarnings("all") BuilderWithDeprecatedBuilder withNumber(final Integer number) { + public @java.lang.Deprecated @java.lang.SuppressWarnings("all") BuilderWithDeprecatedWithSetterPrefixBuilder withNumber(final Integer number) { if ((this.numbers == null)) this.numbers = com.google.common.collect.ImmutableList.builder(); this.numbers.add(number); return this; } - public @java.lang.Deprecated @java.lang.SuppressWarnings("all") BuilderWithDeprecatedBuilder withNumbers(final java.lang.Iterable<? extends Integer> numbers) { + public @java.lang.Deprecated @java.lang.SuppressWarnings("all") BuilderWithDeprecatedWithSetterPrefixBuilder withNumbers(final java.lang.Iterable<? extends Integer> numbers) { if ((this.numbers == null)) this.numbers = com.google.common.collect.ImmutableList.builder(); this.numbers.addAll(numbers); return this; } - public @java.lang.Deprecated @java.lang.SuppressWarnings("all") BuilderWithDeprecatedBuilder clearNumbers() { + public @java.lang.Deprecated @java.lang.SuppressWarnings("all") BuilderWithDeprecatedWithSetterPrefixBuilder clearNumbers() { this.numbers = null; return this; } - public @java.lang.SuppressWarnings("all") BuilderWithDeprecated build() { + public @java.lang.SuppressWarnings("all") BuilderWithDeprecatedWithSetterPrefix build() { java.util.List<String> strings; switch (((this.strings == null) ? 0 : this.strings.size())) { case 0 : @@ -64,24 +64,24 @@ public @Builder(setterPrefix = "with") class BuilderWithDeprecated { strings = java.util.Collections.unmodifiableList(new java.util.ArrayList<String>(this.strings)); } com.google.common.collect.ImmutableList<Integer> numbers = ((this.numbers == null) ? com.google.common.collect.ImmutableList.<Integer>of() : this.numbers.build()); - return new BuilderWithDeprecated(dep1, dep2, strings, numbers); + return new BuilderWithDeprecatedWithSetterPrefix(dep1, dep2, strings, numbers); } public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { - return (((((((("BuilderWithDeprecated.BuilderWithDeprecatedBuilder(dep1=" + this.dep1) + ", dep2=") + this.dep2) + ", strings=") + this.strings) + ", numbers=") + this.numbers) + ")"); + return (((((((("BuilderWithDeprecatedWithSetterPrefix.BuilderWithDeprecatedWithSetterPrefixBuilder(dep1=" + this.dep1) + ", dep2=") + this.dep2) + ", strings=") + this.strings) + ", numbers=") + this.numbers) + ")"); } } String dep1; @Deprecated int dep2; @Singular @Deprecated java.util.List<String> strings; @Singular @Deprecated ImmutableList<Integer> numbers; - @java.lang.SuppressWarnings("all") BuilderWithDeprecated(final String dep1, final int dep2, final java.util.List<String> strings, final ImmutableList<Integer> numbers) { + @java.lang.SuppressWarnings("all") BuilderWithDeprecatedWithSetterPrefix(final String dep1, final int dep2, final java.util.List<String> strings, final ImmutableList<Integer> numbers) { super(); this.dep1 = dep1; this.dep2 = dep2; this.strings = strings; this.numbers = numbers; } - public static @java.lang.SuppressWarnings("all") BuilderWithDeprecatedBuilder builder() { - return new BuilderWithDeprecatedBuilder(); + public static @java.lang.SuppressWarnings("all") BuilderWithDeprecatedWithSetterPrefixBuilder builder() { + return new BuilderWithDeprecatedWithSetterPrefixBuilder(); } } diff --git a/test/transform/resource/after-ecj/BuilderWithExistingBuilderClassWithSetterPrefix.java b/test/transform/resource/after-ecj/BuilderWithExistingBuilderClassWithSetterPrefix.java index 220a8a63..8da2f012 100644 --- a/test/transform/resource/after-ecj/BuilderWithExistingBuilderClassWithSetterPrefix.java +++ b/test/transform/resource/after-ecj/BuilderWithExistingBuilderClassWithSetterPrefix.java @@ -1,36 +1,36 @@ import lombok.Builder; -class BuilderWithExistingBuilderClass<T, K extends Number> { - public static class BuilderWithExistingBuilderClassBuilder<Z extends Number> { +class BuilderWithExistingBuilderClassWithSetterPrefix<T, K extends Number> { + public static class BuilderWithExistingBuilderClassWithSetterPrefixBuilder<Z extends Number> { private @java.lang.SuppressWarnings("all") boolean arg2; private @java.lang.SuppressWarnings("all") String arg3; private Z arg1; public void withArg2(boolean arg) { } - @java.lang.SuppressWarnings("all") BuilderWithExistingBuilderClassBuilder() { + @java.lang.SuppressWarnings("all") BuilderWithExistingBuilderClassWithSetterPrefixBuilder() { super(); } - public @java.lang.SuppressWarnings("all") BuilderWithExistingBuilderClassBuilder<Z> withArg1(final Z arg1) { + public @java.lang.SuppressWarnings("all") BuilderWithExistingBuilderClassWithSetterPrefixBuilder<Z> withArg1(final Z arg1) { this.arg1 = arg1; return this; } - public @java.lang.SuppressWarnings("all") BuilderWithExistingBuilderClassBuilder<Z> withArg3(final String arg3) { + public @java.lang.SuppressWarnings("all") BuilderWithExistingBuilderClassWithSetterPrefixBuilder<Z> withArg3(final String arg3) { this.arg3 = arg3; return this; } - public @java.lang.SuppressWarnings("all") BuilderWithExistingBuilderClass<String, Z> build() { - return BuilderWithExistingBuilderClass.<Z>staticMethod(arg1, arg2, arg3); + public @java.lang.SuppressWarnings("all") BuilderWithExistingBuilderClassWithSetterPrefix<String, Z> build() { + return BuilderWithExistingBuilderClassWithSetterPrefix.<Z>staticMethod(arg1, arg2, arg3); } public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { - return (((((("BuilderWithExistingBuilderClass.BuilderWithExistingBuilderClassBuilder(arg1=" + this.arg1) + ", arg2=") + this.arg2) + ", arg3=") + this.arg3) + ")"); + return (((((("BuilderWithExistingBuilderClassWithSetterPrefix.BuilderWithExistingBuilderClassWithSetterPrefixBuilder(arg1=" + this.arg1) + ", arg2=") + this.arg2) + ", arg3=") + this.arg3) + ")"); } } - BuilderWithExistingBuilderClass() { + BuilderWithExistingBuilderClassWithSetterPrefix() { super(); } - public static @Builder(setterPrefix = "with") <Z extends Number>BuilderWithExistingBuilderClass<String, Z> staticMethod(Z arg1, boolean arg2, String arg3) { + public static @Builder(setterPrefix = "with") <Z extends Number>BuilderWithExistingBuilderClassWithSetterPrefix<String, Z> staticMethod(Z arg1, boolean arg2, String arg3) { return null; } - public static @java.lang.SuppressWarnings("all") <Z extends Number>BuilderWithExistingBuilderClassBuilder<Z> builder() { - return new BuilderWithExistingBuilderClassBuilder<Z>(); + public static @java.lang.SuppressWarnings("all") <Z extends Number>BuilderWithExistingBuilderClassWithSetterPrefixBuilder<Z> builder() { + return new BuilderWithExistingBuilderClassWithSetterPrefixBuilder<Z>(); } } diff --git a/test/transform/resource/after-ecj/BuilderWithNoBuilderMethodWithSetterPrefix.java b/test/transform/resource/after-ecj/BuilderWithNoBuilderMethodWithSetterPrefix.java index 0b934767..30043dd9 100644 --- a/test/transform/resource/after-ecj/BuilderWithNoBuilderMethodWithSetterPrefix.java +++ b/test/transform/resource/after-ecj/BuilderWithNoBuilderMethodWithSetterPrefix.java @@ -1,27 +1,27 @@ import lombok.Builder; -@Builder(toBuilder = true,builderMethodName = "",setterPrefix = "with") class BuilderWithNoBuilderMethod { - public static @java.lang.SuppressWarnings("all") class BuilderWithNoBuilderMethodBuilder { +@Builder(toBuilder = true,builderMethodName = "",setterPrefix = "with") class BuilderWithNoBuilderMethodWithSetterPrefix { + public static @java.lang.SuppressWarnings("all") class BuilderWithNoBuilderMethodWithSetterPrefixBuilder { private @java.lang.SuppressWarnings("all") String a; - @java.lang.SuppressWarnings("all") BuilderWithNoBuilderMethodBuilder() { + @java.lang.SuppressWarnings("all") BuilderWithNoBuilderMethodWithSetterPrefixBuilder() { super(); } - public @java.lang.SuppressWarnings("all") BuilderWithNoBuilderMethodBuilder withA(final String a) { + public @java.lang.SuppressWarnings("all") BuilderWithNoBuilderMethodWithSetterPrefixBuilder withA(final String a) { this.a = a; return this; } - public @java.lang.SuppressWarnings("all") BuilderWithNoBuilderMethod build() { - return new BuilderWithNoBuilderMethod(a); + public @java.lang.SuppressWarnings("all") BuilderWithNoBuilderMethodWithSetterPrefix build() { + return new BuilderWithNoBuilderMethodWithSetterPrefix(a); } public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { - return (("BuilderWithNoBuilderMethod.BuilderWithNoBuilderMethodBuilder(a=" + this.a) + ")"); + return (("BuilderWithNoBuilderMethodWithSetterPrefix.BuilderWithNoBuilderMethodWithSetterPrefixBuilder(a=" + this.a) + ")"); } } private String a = ""; - @java.lang.SuppressWarnings("all") BuilderWithNoBuilderMethod(final String a) { + @java.lang.SuppressWarnings("all") BuilderWithNoBuilderMethodWithSetterPrefix(final String a) { super(); this.a = a; } - public @java.lang.SuppressWarnings("all") BuilderWithNoBuilderMethodBuilder toBuilder() { - return new BuilderWithNoBuilderMethodBuilder().withA(this.a); + public @java.lang.SuppressWarnings("all") BuilderWithNoBuilderMethodWithSetterPrefixBuilder toBuilder() { + return new BuilderWithNoBuilderMethodWithSetterPrefixBuilder().withA(this.a); } } diff --git a/test/transform/resource/after-ecj/BuilderWithNonNullWithSetterPrefix.java b/test/transform/resource/after-ecj/BuilderWithNonNullWithSetterPrefix.java index 6379e25f..7f8cb80b 100644 --- a/test/transform/resource/after-ecj/BuilderWithNonNullWithSetterPrefix.java +++ b/test/transform/resource/after-ecj/BuilderWithNonNullWithSetterPrefix.java @@ -1,10 +1,10 @@ -@lombok.Builder(setterPrefix = "with") class BuilderWithNonNull { - public static @java.lang.SuppressWarnings("all") class BuilderWithNonNullBuilder { +@lombok.Builder(setterPrefix = "with") class BuilderWithNonNullWithSetterPrefix { + public static @java.lang.SuppressWarnings("all") class BuilderWithNonNullWithSetterPrefixBuilder { private @java.lang.SuppressWarnings("all") String id; - @java.lang.SuppressWarnings("all") BuilderWithNonNullBuilder() { + @java.lang.SuppressWarnings("all") BuilderWithNonNullWithSetterPrefixBuilder() { super(); } - public @java.lang.SuppressWarnings("all") BuilderWithNonNullBuilder withId(final @lombok.NonNull String id) { + public @java.lang.SuppressWarnings("all") BuilderWithNonNullWithSetterPrefixBuilder withId(final @lombok.NonNull String id) { if ((id == null)) { throw new java.lang.NullPointerException("id is marked non-null but is null"); @@ -12,15 +12,15 @@ this.id = id; return this; } - public @java.lang.SuppressWarnings("all") BuilderWithNonNull build() { - return new BuilderWithNonNull(id); + public @java.lang.SuppressWarnings("all") BuilderWithNonNullWithSetterPrefix build() { + return new BuilderWithNonNullWithSetterPrefix(id); } public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { - return (("BuilderWithNonNull.BuilderWithNonNullBuilder(id=" + this.id) + ")"); + return (("BuilderWithNonNullWithSetterPrefix.BuilderWithNonNullWithSetterPrefixBuilder(id=" + this.id) + ")"); } } private final @lombok.NonNull String id; - @java.lang.SuppressWarnings("all") BuilderWithNonNull(final @lombok.NonNull String id) { + @java.lang.SuppressWarnings("all") BuilderWithNonNullWithSetterPrefix(final @lombok.NonNull String id) { super(); if ((id == null)) { @@ -28,7 +28,7 @@ } this.id = id; } - public static @java.lang.SuppressWarnings("all") BuilderWithNonNullBuilder builder() { - return new BuilderWithNonNullBuilder(); + public static @java.lang.SuppressWarnings("all") BuilderWithNonNullWithSetterPrefixBuilder builder() { + return new BuilderWithNonNullWithSetterPrefixBuilder(); } } diff --git a/test/transform/resource/after-ecj/BuilderWithRecursiveGenericsWithSetterPrefix.java b/test/transform/resource/after-ecj/BuilderWithRecursiveGenericsWithSetterPrefix.java index 32b9c20e..2ce25b0a 100644 --- a/test/transform/resource/after-ecj/BuilderWithRecursiveGenericsWithSetterPrefix.java +++ b/test/transform/resource/after-ecj/BuilderWithRecursiveGenericsWithSetterPrefix.java @@ -1,7 +1,7 @@ import java.util.Set; import lombok.Builder; import lombok.Value; -public class BuilderWithRecursiveGenerics { +public class BuilderWithRecursiveGenericsWithSetterPrefix { interface Inter<T, U extends Inter<T, U>> { } public static final @Builder(setterPrefix = "with(setterPrefix = "with")") @Value class Test<Foo, Bar extends Set<Foo>, Quz extends Inter<Bar, Quz>> { @@ -23,7 +23,7 @@ public class BuilderWithRecursiveGenerics { return new Test<Foo, Bar, Quz>(foo, bar); } public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { - return (((("BuilderWithRecursiveGenerics.Test.TestBuilder(foo=" + this.foo) + ", bar=") + this.bar) + ")"); + return (((("BuilderWithRecursiveGenericsWithSetterPrefix.Test.TestBuilder(foo=" + this.foo) + ", bar=") + this.bar) + ")"); } } private final Foo foo; @@ -45,9 +45,9 @@ public class BuilderWithRecursiveGenerics { public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { if ((o == this)) return true; - if ((! (o instanceof BuilderWithRecursiveGenerics.Test))) + if ((! (o instanceof BuilderWithRecursiveGenericsWithSetterPrefix.Test))) return false; - final BuilderWithRecursiveGenerics.Test<?, ?, ?> other = (BuilderWithRecursiveGenerics.Test<?, ?, ?>) o; + final BuilderWithRecursiveGenericsWithSetterPrefix.Test<?, ?, ?> other = (BuilderWithRecursiveGenericsWithSetterPrefix.Test<?, ?, ?>) o; final java.lang.Object this$foo = this.getFoo(); final java.lang.Object other$foo = other.getFoo(); if (((this$foo == null) ? (other$foo != null) : (! this$foo.equals(other$foo)))) @@ -68,10 +68,10 @@ public class BuilderWithRecursiveGenerics { return result; } public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { - return (((("BuilderWithRecursiveGenerics.Test(foo=" + this.getFoo()) + ", bar=") + this.getBar()) + ")"); + return (((("BuilderWithRecursiveGenericsWithSetterPrefix.Test(foo=" + this.getFoo()) + ", bar=") + this.getBar()) + ")"); } } - public BuilderWithRecursiveGenerics() { + public BuilderWithRecursiveGenericsWithSetterPrefix() { super(); } } diff --git a/test/transform/resource/after-ecj/BuilderWithToBuilderWithSetterPrefix.java b/test/transform/resource/after-ecj/BuilderWithToBuilderWithSetterPrefix.java index 85378cab..c33315a4 100644 --- a/test/transform/resource/after-ecj/BuilderWithToBuilderWithSetterPrefix.java +++ b/test/transform/resource/after-ecj/BuilderWithToBuilderWithSetterPrefix.java @@ -1,44 +1,44 @@ import java.util.List; import lombok.Builder; -@Builder(toBuilder = true,setterPrefix = "with") @lombok.experimental.Accessors(prefix = "m") class BuilderWithToBuilder<T> { - public static @java.lang.SuppressWarnings("all") class BuilderWithToBuilderBuilder<T> { +@Builder(toBuilder = true,setterPrefix = "with") @lombok.experimental.Accessors(prefix = "m") class BuilderWithToBuilderWithSetterPrefix<T> { + public static @java.lang.SuppressWarnings("all") class BuilderWithToBuilderWithSetterPrefixBuilder<T> { private @java.lang.SuppressWarnings("all") String one; private @java.lang.SuppressWarnings("all") String two; private @java.lang.SuppressWarnings("all") T foo; private @java.lang.SuppressWarnings("all") java.util.ArrayList<T> bars; - @java.lang.SuppressWarnings("all") BuilderWithToBuilderBuilder() { + @java.lang.SuppressWarnings("all") BuilderWithToBuilderWithSetterPrefixBuilder() { super(); } - public @java.lang.SuppressWarnings("all") BuilderWithToBuilderBuilder<T> withOne(final String one) { + public @java.lang.SuppressWarnings("all") BuilderWithToBuilderWithSetterPrefixBuilder<T> withOne(final String one) { this.one = one; return this; } - public @java.lang.SuppressWarnings("all") BuilderWithToBuilderBuilder<T> withTwo(final String two) { + public @java.lang.SuppressWarnings("all") BuilderWithToBuilderWithSetterPrefixBuilder<T> withTwo(final String two) { this.two = two; return this; } - public @java.lang.SuppressWarnings("all") BuilderWithToBuilderBuilder<T> withFoo(final T foo) { + public @java.lang.SuppressWarnings("all") BuilderWithToBuilderWithSetterPrefixBuilder<T> withFoo(final T foo) { this.foo = foo; return this; } - public @java.lang.SuppressWarnings("all") BuilderWithToBuilderBuilder<T> withBar(final T bar) { + public @java.lang.SuppressWarnings("all") BuilderWithToBuilderWithSetterPrefixBuilder<T> withBar(final T bar) { if ((this.bars == null)) this.bars = new java.util.ArrayList<T>(); this.bars.add(bar); return this; } - public @java.lang.SuppressWarnings("all") BuilderWithToBuilderBuilder<T> withBars(final java.util.Collection<? extends T> bars) { + public @java.lang.SuppressWarnings("all") BuilderWithToBuilderWithSetterPrefixBuilder<T> withBars(final java.util.Collection<? extends T> bars) { if ((this.bars == null)) this.bars = new java.util.ArrayList<T>(); this.bars.addAll(bars); return this; } - public @java.lang.SuppressWarnings("all") BuilderWithToBuilderBuilder<T> clearBars() { + public @java.lang.SuppressWarnings("all") BuilderWithToBuilderWithSetterPrefixBuilder<T> clearBars() { if ((this.bars != null)) this.bars.clear(); return this; } - public @java.lang.SuppressWarnings("all") BuilderWithToBuilder<T> build() { + public @java.lang.SuppressWarnings("all") BuilderWithToBuilderWithSetterPrefix<T> build() { java.util.List<T> bars; switch (((this.bars == null) ? 0 : this.bars.size())) { case 0 : @@ -50,31 +50,31 @@ import lombok.Builder; default : bars = java.util.Collections.unmodifiableList(new java.util.ArrayList<T>(this.bars)); } - return new BuilderWithToBuilder<T>(one, two, foo, bars); + return new BuilderWithToBuilderWithSetterPrefix<T>(one, two, foo, bars); } public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { - return (((((((("BuilderWithToBuilder.BuilderWithToBuilderBuilder(one=" + this.one) + ", two=") + this.two) + ", foo=") + this.foo) + ", bars=") + this.bars) + ")"); + return (((((((("BuilderWithToBuilderWithSetterPrefix.BuilderWithToBuilderWithSetterPrefixBuilder(one=" + this.one) + ", two=") + this.two) + ", foo=") + this.foo) + ", bars=") + this.bars) + ")"); } } private String mOne; private String mTwo; private @Builder.ObtainVia(method = "rrr",isStatic = true) T foo; private @lombok.Singular List<T> bars; - public static <K>K rrr(BuilderWithToBuilder<K> x) { + public static <K>K rrr(BuilderWithToBuilderWithSetterPrefix<K> x) { return x.foo; } - @java.lang.SuppressWarnings("all") BuilderWithToBuilder(final String one, final String two, final T foo, final List<T> bars) { + @java.lang.SuppressWarnings("all") BuilderWithToBuilderWithSetterPrefix(final String one, final String two, final T foo, final List<T> bars) { super(); this.mOne = one; this.mTwo = two; this.foo = foo; this.bars = bars; } - public static @java.lang.SuppressWarnings("all") <T>BuilderWithToBuilderBuilder<T> builder() { - return new BuilderWithToBuilderBuilder<T>(); + public static @java.lang.SuppressWarnings("all") <T>BuilderWithToBuilderWithSetterPrefixBuilder<T> builder() { + return new BuilderWithToBuilderWithSetterPrefixBuilder<T>(); } - public @java.lang.SuppressWarnings("all") BuilderWithToBuilderBuilder<T> toBuilder() { - final BuilderWithToBuilderBuilder<T> builder = new BuilderWithToBuilderBuilder<T>().withOne(this.mOne).withTwo(this.mTwo).withFoo(BuilderWithToBuilder.<T>rrr(this)); + public @java.lang.SuppressWarnings("all") BuilderWithToBuilderWithSetterPrefixBuilder<T> toBuilder() { + final BuilderWithToBuilderWithSetterPrefixBuilder<T> builder = new BuilderWithToBuilderWithSetterPrefixBuilder<T>().withOne(this.mOne).withTwo(this.mTwo).withFoo(BuilderWithToBuilderWithSetterPrefix.<T>rrr(this)); if ((this.bars != null)) builder.withBars(this.bars); return builder; diff --git a/test/transform/resource/after-ecj/BuilderWithTolerateWithSetterPrefix.java b/test/transform/resource/after-ecj/BuilderWithTolerateWithSetterPrefix.java index a795bafc..6fa302e5 100644 --- a/test/transform/resource/after-ecj/BuilderWithTolerateWithSetterPrefix.java +++ b/test/transform/resource/after-ecj/BuilderWithTolerateWithSetterPrefix.java @@ -1,34 +1,34 @@ import lombok.Builder; import lombok.experimental.Tolerate; -public @Builder(setterPrefix = "with") class BuilderWithTolerate { - public static class BuilderWithTolerateBuilder { +public @Builder(setterPrefix = "with") class BuilderWithTolerateWithSetterPrefix { + public static class BuilderWithTolerateWithSetterPrefixBuilder { private @java.lang.SuppressWarnings("all") int value; - public @Tolerate BuilderWithTolerateBuilder withValue(String s) { + public @Tolerate BuilderWithTolerateWithSetterPrefixBuilder withValue(String s) { return this.withValue(Integer.parseInt(s)); } - @java.lang.SuppressWarnings("all") BuilderWithTolerateBuilder() { + @java.lang.SuppressWarnings("all") BuilderWithTolerateWithSetterPrefixBuilder() { super(); } - public @java.lang.SuppressWarnings("all") BuilderWithTolerateBuilder withValue(final int value) { + public @java.lang.SuppressWarnings("all") BuilderWithTolerateWithSetterPrefixBuilder withValue(final int value) { this.value = value; return this; } - public @java.lang.SuppressWarnings("all") BuilderWithTolerate build() { - return new BuilderWithTolerate(value); + public @java.lang.SuppressWarnings("all") BuilderWithTolerateWithSetterPrefix build() { + return new BuilderWithTolerateWithSetterPrefix(value); } public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { - return (("BuilderWithTolerate.BuilderWithTolerateBuilder(value=" + this.value) + ")"); + return (("BuilderWithTolerateWithSetterPrefix.BuilderWithTolerateWithSetterPrefixBuilder(value=" + this.value) + ")"); } } private final int value; public static void main(String[] args) { - BuilderWithTolerate.builder().withValue("42").build(); + BuilderWithTolerateWithSetterPrefix.builder().withValue("42").build(); } - @java.lang.SuppressWarnings("all") BuilderWithTolerate(final int value) { + @java.lang.SuppressWarnings("all") BuilderWithTolerateWithSetterPrefix(final int value) { super(); this.value = value; } - public static @java.lang.SuppressWarnings("all") BuilderWithTolerateBuilder builder() { - return new BuilderWithTolerateBuilder(); + public static @java.lang.SuppressWarnings("all") BuilderWithTolerateWithSetterPrefixBuilder builder() { + return new BuilderWithTolerateWithSetterPrefixBuilder(); } } diff --git a/test/transform/resource/before/BuilderSimpleWithSetterPrefix.java b/test/transform/resource/before/BuilderSimpleWithSetterPrefix.java index 38f3c029..19ab7af1 100644 --- a/test/transform/resource/before/BuilderSimpleWithSetterPrefix.java +++ b/test/transform/resource/before/BuilderSimpleWithSetterPrefix.java @@ -1,6 +1,6 @@ import java.util.List; @lombok.Builder(access = lombok.AccessLevel.PROTECTED, setterPrefix = "with") -class BuilderWithPrefix<T> { +class BuilderSimpleWithSetterPrefix<T> { private int unprefixed; } |