private void attachJavadocToNode(CommentInfo javadoc, JavadocContainer node) {
String content = javadoc.content;
if (content.startsWith("/*") && content.endsWith("*/")) content = content.substring(2, content.length() - 2);
Comment comment = new Comment().astBlockComment(true).astContent(content);
comment.setPosition(new Position(javadoc.pos, javadoc.endPos));
node.astJavadoc(comment);
if (!node.getPosition().isUnplaced()) {
int oldStart = node.getPosition().getStart();
if (oldStart == -1 || comment.getPosition().getStart() < oldStart) {
node.setPosition(new Position(comment.getPosition().getStart(), node.getPosition().getEnd()));
}
}
}