diff --git a/src/checkstyle/com/puppycrawl/tools/checkstyle/Verifier.java b/src/checkstyle/com/puppycrawl/tools/checkstyle/Verifier.java index 1659a72f6..5b84054ed 100644 --- a/src/checkstyle/com/puppycrawl/tools/checkstyle/Verifier.java +++ b/src/checkstyle/com/puppycrawl/tools/checkstyle/Verifier.java @@ -170,4 +170,10 @@ interface Verifier * constructor. **/ void reportEndMethodBlock(); + + /** + * Report the location of a reference to an identifier + * @param aAST details of the identifier + */ + void reportIdentifier(MyCommonAST aAST); } diff --git a/src/checkstyle/com/puppycrawl/tools/checkstyle/VerifierImpl.java b/src/checkstyle/com/puppycrawl/tools/checkstyle/VerifierImpl.java index e06d21d53..60a60466c 100644 --- a/src/checkstyle/com/puppycrawl/tools/checkstyle/VerifierImpl.java +++ b/src/checkstyle/com/puppycrawl/tools/checkstyle/VerifierImpl.java @@ -39,6 +39,7 @@ import org.apache.regexp.RESyntaxException; class VerifierImpl implements Verifier { + // {{{ Data declarations /** the pattern to match Javadoc tags that take an argument **/ private static final String MATCH_JAVADOC_ARG_PAT = "@(throws|exception|param)\\s+(\\S+)\\s+\\S"; @@ -92,6 +93,9 @@ class VerifierImpl /** configuration for checking **/ private final Configuration mConfig; + // }}} + + // {{{ Constructors //////////////////////////////////////////////////////////////////////////// // Constructor methods //////////////////////////////////////////////////////////////////////////// @@ -105,6 +109,9 @@ class VerifierImpl mConfig = aConfig; } + // }}} + + // {{{ Interface verifier methods //////////////////////////////////////////////////////////////////////////// // Interface Verifier methods //////////////////////////////////////////////////////////////////////////// @@ -256,6 +263,12 @@ class VerifierImpl } else { final MyModifierSet mods = aVar.getModifierSet(); + + if (mods.containsPrivate()) { + System.out.println("Need to check for " + aVar.getText()); + } + + // Checks for Javadoc if (mods.containsStatic()) { if (mods.containsFinal()) { // Handle the serialVersionUID constant which is used for @@ -464,7 +477,15 @@ class VerifierImpl mMethodBlockLevel--; } + /** @see Verifier **/ + public void reportIdentifier(MyCommonAST aAST) + { + //System.out.println("Just got reported = " + aAST); + } + // }}} + + // {{{ Private methods //////////////////////////////////////////////////////////////////////////// // Private methods //////////////////////////////////////////////////////////////////////////// @@ -798,4 +819,6 @@ class VerifierImpl } return retVal; } + + // }}} } diff --git a/src/checkstyle/com/puppycrawl/tools/checkstyle/java.tree.g b/src/checkstyle/com/puppycrawl/tools/checkstyle/java.tree.g index 51a395cda..f600e3e5e 100644 --- a/src/checkstyle/com/puppycrawl/tools/checkstyle/java.tree.g +++ b/src/checkstyle/com/puppycrawl/tools/checkstyle/java.tree.g @@ -420,7 +420,7 @@ expr ; primaryExpression - : i1:IDENT { firstExprIdent = i1;} + : IDENT { firstExprIdent = #IDENT; ver.reportIdentifier(#IDENT); } | #( DOT (expr (i2:IDENT { firstExprIdent = null;}