From 08961edcfeef9b181621351e36bbc267f9395415 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Thu, 10 Oct 2013 20:41:29 +0200 Subject: Whoops, Classload errors running lombok on javac with backing JVM 7 or below; fixed. --- src/delombok/lombok/delombok/DocCommentIntegrator.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'src/delombok') 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) 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) { -- cgit