StringBuilder visit2(TypeMirror type, StringBuilder sb) {
      if (type.getKind().equals(TypeKind.DECLARED)) {
        // There's no point in using MoreTypes.asDeclared here, and in fact we can't, because it
        // uses a visitor, so it would trigger the bug we're working around.
        return visitDeclared((DeclaredType) type, sb);
      } else {
        return visit(type, sb);
      }
    }
Equivalent to {@code visit(type, sb)} or {@code type.accept(sb)}, except that it fixes a bug
with javac versions up to JDK 8, whereby if the type is a {@code DeclaredType} then the
visitor is called with a version of the type where any annotations have been lost. We can't
override {@code visit} because it is final.
value/src/main/java/com/google/auto/value/processor/TypeEncoder.java