diff options
author | Roel Spilker <r.spilker@gmail.com> | 2014-12-09 19:58:36 +0100 |
---|---|---|
committer | Roel Spilker <r.spilker@gmail.com> | 2014-12-09 19:58:36 +0100 |
commit | b56bdb1b0937fd83c8a2f7a4b7820c9493e56a21 (patch) | |
tree | 2389db67aa828b2b37f30e36f19fae99dc15fb33 /src | |
parent | 3765835181fd4f69c4b7032687e066ae9c10c500 (diff) | |
download | lombok-b56bdb1b0937fd83c8a2f7a4b7820c9493e56a21.tar.gz lombok-b56bdb1b0937fd83c8a2f7a4b7820c9493e56a21.tar.bz2 lombok-b56bdb1b0937fd83c8a2f7a4b7820c9493e56a21.zip |
Our quirky 'hider' trick, with a public class inside a package private class, doesn't work after all. Removed it and renamed the launching processor to _ShadowLaunchingAnnotationProcessor.
Diffstat (limited to 'src')
-rw-r--r-- | src/launch/lombok/launch/_ShadowLaunchingAnnotationProcessor.java (renamed from src/launch/lombok/launch/AnnotationProcessor.java) | 76 |
1 files changed, 37 insertions, 39 deletions
diff --git a/src/launch/lombok/launch/AnnotationProcessor.java b/src/launch/lombok/launch/_ShadowLaunchingAnnotationProcessor.java index 35c26b7c..36787ec9 100644 --- a/src/launch/lombok/launch/AnnotationProcessor.java +++ b/src/launch/lombok/launch/_ShadowLaunchingAnnotationProcessor.java @@ -33,45 +33,43 @@ import javax.lang.model.element.Element; import javax.lang.model.element.ExecutableElement; import javax.lang.model.element.TypeElement; -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); - } +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); } } } |