mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-14 16:17:34 +00:00
Merge pull request #1583 from jramosf/master
#1579: recycle handlers to avoid excessive garbage collection
This commit is contained in:
1 file changed
+12
-5
@@ -43,6 +43,13 @@ import org.mangosdk.spi.ProviderFor;
|
||||
*/
|
||||
@ProviderFor(EclipseAnnotationHandler.class)
|
||||
public class HandleData extends EclipseAnnotationHandler<Data> {
|
||||
|
||||
private HandleGetter handleGetter = new HandleGetter();
|
||||
private HandleSetter handleSetter = new HandleSetter();
|
||||
private HandleEqualsAndHashCode handleEqualsAndHashCode = new HandleEqualsAndHashCode();
|
||||
private HandleToString handleToString = new HandleToString();
|
||||
private HandleConstructor handleConstructor = new HandleConstructor();
|
||||
|
||||
@Override public void handle(AnnotationValues<Data> annotation, Annotation ast, EclipseNode annotationNode) {
|
||||
handleFlagUsage(annotationNode, ConfigurationKeys.DATA_FLAG_USAGE, "@Data");
|
||||
|
||||
@@ -66,11 +73,11 @@ public class HandleData extends EclipseAnnotationHandler<Data> {
|
||||
//for whatever reason, though you can find callers of that one by focusing on the class name itself
|
||||
//and hitting 'find callers'.
|
||||
|
||||
new HandleGetter().generateGetterForType(typeNode, annotationNode, AccessLevel.PUBLIC, true);
|
||||
new HandleSetter().generateSetterForType(typeNode, annotationNode, AccessLevel.PUBLIC, true);
|
||||
new HandleEqualsAndHashCode().generateEqualsAndHashCodeForType(typeNode, annotationNode);
|
||||
new HandleToString().generateToStringForType(typeNode, annotationNode);
|
||||
new HandleConstructor().generateRequiredArgsConstructor(
|
||||
handleGetter.generateGetterForType(typeNode, annotationNode, AccessLevel.PUBLIC, true);
|
||||
handleSetter.generateSetterForType(typeNode, annotationNode, AccessLevel.PUBLIC, true);
|
||||
handleEqualsAndHashCode.generateEqualsAndHashCodeForType(typeNode, annotationNode);
|
||||
handleToString.generateToStringForType(typeNode, annotationNode);
|
||||
handleConstructor.generateRequiredArgsConstructor(
|
||||
typeNode, AccessLevel.PUBLIC, ann.staticConstructor(), SkipIfConstructorExists.YES,
|
||||
Collections.<Annotation>emptyList(), annotationNode);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user