/** * This method checks whether the given component has a javadoc comment with a valid since tag. * * @param check * The current check. * @param ast * The component to check for the tag. * * @return true if and only if there is a since tag in the javadoc comment of the given component. */ public static boolean sinceTagAvailable(final AbstractCheck check, final DetailAST ast) { // Get the corresponding javadoc block final FileContents contents = check.getFileContents(); final TextBlock cmt = contents.getJavadocBefore(ast.getFirstChild().getLineNo()); // Make sure that there is a comment block available if (cmt != null) { // Now extract the tags final JavadocTags tags = JavadocUtils.getJavadocTags(cmt, JavadocTagType.ALL); // Run through the tags and find the potential since tag for (final JavadocTag tag : tags.getValidTags()) { if (SINCE_TAG_NAME.equals(tag.getTagName())) { return true; } } } return false; }