aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/lombok')
-rw-r--r--src/core/lombok/core/Version.java2
-rw-r--r--src/core/lombok/javac/JavacNode.java4
-rw-r--r--src/core/lombok/javac/JavacTransformer.java6
-rw-r--r--src/core/lombok/javac/LombokOptions.java19
4 files changed, 19 insertions, 12 deletions
diff --git a/src/core/lombok/core/Version.java b/src/core/lombok/core/Version.java
index 5dcbf264..17b34f6b 100644
--- a/src/core/lombok/core/Version.java
+++ b/src/core/lombok/core/Version.java
@@ -28,7 +28,7 @@ public class Version {
// ** CAREFUL ** - this class must always compile with 0 dependencies (it must not refer to any other sources or libraries).
// Note: In 'X.Y.Z', if Z is odd, its a snapshot build built from the repository, so many different 0.10.3 versions can exist, for example.
// Official builds always end in an even number. (Since 0.10.2).
- private static final String VERSION = "0.10.3";
+ private static final String VERSION = "0.10.5";
private static final String RELEASE_NAME = "Burning Emu";
private Version() {
diff --git a/src/core/lombok/javac/JavacNode.java b/src/core/lombok/javac/JavacNode.java
index 5b4782e8..b478781b 100644
--- a/src/core/lombok/javac/JavacNode.java
+++ b/src/core/lombok/javac/JavacNode.java
@@ -39,7 +39,6 @@ import com.sun.tools.javac.tree.JCTree.JCMethodDecl;
import com.sun.tools.javac.tree.JCTree.JCVariableDecl;
import com.sun.tools.javac.util.Context;
import com.sun.tools.javac.util.Name;
-import com.sun.tools.javac.util.Options;
import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition;
/**
@@ -198,8 +197,7 @@ public class JavacNode extends lombok.core.LombokNode<JavacAST, JavacNode, JCTre
}
public boolean shouldDeleteLombokAnnotations() {
- Options options = ast.getContext().get(Options.optionsKey);
- return options instanceof LombokOptions && ((LombokOptions)options).deleteLombokAnnotations;
+ return LombokOptions.shouldDeleteLombokAnnotations(ast.getContext());
}
/**
diff --git a/src/core/lombok/javac/JavacTransformer.java b/src/core/lombok/javac/JavacTransformer.java
index f8a738a2..3afdee0a 100644
--- a/src/core/lombok/javac/JavacTransformer.java
+++ b/src/core/lombok/javac/JavacTransformer.java
@@ -33,7 +33,6 @@ import com.sun.tools.javac.tree.JCTree.JCMethodDecl;
import com.sun.tools.javac.tree.JCTree.JCVariableDecl;
import com.sun.tools.javac.util.Context;
import com.sun.tools.javac.util.List;
-import com.sun.tools.javac.util.Options;
public class JavacTransformer {
private final HandlerLibrary handlers;
@@ -80,10 +79,7 @@ public class JavacTransformer {
}
}
- Options options = context.get(Options.optionsKey);
- if (options instanceof LombokOptions) for (JavacAST ast : asts) {
- if (ast.isChanged()) ((LombokOptions)options).changed.add((JCCompilationUnit) ast.top().get());
- }
+ for (JavacAST ast : asts) if (ast.isChanged()) LombokOptions.markChanged(context, (JCCompilationUnit) ast.top().get());
}
private class AnnotationVisitor extends JavacASTAdapter {
diff --git a/src/core/lombok/javac/LombokOptions.java b/src/core/lombok/javac/LombokOptions.java
index c0c92df8..1a73a8cc 100644
--- a/src/core/lombok/javac/LombokOptions.java
+++ b/src/core/lombok/javac/LombokOptions.java
@@ -29,10 +29,9 @@ import com.sun.tools.javac.util.Context;
import com.sun.tools.javac.util.Options;
public class LombokOptions extends Options {
+ private boolean deleteLombokAnnotations = true;
+ private final Set<JCCompilationUnit> changed = new HashSet<JCCompilationUnit>();
- public boolean deleteLombokAnnotations = true;
- public final Set<JCCompilationUnit> changed = new HashSet<JCCompilationUnit>();
-
public static LombokOptions replaceWithDelombokOptions(Context context) {
Options options = Options.instance(context);
context.put(optionsKey, (Options)null);
@@ -41,6 +40,20 @@ public class LombokOptions extends Options {
return result;
}
+ public boolean isChanged(JCCompilationUnit ast) {
+ return changed.contains(ast);
+ }
+
+ public static void markChanged(Context context, JCCompilationUnit ast) {
+ Options options = context.get(Options.optionsKey);
+ if (options instanceof LombokOptions) ((LombokOptions) options).changed.add(ast);
+ }
+
+ public static boolean shouldDeleteLombokAnnotations(Context context) {
+ Options options = context.get(Options.optionsKey);
+ return (options instanceof LombokOptions) && ((LombokOptions) options).deleteLombokAnnotations;
+ }
+
private LombokOptions(Context context) {
super(context);
}