diff options
Diffstat (limited to 'src/lombok/javac/apt')
-rw-r--r-- | src/lombok/javac/apt/Processor.java | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/lombok/javac/apt/Processor.java b/src/lombok/javac/apt/Processor.java index 0a5c2424..44edd917 100644 --- a/src/lombok/javac/apt/Processor.java +++ b/src/lombok/javac/apt/Processor.java @@ -147,16 +147,9 @@ public class Processor extends AbstractProcessor { } private JCCompilationUnit toUnit(Element element) { - TreePath path = trees.getPath(element); - if ( path != null ) return (JCCompilationUnit) path.getCompilationUnit(); - else { - if ( element == null ) { - processingEnv.getMessager().printMessage(Kind.WARNING, "LOMBOK DIAGNOSTIC: no TreePath returned for element, " + - "probably because element is null!"); - } - processingEnv.getMessager().printMessage(Kind.WARNING, "LOMBOK DIAGNOSTIC: no TreePath returned for element of type: " + - element.getClass() + "with toString: " + element); - return null; - } + TreePath path = trees == null ? null : trees.getPath(element); + if ( path == null ) return null; + + return (JCCompilationUnit) path.getCompilationUnit(); } } |