Source:
<code>private void checkNamingPattern(DetailAST blockCommentToken) { if (!BlockCommentPosition.isOnMethod(blockCommentToken)) { return; } DetailNode javadocNode = null; try { javadocNode = DetailNodeTreeStringPrinter.parseJavadocAsDetailNode(blockCommentToken); } catch (IllegalArgumentException ex) { } if (javadocNode == null) { return; } for (DetailNode node : javadocNode.getChildren()) { if (node.getType() != JavadocTokenTypes.JAVADOC_INLINE_TAG) { continue; } DetailNode customNameNode = JavadocUtil.findFirstToken(node, JavadocTokenTypes.CUSTOM_NAME); if (customNameNode == null || !CODE_SNIPPET_ANNOTATION.equals(customNameNode.getText())) { return; } DetailNode descriptionNode = JavadocUtil.findFirstToken(node, JavadocTokenTypes.DESCRIPTION); if (descriptionNode == null) { log(node.getLineNumber(), MISSING_CODESNIPPET_TAG_MESSAGE); return; } String description = JavadocUtil.findFirstToken(descriptionNode, JavadocTokenTypes.TEXT).getText(); DetailAST methodDefToken = methodDefStack.peek(); final String methodName = methodDefToken.findFirstToken(TokenTypes.IDENT).getText(); final String className = classNameStack.isEmpty() ? "" : classNameStack.peek(); final String parameters = constructParametersString(methodDefToken); String fullPath = packageName + "." + className + "." + methodName; if (parameters != null) { fullPath = fullPath + "#" + parameters; } <START> if (!description.equalsIgnoreCase(fullPath)) { <END> log(node.getLineNumber(), String.format("Naming pattern mismatch. The @codeSnippet description " + "''%s'' doesn't match ''%s''. Case Insensitive.", description, fullPath)); } } }</code><technical_language>Imagine following: java /** * Sample code one: * {@codesnippet com.azure.example.method} * * another example: * {@codesnippet com.azure.example.method-2} */ public void method() { ... }</technical_language>

Target:
private void checkNamingPattern(DetailAST blockCommentToken) { if (!BlockCommentPosition.isOnMethod(blockCommentToken)) { return; } DetailNode javadocNode = null; try { javadocNode = DetailNodeTreeStringPrinter.parseJavadocAsDetailNode(blockCommentToken); } catch (IllegalArgumentException ex) { } if (javadocNode == null) { return; } for (DetailNode node : javadocNode.getChildren()) { if (node.getType() != JavadocTokenTypes.JAVADOC_INLINE_TAG) { continue; } DetailNode customNameNode = JavadocUtil.findFirstToken(node, JavadocTokenTypes.CUSTOM_NAME); if (customNameNode == null || !CODE_SNIPPET_ANNOTATION.equals(customNameNode.getText())) { return; } DetailNode descriptionNode = JavadocUtil.findFirstToken(node, JavadocTokenTypes.DESCRIPTION); if (descriptionNode == null) { log(node.getLineNumber(), MISSING_CODESNIPPET_TAG_MESSAGE); return; } String customDescription = JavadocUtil.findFirstToken(descriptionNode, JavadocTokenTypes.TEXT).getText(); final String methodName = methodDefToken.findFirstToken(TokenTypes.IDENT).getText(); final String className = classNameStack.isEmpty() ? "" : classNameStack.peek(); final String parameters = constructParametersString(methodDefToken); String fullPath = packageName + "." + className + "." + methodName; final String fullPathWithoutParameters = fullPath; if (parameters != null) { fullPath = fullPath + "#" + parameters; } if (customDescription == null || customDescription.isEmpty() || !isNamingMatched(customDescription.toLowerCase(Locale.ROOT), fullPathWithoutParameters.toLowerCase(Locale.ROOT), parameters)) { log(node.getLineNumber(), String.format("Naming pattern mismatch. The @codesnippet description " + "''%s'' does not match ''%s''. Case Insensitive.", customDescription, fullPath)); } } }