Checkstyle fixes
This commit is contained in:

committed by
Andreas Dangel

parent
1fb05d995f
commit
b4d05e5f14
@ -36,8 +36,8 @@ public class UnusedModifierRule extends AbstractJavaRule {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Node parent = node.jjtGetParent().jjtGetParent().jjtGetParent();
|
Node parent = node.jjtGetParent().jjtGetParent().jjtGetParent();
|
||||||
boolean isParentInterfaceOrAnnotation = parent instanceof ASTAnnotationTypeDeclaration ||
|
boolean isParentInterfaceOrAnnotation = parent instanceof ASTAnnotationTypeDeclaration
|
||||||
parent instanceof ASTClassOrInterfaceDeclaration && ((ASTClassOrInterfaceDeclaration) parent).isInterface();
|
|| parent instanceof ASTClassOrInterfaceDeclaration && ((ASTClassOrInterfaceDeclaration) parent).isInterface();
|
||||||
|
|
||||||
// a public annotation within an interface or annotation
|
// a public annotation within an interface or annotation
|
||||||
if (node.isPublic() && isParentInterfaceOrAnnotation) {
|
if (node.isPublic() && isParentInterfaceOrAnnotation) {
|
||||||
@ -63,8 +63,8 @@ public class UnusedModifierRule extends AbstractJavaRule {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Node parent = node.jjtGetParent().jjtGetParent().jjtGetParent();
|
Node parent = node.jjtGetParent().jjtGetParent().jjtGetParent();
|
||||||
boolean isParentInterfaceOrAnnotation = parent instanceof ASTAnnotationTypeDeclaration ||
|
boolean isParentInterfaceOrAnnotation = parent instanceof ASTAnnotationTypeDeclaration
|
||||||
parent instanceof ASTClassOrInterfaceDeclaration && ((ASTClassOrInterfaceDeclaration) parent).isInterface();
|
|| parent instanceof ASTClassOrInterfaceDeclaration && ((ASTClassOrInterfaceDeclaration) parent).isInterface();
|
||||||
|
|
||||||
// a public interface within an interface or annotation
|
// a public interface within an interface or annotation
|
||||||
if (node.isInterface() && node.isPublic() && isParentInterfaceOrAnnotation) {
|
if (node.isInterface() && node.isPublic() && isParentInterfaceOrAnnotation) {
|
||||||
@ -109,8 +109,8 @@ public class UnusedModifierRule extends AbstractJavaRule {
|
|||||||
// third ancestor could be an AllocationExpression
|
// third ancestor could be an AllocationExpression
|
||||||
// if this is a method in an anonymous inner class
|
// if this is a method in an anonymous inner class
|
||||||
Node parent = fieldOrMethod.jjtGetParent().jjtGetParent().jjtGetParent();
|
Node parent = fieldOrMethod.jjtGetParent().jjtGetParent().jjtGetParent();
|
||||||
if (parent instanceof ASTAnnotationTypeDeclaration ||
|
if (parent instanceof ASTAnnotationTypeDeclaration
|
||||||
parent instanceof ASTClassOrInterfaceDeclaration
|
|| parent instanceof ASTClassOrInterfaceDeclaration
|
||||||
&& ((ASTClassOrInterfaceDeclaration) parent).isInterface()) {
|
&& ((ASTClassOrInterfaceDeclaration) parent).isInterface()) {
|
||||||
addViolation(data, fieldOrMethod);
|
addViolation(data, fieldOrMethod);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user