aboutsummaryrefslogtreecommitdiff
path: root/src/delombok/lombok
diff options
context:
space:
mode:
Diffstat (limited to 'src/delombok/lombok')
-rw-r--r--src/delombok/lombok/delombok/DocCommentIntegrator.java15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/delombok/lombok/delombok/DocCommentIntegrator.java b/src/delombok/lombok/delombok/DocCommentIntegrator.java
index c1eb02b6..0955a003 100644
--- a/src/delombok/lombok/delombok/DocCommentIntegrator.java
+++ b/src/delombok/lombok/delombok/DocCommentIntegrator.java
@@ -66,7 +66,17 @@ public class DocCommentIntegrator {
if (map_ instanceof Map) {
((Map<JCTree, String>) map_).put(node, docCommentContent);
return true;
- } else if (map_ instanceof DocCommentTable) {
+ } else if (Javac.instanceOfDocCommentTable(map_)) {
+ CommentAttacher_8.attach(node, docCommentContent, map_);
+ return true;
+ }
+
+ return false;
+ }
+
+ /* Container for code which will cause class loader exceptions on javac below 8. By being in a separate class, we avoid the problem. */
+ private static class CommentAttacher_8 {
+ static void attach(final JCTree node, String docCommentContent, Object map_) {
final String docCommentContent_ = docCommentContent;
((DocCommentTable) map_).putComment(node, new Comment() {
@Override public String getText() {
@@ -85,10 +95,7 @@ public class DocCommentIntegrator {
return JavacHandlerUtil.nodeHasDeprecatedFlag(node);
}
});
- return true;
}
-
- return false;
}
private JCTree findJavadocableNodeOnOrAfter(JCCompilationUnit unit, int endPos) {