aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok/javac
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/lombok/javac')
-rw-r--r--src/core/lombok/javac/JavacAST.java7
-rw-r--r--src/core/lombok/javac/JavacTransformer.java11
2 files changed, 14 insertions, 4 deletions
diff --git a/src/core/lombok/javac/JavacAST.java b/src/core/lombok/javac/JavacAST.java
index 4ca2c050..091612cc 100644
--- a/src/core/lombok/javac/JavacAST.java
+++ b/src/core/lombok/javac/JavacAST.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009-2017 The Project Lombok Authors.
+ * Copyright (C) 2009-2018 The Project Lombok Authors.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -93,8 +93,11 @@ public class JavacAST extends AST<JavacAST, JavacNode, JCTree> {
}
@Override public URI getAbsoluteFileLocation() {
+ return getAbsoluteFileLocation((JCCompilationUnit) top().get());
+ }
+
+ public static URI getAbsoluteFileLocation(JCCompilationUnit cu) {
try {
- JCCompilationUnit cu = (JCCompilationUnit) top().get();
return cu.sourcefile.toUri();
} catch (Exception e) {
return null;
diff --git a/src/core/lombok/javac/JavacTransformer.java b/src/core/lombok/javac/JavacTransformer.java
index 54977a59..2e37b32b 100644
--- a/src/core/lombok/javac/JavacTransformer.java
+++ b/src/core/lombok/javac/JavacTransformer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009-2017 The Project Lombok Authors.
+ * Copyright (C) 2009-2018 The Project Lombok Authors.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -35,6 +35,9 @@ import com.sun.tools.javac.tree.JCTree.JCVariableDecl;
import com.sun.tools.javac.util.Context;
import com.sun.tools.javac.util.List;
+import lombok.ConfigurationKeys;
+import lombok.core.LombokConfiguration;
+
public class JavacTransformer {
private final HandlerLibrary handlers;
private final Messager messager;
@@ -65,7 +68,11 @@ public class JavacTransformer {
java.util.List<JavacAST> asts = new ArrayList<JavacAST>();
- for (JCCompilationUnit unit : compilationUnits) asts.add(new JavacAST(messager, context, unit));
+ for (JCCompilationUnit unit : compilationUnits) {
+ if (!Boolean.TRUE.equals(LombokConfiguration.read(ConfigurationKeys.LOMBOK_DISABLE, JavacAST.getAbsoluteFileLocation(unit)))) {
+ asts.add(new JavacAST(messager, context, unit));
+ }
+ }
for (JavacAST ast : asts) {
ast.traverse(new AnnotationVisitor(priority));