All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jp.skypencil.pmd.slf4j.DontPublishLogger Maven / Gradle / Ivy

There is a newer version: 0.4
Show newest version
package jp.skypencil.pmd.slf4j;

import net.sourceforge.pmd.ast.ASTClassOrInterfaceType;
import net.sourceforge.pmd.ast.ASTFieldDeclaration;

public final class DontPublishLogger extends AbstractSlf4jRule {
	@Override
	public Object visit(ASTFieldDeclaration node, Object data) {
		ASTClassOrInterfaceType field = node.getFirstChildOfType(ASTClassOrInterfaceType.class);
		if (field != null && !node.isPrivate() && fieldIsLogger(field)) {
			addViolation(data, node);
		}

		return super.visit(node, data);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy