#fixed code
                              @Override
  public void visitClassDeclaration(ClassDeclarationTree tree) {
    stringLiterals.clear();
    super.visitClassDeclaration(tree);

    if (tree.is(Tree.Kind.CLASS_DECLARATION)) {
      checkClass(tree);
    }
  }
#vulnerable code 
                              @Override
  public void visitClassDeclaration(ClassDeclarationTree tree) {
    stringLiterals.clear();
    super.visitClassDeclaration(tree);

    if (tree.is(Tree.Kind.CLASS_DECLARATION)) {
      Scope classScope = context().symbolTable().getScopeFor(tree);
      for (Symbol methodSymbol : classScope.getSymbols(Kind.FUNCTION)) {

        boolean ruleConditions = methodSymbol.hasModifier("private") && methodSymbol.usages().isEmpty();

        if (ruleConditions
          && !isConstructor(methodSymbol.declaration(), tree)
          && !isMagicMethod(methodSymbol.name())
          && !isUsedInStringLiteral(methodSymbol)) {
          context().newIssue(this, methodSymbol.declaration(), String.format(MESSAGE, methodSymbol.name()));
        }
      }
    }
  } 
                            #location 8 
                            #vulnerability type NULL_DEREFERENCE