aboutsummaryrefslogtreecommitdiff
path: root/src/delombok
diff options
context:
space:
mode:
authorReinier Zwitserloot <r.zwitserloot@projectlombok.org>2021-02-04 21:59:32 +0100
committerReinier Zwitserloot <r.zwitserloot@projectlombok.org>2021-02-04 21:59:32 +0100
commitadf30952462ad8380cf92c742e208b72c572cc98 (patch)
treed2550af00ec2b67ba2866a0b9bad7fc8be8eb58e /src/delombok
parent3d3a4c322af4cf7f27679661efaa9dcd685165bb (diff)
downloadlombok-adf30952462ad8380cf92c742e208b72c572cc98.tar.gz
lombok-adf30952462ad8380cf92c742e208b72c572cc98.tar.bz2
lombok-adf30952462ad8380cf92c742e208b72c572cc98.zip
[issue #2730] Javadoc generated by lombok in javac now gets its position set.
This may fix 'IllegalArgumentException' errors when using google errorprone.
Diffstat (limited to 'src/delombok')
-rw-r--r--src/delombok/lombok/delombok/DocCommentIntegrator.java6
1 files changed, 3 insertions, 3 deletions
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<JCTree, String>) 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() {