diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2018-03-27 22:04:43 +0200 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2018-03-27 22:04:43 +0200 |
commit | 01bbd212e943c726049ad3d837d7a876f02e08d3 (patch) | |
tree | 7bc8b628b34490cdf0ad188a5636ba0067f89364 /src/core/lombok/eclipse/handlers/HandleBuilder.java | |
parent | 3deb393911583aee8fcdd790bdb51b72737fe410 (diff) | |
download | lombok-01bbd212e943c726049ad3d837d7a876f02e08d3.tar.gz lombok-01bbd212e943c726049ad3d837d7a876f02e08d3.tar.bz2 lombok-01bbd212e943c726049ad3d837d7a876f02e08d3.zip |
[trivial] some memoryload improvements by not making a new instance but using a cached one instead. Fixes issue #1579
Diffstat (limited to 'src/core/lombok/eclipse/handlers/HandleBuilder.java')
-rw-r--r-- | src/core/lombok/eclipse/handlers/HandleBuilder.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/lombok/eclipse/handlers/HandleBuilder.java b/src/core/lombok/eclipse/handlers/HandleBuilder.java index dd862393..d4cdc654 100644 --- a/src/core/lombok/eclipse/handlers/HandleBuilder.java +++ b/src/core/lombok/eclipse/handlers/HandleBuilder.java @@ -89,6 +89,8 @@ import lombok.experimental.NonFinal; @ProviderFor(EclipseAnnotationHandler.class) @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(); @@ -225,7 +227,7 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { allFields.add(fieldNode); } - new HandleConstructor().generateConstructor(tdParent, AccessLevel.PACKAGE, allFields, false, null, SkipIfConstructorExists.I_AM_BUILDER, + handleConstructor.generateConstructor(tdParent, AccessLevel.PACKAGE, allFields, false, null, SkipIfConstructorExists.I_AM_BUILDER, Collections.<Annotation>emptyList(), annotationNode); returnType = namePlusTypeParamsToTypeReference(td.name, td.typeParameters, p); |