diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2013-12-04 07:14:56 +0100 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2013-12-11 22:40:48 +0100 |
commit | 9ac86c8a234f2ecd280f27f0dbda15440b1bf155 (patch) | |
tree | 6a912c3f2f8cd38986ebff32c9ee467cd26d9d8b /src/delombok | |
parent | 7e21683515144cc6127eff007226c86021b7b2df (diff) | |
download | lombok-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.java | 4 |
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); |