mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-15 00:17:45 +00:00
Made the annotation processor 'work' on java6 and java7 without any warnings
This commit is contained in:
1 parent
c8697f96af
commit
5bf3b5b5ec
2 files changed
+7
-7
No files matched your search
@@ -38,7 +38,6 @@ import javax.annotation.processing.ProcessingEnvironment;
|
||||
import javax.annotation.processing.Processor;
|
||||
import javax.annotation.processing.RoundEnvironment;
|
||||
import javax.annotation.processing.SupportedAnnotationTypes;
|
||||
import javax.annotation.processing.SupportedSourceVersion;
|
||||
import javax.lang.model.SourceVersion;
|
||||
import javax.lang.model.element.Element;
|
||||
import javax.lang.model.element.TypeElement;
|
||||
@@ -47,7 +46,6 @@ import javax.tools.Diagnostic.Kind;
|
||||
import lombok.patcher.inject.LiveInjector;
|
||||
|
||||
@SupportedAnnotationTypes("*")
|
||||
@SupportedSourceVersion(SourceVersion.RELEASE_6)
|
||||
public class AnnotationProcessor extends AbstractProcessor {
|
||||
private static String trace(Throwable t) {
|
||||
StringWriter w = new StringWriter();
|
||||
@@ -173,4 +171,11 @@ public class AnnotationProcessor extends AbstractProcessor {
|
||||
|
||||
return handled;
|
||||
}
|
||||
|
||||
/**
|
||||
* We just return the latest version of whatever JDK we run on. Stupid? Yeah, but it's either that or warnings on all versions but 1. Blame Joe.
|
||||
*/
|
||||
@Override public SourceVersion getSupportedSourceVersion() {
|
||||
return SourceVersion.values()[SourceVersion.values().length - 1];
|
||||
}
|
||||
}
|
||||
@@ -37,9 +37,6 @@ import javax.annotation.processing.AbstractProcessor;
|
||||
import javax.annotation.processing.Messager;
|
||||
import javax.annotation.processing.ProcessingEnvironment;
|
||||
import javax.annotation.processing.RoundEnvironment;
|
||||
import javax.annotation.processing.SupportedAnnotationTypes;
|
||||
import javax.annotation.processing.SupportedSourceVersion;
|
||||
import javax.lang.model.SourceVersion;
|
||||
import javax.lang.model.element.Element;
|
||||
import javax.lang.model.element.TypeElement;
|
||||
import javax.tools.Diagnostic.Kind;
|
||||
@@ -67,8 +64,6 @@ import com.sun.tools.javac.util.Context;
|
||||
* To actually enable lombok in a javac compilation run, this class should be in the classpath when
|
||||
* running javac; that's the only requirement.
|
||||
*/
|
||||
@SupportedAnnotationTypes("*")
|
||||
@SupportedSourceVersion(SourceVersion.RELEASE_6)
|
||||
public class Processor extends AbstractProcessor {
|
||||
|
||||
private JavacProcessingEnvironment processingEnv;
|
||||
|
||||
Reference in new issue
Block a user