New LogMessageExtractorCheck which writes out TXT report of all loggers
[yangtools.git] / common / checkstyle-logging / src / main / java / org / opendaylight / yangtools / checkstyle / CheckLoggingUtil.java
index e8f86bffb8652565b98544aa1832d429aec98e80..e5e079d88b6b4c73d67239b1998f269b60d6eadb 100644 (file)
@@ -47,6 +47,13 @@ public final class CheckLoggingUtil {
         return ast.getParent().getType() == TokenTypes.OBJBLOCK;
     }
 
+    /**
+     * Returns the name the method (and the enclosing class) at a given point specified by the
+     * passed-in abstract syntax tree (AST).
+     *
+     * @param ast an abstract syntax tree (AST) pointing to method call
+     * @return the name of the method being called
+     */
     public static String getMethodName(final DetailAST ast) {
         if (ast.getFirstChild().getLastChild() != null) {
             return ast.getFirstChild().getFirstChild().getText() + "." + ast.getFirstChild().getLastChild().getText();
@@ -58,6 +65,13 @@ public final class CheckLoggingUtil {
         return LOG_METHODS.contains(methodName);
     }
 
+    /**
+     * Returns the name of the closest enclosing class of the point by the passed-in abstract syntax
+     * tree (AST).
+     *
+     * @param ast an abstract syntax tree (AST)
+     * @return the name of the closest enclosign class
+     */
     public static String getClassName(final DetailAST ast) {
         DetailAST parent = ast.getParent();
         while (parent.getType() != TokenTypes.CLASS_DEF && parent.getType() != TokenTypes.ENUM_DEF) {