aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpeichhorn <peichhor@web.de>2011-08-10 11:40:46 +0200
committerpeichhorn <peichhor@web.de>2011-08-10 11:42:15 +0200
commitc996e8749db4cf049401e961dba1b72ea5d1b85d (patch)
treeee9e01322f14ec880216febeecf58aab8115200c
parent5bf3b5b5ece4321b0f9c4573a2863d4cc427e476 (diff)
downloadlombok-c996e8749db4cf049401e961dba1b72ea5d1b85d.tar.gz
lombok-c996e8749db4cf049401e961dba1b72ea5d1b85d.tar.bz2
lombok-c996e8749db4cf049401e961dba1b72ea5d1b85d.zip
Made delomboks processor 'work' on java6 and java7 without any warnings
-rw-r--r--src/core/lombok/javac/apt/Processor.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/core/lombok/javac/apt/Processor.java b/src/core/lombok/javac/apt/Processor.java
index 99170be1..955cb3d0 100644
--- a/src/core/lombok/javac/apt/Processor.java
+++ b/src/core/lombok/javac/apt/Processor.java
@@ -37,6 +37,8 @@ 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.lang.model.SourceVersion;
import javax.lang.model.element.Element;
import javax.lang.model.element.TypeElement;
import javax.tools.Diagnostic.Kind;
@@ -64,6 +66,7 @@ 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("*")
public class Processor extends AbstractProcessor {
private JavacProcessingEnvironment processingEnv;
@@ -248,4 +251,11 @@ public class Processor extends AbstractProcessor {
return (JCCompilationUnit) path.getCompilationUnit();
}
+
+ /**
+ * 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.
+ */
+ @Override public SourceVersion getSupportedSourceVersion() {
+ return SourceVersion.values()[SourceVersion.values().length - 1];
+ }
}