diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2013-07-26 07:15:07 +0200 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2013-07-26 07:15:07 +0200 |
commit | e2af5ed0c7786e01bec861f21f2e5ec3bc5ea33f (patch) | |
tree | 185a11286fe88fa32b9f2ad64cd1d96e9acf17c5 /src/core/lombok/javac/handlers/HandleSneakyThrows.java | |
parent | 1b4d8669c48af215c38a73f6dfd15741619a1c45 (diff) | |
download | lombok-e2af5ed0c7786e01bec861f21f2e5ec3bc5ea33f.tar.gz lombok-e2af5ed0c7786e01bec861f21f2e5ec3bc5ea33f.tar.bz2 lombok-e2af5ed0c7786e01bec861f21f2e5ec3bc5ea33f.zip |
experiment: Can we wrap TreeMaker and remove a heck of a lot of opportunity to program handlers that are not cross javac6-8 compatible?
Diffstat (limited to 'src/core/lombok/javac/handlers/HandleSneakyThrows.java')
-rw-r--r-- | src/core/lombok/javac/handlers/HandleSneakyThrows.java | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/core/lombok/javac/handlers/HandleSneakyThrows.java b/src/core/lombok/javac/handlers/HandleSneakyThrows.java index 8172cf35..69d2b45d 100644 --- a/src/core/lombok/javac/handlers/HandleSneakyThrows.java +++ b/src/core/lombok/javac/handlers/HandleSneakyThrows.java @@ -29,15 +29,14 @@ import java.util.Collections; import lombok.SneakyThrows; import lombok.core.AnnotationValues; -import lombok.javac.Javac; import lombok.javac.JavacAnnotationHandler; import lombok.javac.JavacNode; +import lombok.javac.JavacTreeMaker; import org.mangosdk.spi.ProviderFor; import com.sun.tools.javac.code.Flags; import com.sun.tools.javac.tree.JCTree; -import com.sun.tools.javac.tree.TreeMaker; import com.sun.tools.javac.tree.JCTree.JCAnnotation; import com.sun.tools.javac.tree.JCTree.JCBlock; import com.sun.tools.javac.tree.JCTree.JCExpression; @@ -114,7 +113,7 @@ public class HandleSneakyThrows extends JavacAnnotationHandler<SneakyThrows> { } private JCStatement buildTryCatchBlock(JavacNode node, List<JCStatement> contents, String exception, JCTree source) { - TreeMaker maker = node.getTreeMaker(); + JavacTreeMaker maker = node.getTreeMaker(); JCBlock tryBlock = setGeneratedBy(maker.Block(0, contents), source); @@ -122,7 +121,7 @@ public class HandleSneakyThrows extends JavacAnnotationHandler<SneakyThrows> { JCVariableDecl catchParam = maker.VarDef(maker.Modifiers(Flags.FINAL), node.toName("$ex"), varType, null); JCExpression lombokLombokSneakyThrowNameRef = chainDots(node, "lombok", "Lombok", "sneakyThrow"); - JCBlock catchBody = maker.Block(0, List.<JCStatement>of(Javac.makeThrow(maker, maker.Apply( + JCBlock catchBody = maker.Block(0, List.<JCStatement>of(maker.Throw(maker.Apply( List.<JCExpression>nil(), lombokLombokSneakyThrowNameRef, List.<JCExpression>of(maker.Ident(node.toName("$ex"))))))); |