From adf30952462ad8380cf92c742e208b72c572cc98 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Thu, 4 Feb 2021 21:59:32 +0100 Subject: [issue #2730] Javadoc generated by lombok in javac now gets its position set. This may fix 'IllegalArgumentException' errors when using google errorprone. --- src/delombok/lombok/delombok/DocCommentIntegrator.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/delombok/lombok') diff --git a/src/delombok/lombok/delombok/DocCommentIntegrator.java b/src/delombok/lombok/delombok/DocCommentIntegrator.java index bab0abd8..e61968a5 100644 --- a/src/delombok/lombok/delombok/DocCommentIntegrator.java +++ b/src/delombok/lombok/delombok/DocCommentIntegrator.java @@ -89,7 +89,7 @@ public class DocCommentIntegrator { ((Map) map_).put(node, docCommentContent); return true; } else if (Javac.instanceOfDocCommentTable(map_)) { - CommentAttacher_8.attach(node, docCommentContent, map_); + CommentAttacher_8.attach(node, docCommentContent, cmt.pos, map_); return true; } @@ -98,7 +98,7 @@ public class DocCommentIntegrator { /* 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_) { + static void attach(final JCTree node, String docCommentContent, final int pos, Object map_) { final String docCommentContent_ = docCommentContent; ((DocCommentTable) map_).putComment(node, new Comment() { @Override public String getText() { @@ -106,7 +106,7 @@ public class DocCommentIntegrator { } @Override public int getSourcePos(int index) { - return -1; + return pos + index; } @Override public CommentStyle getStyle() { -- cgit