<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>2.0.5</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>bundle-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
<groupId>org.opendaylight.yangtools</groupId>
import java.util.Optional;
public abstract class AbstractLogMessageCheck extends AbstractCheck {
+ private static final int[] TOKENS = { TokenTypes.METHOD_CALL };
@Override
public int[] getDefaultTokens() {
- return new int[]{TokenTypes.METHOD_CALL};
+ return TOKENS;
+ }
+
+ @Override
+ public int[] getAcceptableTokens() {
+ return TOKENS;
+ }
+
+ @Override
+ public int[] getRequiredTokens() {
+ return TOKENS;
}
@Override
public class LogMessageConcatenationCheck extends AbstractCheck {
private static final String LOG_MESSAGE = "Log message contains string concatenation.";
+ private static final int[] TOKENS = { TokenTypes.METHOD_CALL };
@Override
public int[] getDefaultTokens() {
- return new int[]{TokenTypes.METHOD_CALL};
+ return TOKENS;
+ }
+
+ @Override
+ public int[] getAcceptableTokens() {
+ return TOKENS;
+ }
+
+ @Override
+ public int[] getRequiredTokens() {
+ return TOKENS;
}
@Override
public class LoggerDeclarationsCountCheck extends AbstractCheck {
private static final String LOG_MESSAGE = "Logger might be declared only once.";
+ private static final int[] TOKENS = { TokenTypes.VARIABLE_DEF };
+
private String prevClassName = "";
@Override
public int[] getDefaultTokens() {
- return new int[]{TokenTypes.VARIABLE_DEF};
+ return TOKENS;
+ }
+
+ @Override
+ public int[] getAcceptableTokens() {
+ return TOKENS;
}
@Override
- public void visitToken(DetailAST ast) {
+ public int[] getRequiredTokens() {
+ return TOKENS;
+ }
+
+ @Override
+ public void visitToken(final DetailAST ast) {
if (CheckLoggingUtil.isLoggerType(ast) && isAFieldVariable(ast)) {
final String className = CheckLoggingUtil.getClassName(ast);
if (this.prevClassName.equals(className)) {
}
@Override
- public void finishTree(DetailAST rootAST) {
+ public void finishTree(final DetailAST rootAST) {
super.finishTree(rootAST);
this.prevClassName = "";
}
-
}
private static final String LOG_MESSAGE = "LoggerFactory.getLogger Class argument is incorrect.";
private static final String METHOD_NAME = "LoggerFactory.getLogger";
+ private static final int[] TOKENS = { TokenTypes.METHOD_CALL };
@Override
public int[] getDefaultTokens() {
- return new int[] { TokenTypes.METHOD_CALL };
+ return TOKENS;
+ }
+
+ @Override
+ public int[] getAcceptableTokens() {
+ return TOKENS;
+ }
+
+ @Override
+ public int[] getRequiredTokens() {
+ return TOKENS;
}
@Override
private static final String LOG_MESSAGE = "Logger must be slf4j.";
private static final String SLF4J = "slf4j";
+ private static final int[] TOKENS = { TokenTypes.VARIABLE_DEF, TokenTypes.IMPORT };
@Override
public int[] getDefaultTokens() {
- return new int[]{TokenTypes.VARIABLE_DEF, TokenTypes.IMPORT};
+ return TOKENS;
}
@Override
- public void visitToken(DetailAST ast) {
+ public int[] getAcceptableTokens() {
+ return TOKENS;
+ }
+
+ @Override
+ public int[] getRequiredTokens() {
+ return TOKENS;
+ }
+
+ @Override
+ public void visitToken(final DetailAST ast) {
if (ast.getType() == TokenTypes.VARIABLE_DEF) {
if (CheckLoggingUtil.isAFieldVariable(ast)) {
final String typeName = CheckLoggingUtil.getTypeName(ast);
public class LoggerVariableModifiersCheck extends AbstractCheck {
private static final String LOG_MESSAGE = "Logger must be declared as private static final.";
+ private static final int[] TOKENS = { TokenTypes.VARIABLE_DEF };
@Override
public int[] getDefaultTokens() {
- return new int[]{TokenTypes.VARIABLE_DEF};
+ return TOKENS;
+ }
+
+ @Override
+ public int[] getAcceptableTokens() {
+ return TOKENS;
+ }
+
+ @Override
+ public int[] getRequiredTokens() {
+ return TOKENS;
}
@Override
public class LoggerVariableNameCheck extends AbstractCheck {
private static final String LOG_MESSAGE = "Logger name should be LOG.";
+ private static final int[] TOKENS = { TokenTypes.VARIABLE_DEF };
@Override
public int[] getDefaultTokens() {
- return new int[]{TokenTypes.VARIABLE_DEF};
+ return TOKENS;
+ }
+
+ @Override
+ public int[] getAcceptableTokens() {
+ return TOKENS;
+ }
+
+ @Override
+ public int[] getRequiredTokens() {
+ return TOKENS;
}
@Override
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>bundle-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>bundle-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
<packaging>bundle</packaging>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>bundle-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>bundle-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
<packaging>bundle</packaging>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>2.0.5</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>bundle-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>bundle-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
<packaging>bundle</packaging>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>feature-repo-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>feature-repo-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
<dependencies>
<dependency>
<groupId>org.opendaylight.odlparent</groupId>
- <artifactId>odl-guava-22</artifactId>
- <version>2.0.5</version>
+ <artifactId>odl-guava-23</artifactId>
+ <version>3.0.0-SNAPSHOT</version>
<type>xml</type>
<classifier>features</classifier>
</dependency>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>2.0.5</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>2.0.5</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>2.0.5</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>bundle-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>bundle-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>bundle-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>bundle-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>bundle-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>2.0.5</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>bundle-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>bundle-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>bundle-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>bundle-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>bundle-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>bundle-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>bundle-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>bundle-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>bundle-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>bundle-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>bundle-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>bundle-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
<artifactId>maven-verifier</artifactId>
<version>1.6</version>
<scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>com.google.code.findbugs</groupId>
+ <!-- Use com.google.code.findbugs:annotations instead of jsr305 -->
+ <artifactId>jsr305</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>bundle-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>bundle-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>bundle-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>bundle-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>bundle-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath />
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>bundle-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>bundle-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>bundle-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>bundle-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>bundle-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>bundle-parent</artifactId>
- <version>2.0.5</version>
+ <version>3.0.0-SNAPSHOT</version>
<relativePath/>
</parent>