Fix the SuperficialValidator to properly handle upstream impact on AnnotationValues

Fix the SuperficialValidator to properly handle upstream compilation problems resulting in unreasonable AnnotationValues (specifically  "<any>" and "<error>" strings appearing instead of real values where there are missing imports or other upstream compilation issues).  Migrate isTypeOf from Dagger to perform the key test (i.e. is there a sane match between the expected annotation value type and the type returned by the processor environment)

-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=75599279
So weird.  boolean.class was my initial instinct, but I wrote that in
eclipse and it barfed but maybe I was dealing with some other transient
error, as I was having some substantial issues with eclipse at the time.
 I'll add this to the list of things to clean up when I get back from
holiday.

On Wed Sep 17 2014 at 12:53:28 AM Eugene Lukash <notifications@github.com>
wrote:

> In common/src/main/java/com/google/auto/common/MoreTypes.java:
>
> > +    return type.accept(new SimpleTypeVisitor6<Boolean, Void>() {
> > +      @Override protected Boolean defaultAction(TypeMirror type, Void ignored) {
> > +        throw new IllegalArgumentException(type + " cannot be represented as a Class<?>.");
> > +      }
> > +
> > +      @Override public Boolean visitNoType(NoType noType, Void p) {
> > +        if (noType.getKind().equals(TypeKind.VOID)) {
> > +          return clazz.equals(Void.TYPE);
> > +        }
> > +        throw new IllegalArgumentException(noType + " cannot be represented as a Class<?>.");
> > +      }
> > +
> > +      @Override public Boolean visitPrimitive(PrimitiveType type, Void p) {
> > +        switch (type.getKind()) {
> > +          case BOOLEAN:
> > +            return clazz.equals(Boolean.TYPE);
>
> This change was introduced between java 1.0 and 1.1. Since 1.1 you can use
> byte.class, boolean.class
> boolean.class == Boolean.TYPE always true
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/google/auto/pull/136/files#r17645829>.
>