admin管理员组

文章数量:1399925

I am using OpenRewrite 8.48 and want to add @author to the Javadoc of methods that don't yet have that. Only thing I was able to achieve so far is to add a text comment like so:

TextComment textComment = new TextComment(true, "foobar",methodDeclaration.getPrefix().getWhitespace(), Markers.EMPTY);
return methodDeclaration.withComments(ListUtils.concat(md.getComments(), textComment));

Now, there is Javadoc.Author but that requires a list of Javadoc instances which I don't have since I can't initialize any... For this reason Author author = new Author(UUID.randomUUID(), Markers.EMPTY, ???); fails. The documentation only lists examples of removing Javadoc which does not help here.

So, how do I add something to the Javadoc? Also, in this case where would I even put the actual author info?

本文标签: javaHow to add author to the Javadoc with OpenRewriteStack Overflow