aboutsummaryrefslogtreecommitdiff
path: root/src/launch
diff options
context:
space:
mode:
authorRoel Spilker <r.spilker@gmail.com>2014-12-09 22:25:01 +0100
committerRoel Spilker <r.spilker@gmail.com>2014-12-09 22:27:58 +0100
commit671f2a202e9e8b597dccc30a7ac4c8a1fbdb3625 (patch)
tree8ff0db66588e454e6359d4d555aaffcb0e9a827c /src/launch
parentb56bdb1b0937fd83c8a2f7a4b7820c9493e56a21 (diff)
downloadlombok-671f2a202e9e8b597dccc30a7ac4c8a1fbdb3625.tar.gz
lombok-671f2a202e9e8b597dccc30a7ac4c8a1fbdb3625.tar.bz2
lombok-671f2a202e9e8b597dccc30a7ac4c8a1fbdb3625.zip
Actually the previous commit lied; you CAN use the hider trick to have a class be invisible to most autocomplete dialogs and yet still work as an SPI provider; SPI lines are binary names (with dollars for inner classes), that's all. Name fixed and previous commit reverted.
Diffstat (limited to 'src/launch')
-rw-r--r--src/launch/lombok/launch/AnnotationProcessor.java (renamed from src/launch/lombok/launch/_ShadowLaunchingAnnotationProcessor.java)76
1 files changed, 39 insertions, 37 deletions
diff --git a/src/launch/lombok/launch/_ShadowLaunchingAnnotationProcessor.java b/src/launch/lombok/launch/AnnotationProcessor.java
index 36787ec9..35c26b7c 100644
--- a/src/launch/lombok/launch/_ShadowLaunchingAnnotationProcessor.java
+++ b/src/launch/lombok/launch/AnnotationProcessor.java
@@ -33,43 +33,45 @@ import javax.lang.model.element.Element;
import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.TypeElement;
-public class _ShadowLaunchingAnnotationProcessor extends AbstractProcessor {
- private final AbstractProcessor instance = createWrappedInstance();
-
- @Override public Set<String> getSupportedOptions() {
- return instance.getSupportedOptions();
- }
-
- @Override public Set<String> getSupportedAnnotationTypes() {
- return instance.getSupportedAnnotationTypes();
- }
-
- @Override public SourceVersion getSupportedSourceVersion() {
- return instance.getSupportedSourceVersion();
- }
-
- @Override public void init(ProcessingEnvironment processingEnv) {
- instance.init(processingEnv);
- super.init(processingEnv);
- }
-
- @Override public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
- return instance.process(annotations, roundEnv);
- }
-
- @Override public Iterable<? extends Completion> getCompletions(Element element, AnnotationMirror annotation, ExecutableElement member, String userText) {
- return instance.getCompletions(element, annotation, member, userText);
- }
-
- private static AbstractProcessor createWrappedInstance() {
- ClassLoader cl = Main.createShadowClassLoader();
- try {
- Class<?> mc = cl.loadClass("lombok.core.AnnotationProcessor");
- return (AbstractProcessor) mc.newInstance();
- } catch (Throwable t) {
- if (t instanceof Error) throw (Error) t;
- if (t instanceof RuntimeException) throw (RuntimeException) t;
- throw new RuntimeException(t);
+class AnnotationProcessorHider {
+ public static class AnnotationProcessor extends AbstractProcessor {
+ private final AbstractProcessor instance = createWrappedInstance();
+
+ @Override public Set<String> getSupportedOptions() {
+ return instance.getSupportedOptions();
+ }
+
+ @Override public Set<String> getSupportedAnnotationTypes() {
+ return instance.getSupportedAnnotationTypes();
+ }
+
+ @Override public SourceVersion getSupportedSourceVersion() {
+ return instance.getSupportedSourceVersion();
+ }
+
+ @Override public void init(ProcessingEnvironment processingEnv) {
+ instance.init(processingEnv);
+ super.init(processingEnv);
+ }
+
+ @Override public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
+ return instance.process(annotations, roundEnv);
+ }
+
+ @Override public Iterable<? extends Completion> getCompletions(Element element, AnnotationMirror annotation, ExecutableElement member, String userText) {
+ return instance.getCompletions(element, annotation, member, userText);
+ }
+
+ private static AbstractProcessor createWrappedInstance() {
+ ClassLoader cl = Main.createShadowClassLoader();
+ try {
+ Class<?> mc = cl.loadClass("lombok.core.AnnotationProcessor");
+ return (AbstractProcessor) mc.newInstance();
+ } catch (Throwable t) {
+ if (t instanceof Error) throw (Error) t;
+ if (t instanceof RuntimeException) throw (RuntimeException) t;
+ throw new RuntimeException(t);
+ }
}
}
}