aboutsummaryrefslogtreecommitdiff
path: root/src/delombok
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2013-12-04 07:14:56 +0100
committerReinier Zwitserloot <reinier@zwitserloot.com>2013-12-11 22:40:48 +0100
commit9ac86c8a234f2ecd280f27f0dbda15440b1bf155 (patch)
tree6a912c3f2f8cd38986ebff32c9ee467cd26d9d8b /src/delombok
parent7e21683515144cc6127eff007226c86021b7b2df (diff)
downloadlombok-9ac86c8a234f2ecd280f27f0dbda15440b1bf155.tar.gz
lombok-9ac86c8a234f2ecd280f27f0dbda15440b1bf155.tar.bz2
lombok-9ac86c8a234f2ecd280f27f0dbda15440b1bf155.zip
fixed a bug where called LombokOptionsFactory.getLombokOptions() would actually cause the old options to be wrapped continuously, thus wrapping LombokOptions into itself infinitely. Now it just wraps if needed, other wise returns what's already been done.
Diffstat (limited to 'src/delombok')
-rw-r--r--src/delombok/lombok/delombok/LombokOptionsFactory.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/delombok/lombok/delombok/LombokOptionsFactory.java b/src/delombok/lombok/delombok/LombokOptionsFactory.java
index e581593f..47921931 100644
--- a/src/delombok/lombok/delombok/LombokOptionsFactory.java
+++ b/src/delombok/lombok/delombok/LombokOptionsFactory.java
@@ -27,6 +27,7 @@ import lombok.javac.Javac8BasedLombokOptions;
import lombok.javac.LombokOptions;
import com.sun.tools.javac.util.Context;
+import com.sun.tools.javac.util.Options;
public class LombokOptionsFactory {
enum LombokOptionCompilerVersion {
@@ -46,6 +47,9 @@ public class LombokOptionsFactory {
}
public static LombokOptions getDelombokOptions(Context context) {
+ Options rawOptions = Options.instance(context);
+ if (rawOptions instanceof LombokOptions) return (LombokOptions) rawOptions;
+
LombokOptions options;
if (Javac.getJavaCompilerVersion() < 8) {
options = LombokOptionCompilerVersion.JDK7_AND_LOWER.createAndRegisterOptions(context);