public void ensureCommentFromBodyDeclaration(SourcedEntity entity, BodyDeclaration node) { if (node.getJavadoc() != null) createBasicComment(entity, node.getJavadoc().toString()); else { // if there is no javadoc, we look for single line or multi line comments before // the node CompilationUnit root = (CompilationUnit) node.getRoot(); int firstLeadingCommentIndex = root.firstLeadingCommentIndex(node); if (firstLeadingCommentIndex >= 0) // There seems to be a problem here: JDT does not seem to provide the contents // of the comments. // Only the types (one line or multi line). createBasicComment(entity, root.getCommentList().get(firstLeadingCommentIndex).toString()); } }
if (typeDeclaration.getJavadoc() != null) typeLine = typeLine.substring(typeDeclaration.getJavadoc().toString().length());
String comment = null; if (doc != null) { comment = method.getJavadoc().toString();