Source:
<code>public Object visit(ASTClassOrInterfaceDeclaration node, Object data) { if (node.isInterface()) { return data; } boolean classHasLombok = hasLombokAnnotation(node); Map<MethodNameDeclaration, List<NameOccurrence>> methods = node.getScope().getEnclosingScope(ClassScope.class) .getMethodDeclarations(); List<ASTMethodDeclarator> getSetMethList = new ArrayList<>(methods.size()); for (MethodNameDeclaration d : methods.keySet()) { ASTMethodDeclarator mnd = d.getMethodNameDeclaratorNode(); if (isBeanAccessor(mnd)) { getSetMethList.add(mnd); } } String[] methNameArray = imagesOf(getSetMethList); Arrays.sort(methNameArray); Map<VariableNameDeclaration, List<NameOccurrence>> vars = node.getScope() .getDeclarations(VariableNameDeclaration.class); for (Map.Entry<VariableNameDeclaration, List<NameOccurrence>> entry : vars.entrySet()) { VariableNameDeclaration decl = entry.getKey(); AccessNode accessNodeParent = decl.getAccessNodeParent(); if (entry.getValue().isEmpty() || accessNodeParent.isTransient() || accessNodeParent.isStatic() <START> || classHasLombok || hasIgnoredAnnotation((Annotatable) accessNodeParent)) { <END> continue; } String varName = StringUtils.capitalize(trimIfPrefix(decl.getImage())); boolean hasGetMethod = Arrays.binarySearch(methNameArray, "get" + varName) >= 0 || Arrays.binarySearch(methNameArray, "is" + varName) >= 0; boolean hasSetMethod = Arrays.binarySearch(methNameArray, "set" + varName) >= 0; if (!hasGetMethod || !accessNodeParent.isFinal() && !hasSetMethod) { addViolation(data, decl.getNode(), decl.getImage()); } } return super.visit(node, data); }</code><technical_language>checking for variable if class is skipped due lombok annotations, in line 66 do: java if (hasLombokAnnotation(node)) { return super.visit(node, data); }</technical_language>

Target:
public Object visit(ASTClassOrInterfaceDeclaration node, Object data) { if (node.isInterface()) { return data; } if (hasLombokAnnotation(node)) { return super.visit(node, data); } Map<MethodNameDeclaration, List<NameOccurrence>> methods = node.getScope().getEnclosingScope(ClassScope.class) .getMethodDeclarations(); List<ASTMethodDeclarator> getSetMethList = new ArrayList<>(methods.size()); for (MethodNameDeclaration d : methods.keySet()) { ASTMethodDeclarator mnd = d.getMethodNameDeclaratorNode(); if (isBeanAccessor(mnd)) { getSetMethList.add(mnd); } } String[] methNameArray = imagesOf(getSetMethList); Arrays.sort(methNameArray); Map<VariableNameDeclaration, List<NameOccurrence>> vars = node.getScope() .getDeclarations(VariableNameDeclaration.class); for (Map.Entry<VariableNameDeclaration, List<NameOccurrence>> entry : vars.entrySet()) { VariableNameDeclaration decl = entry.getKey(); AccessNode accessNodeParent = decl.getAccessNodeParent(); if (entry.getValue().isEmpty() || accessNodeParent.isTransient() || accessNodeParent.isStatic() || hasIgnoredAnnotation((Annotatable) accessNodeParent)) { continue; } String varName = StringUtils.capitalize(trimIfPrefix(decl.getImage())); boolean hasGetMethod = Arrays.binarySearch(methNameArray, "get" + varName) >= 0 || Arrays.binarySearch(methNameArray, "is" + varName) >= 0; boolean hasSetMethod = Arrays.binarySearch(methNameArray, "set" + varName) >= 0; if (!hasGetMethod || !accessNodeParent.isFinal() && !hasSetMethod) { addViolation(data, decl.getNode(), decl.getImage()); } } return super.visit(node, data); }