diff options
Diffstat (limited to 'src/launch/lombok')
-rw-r--r-- | src/launch/lombok/launch/AnnotationProcessor.java | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/launch/lombok/launch/AnnotationProcessor.java b/src/launch/lombok/launch/AnnotationProcessor.java index 93fba196..05c900ab 100644 --- a/src/launch/lombok/launch/AnnotationProcessor.java +++ b/src/launch/lombok/launch/AnnotationProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2016 The Project Lombok Authors. + * Copyright (C) 2014-2017 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 @@ -33,8 +33,22 @@ import javax.lang.model.element.AnnotationMirror; import javax.lang.model.element.Element; import javax.lang.model.element.ExecutableElement; import javax.lang.model.element.TypeElement; +import javax.lang.model.type.TypeMirror; + +import org.mapstruct.ap.spi.AstModifyingAnnotationProcessor; class AnnotationProcessorHider { + public static class AstModificationNotifier implements AstModifyingAnnotationProcessor { + @Override public boolean isTypeComplete(TypeMirror type) { + if (System.getProperty("lombok.disable") != null) return true; + return AstModificationNotifierData.lombokInvoked; + } + } + + static class AstModificationNotifierData { + volatile static boolean lombokInvoked = false; + } + public static class AnnotationProcessor extends AbstractProcessor { private final AbstractProcessor instance = createWrappedInstance(); @@ -51,6 +65,7 @@ class AnnotationProcessorHider { } @Override public void init(ProcessingEnvironment processingEnv) { + AstModificationNotifierData.lombokInvoked = true; instance.init(processingEnv); super.init(processingEnv); } |