mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-13 06:15:41 +00:00
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.
This commit is contained in:
1 parent
7e21683515
commit
9ac86c8a23
1 file changed
+4
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user