1 package com.puppycrawl.tools.checkstyle.checks.j2ee; 20 21 import com.puppycrawl.tools.checkstyle.api.Check; 22 import com.puppycrawl.tools.checkstyle.api.DetailAST; 23 import com.puppycrawl.tools.checkstyle.api.TokenTypes; 24 25 32 public class FinalStaticCheck 33 extends Check 34 { 35 38 public int[] getDefaultTokens() 39 { 40 return new int[] {TokenTypes.VARIABLE_DEF}; 41 } 42 43 46 public int[] getRequiredTokens() 47 { 48 return getDefaultTokens(); 49 } 50 51 54 public void visitToken(DetailAST aAST) 55 { 56 if (Utils.isInEJB(aAST) 57 && Utils.isStatic(aAST) 58 && !Utils.isFinal(aAST)) 59 { 60 final DetailAST nameAST = aAST.findFirstToken(TokenTypes.IDENT); 61 log( 62 nameAST.getLineNo(), 63 nameAST.getColumnNo(), 64 "nonfinalstatic.bean", nameAST.getText()); 65 } 66 } 67 } 68 | Popular Tags |