void appendTypeName(DeclaredType type, StringBuilder sb) {
      TypeMirror enclosing = EclipseHack.getEnclosingType(type);
      if (enclosing.getKind().equals(TypeKind.DECLARED)) {
        // We might have something like com.example.Outer<Double>.Inner. We need to encode
        // com.example.Outer<Double> first, producing `com.example.Outer`<`java.lang.Double`>.
        // Then we can simply add .Inner after that. If Inner has its own type arguments, we'll
        // add them with appendTypeArguments below. Of course, it's more usual for the outer class
        // not to have type arguments, but we'll still follow this path if the nested class is an
        // inner (not static) class.
        visit2(enclosing, sb);
        sb.append(".").append(type.asElement().getSimpleName());
      } else {
        sb.append('`').append(className(type)).append('`');
      }
    }
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