core/src/main/java/com/google/errorprone/bugpatterns/StaticAssignmentOfThrowable.java
private final TreeScanner<Void, Void> buildTreeScanner(VisitorState state) {

    Type throwableType = state.getSymtab().throwableType;

    return new TreeScanner<Void, Void>() {
      @Override
      public Void visitClass(ClassTree classTree, Void unused) {
        return null;
      }

      @Override
      public Void visitMethod(MethodTree methodTree, Void unused) {
        return null;
      }

      @Override
      public Void visitAssignment(AssignmentTree assignmentTree, Void unused) {
        Symbol variableSymbol = getSymbol(assignmentTree.getVariable());
        Type variableType = getType(assignmentTree.getVariable());
        if (variableSymbol != null
            && variableSymbol.isStatic()
            && isSubtype(variableType, throwableType, state)) {
          state.reportMatch(describeMatch(assignmentTree));
        }
        return super.visitAssignment(assignmentTree, null);
      }
    };
  }
/* Builds a {@code TreeScanner} that searches for assignments to static {@code Throwable} fields,
   * and reports matches. */
Builds a  TreeScanner that searches for assignments to static  Throwable fields,
and reports matches.
Builds a TreeScanner that searches for assignments to static Throwable fields and reports matches .
private final TreeScanner<Void, Void> buildTreeScanner(VisitorState state) {
    Type throwableType = state.getSymtab().throwableType;
    return new TreeScanner<Void, Void>() {
      @Override
      public Void visitClass(ClassTree classTree, Void unused) {
        return null;
      }
      @Override
      public Void visitMethod(MethodTree methodTree, Void unused) {
        return null;
      }
      @Override
      public Void visitAssignment(AssignmentTree assignmentTree, Void unused) {
        Symbol variableSymbol = getSymbol(assignmentTree.getVariable());
        Type variableType = getType(assignmentTree.getVariable());
        if (variableSymbol != null
            && variableSymbol.isStatic()
            && isSubtype(variableType, throwableType, state)) {
          state.reportMatch(describeMatch(assignmentTree));
        }
        return super.visitAssignment(assignmentTree, null);
      }
    };
  }
private final TreeScanner < Void , Void > buildTreeScanner ( VisitorState state ) { Type throwableType = state . getSymtab ( ) . throwableType ; return new TreeScanner < Void , Void > ( ) { @ Override public Void visitClass ( ClassTree classTree , Void unused ) { return null ; } @ Override public Void visitMethod ( MethodTree methodTree , Void unused ) { return null ; } @ Override public Void visitAssignment ( AssignmentTree assignmentTree , Void unused ) { Symbol variableSymbol = getSymbol ( assignmentTree . getVariable ( ) ) ; Type variableType = getType ( assignmentTree . getVariable ( ) ) ; if ( variableSymbol != null && variableSymbol . isStatic ( ) && isSubtype ( variableType , throwableType , state ) ) { state . reportMatch ( describeMatch ( assignmentTree ) ) ; } return super . visitAssignment ( assignmentTree , null ) ; } } ; }
Builds a {@code TreeScanner} that searches for assignments to static {@code Throwable} fields,
 and reports matches.
Builds a { @code TreeScanner } that searches for assignments to static { @code Throwable } fields and reports matches .