diff options
author | emcmanus <emcmanus@google.com> | 2019-08-22 08:47:06 -0700 |
---|---|---|
committer | Chris Povirk <beigetangerine@gmail.com> | 2019-08-23 14:54:05 -0400 |
commit | 0dff957193e53e25cd32ca3da755b33bb62fa6e4 (patch) | |
tree | c6df7ff858e555412691a1bbc101fe4ad1398582 /common | |
parent | 0bc8a2ee2c04717440371fd2281df700b407f782 (diff) | |
download | auto-0dff957193e53e25cd32ca3da755b33bb62fa6e4.tar.gz |
Replace FooVisitor6 and FooVisitor7 with FooVisitor8 throughout auto-common. We have required at least Java 8 for compilation for some time now.
TGP: []
RELNOTES=n/a
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=264842791
Diffstat (limited to 'common')
6 files changed, 27 insertions, 27 deletions
diff --git a/common/src/main/java/com/google/auto/common/AnnotationValues.java b/common/src/main/java/com/google/auto/common/AnnotationValues.java index b3da573e..ac18879b 100644 --- a/common/src/main/java/com/google/auto/common/AnnotationValues.java +++ b/common/src/main/java/com/google/auto/common/AnnotationValues.java @@ -20,7 +20,7 @@ import java.util.List; import javax.lang.model.element.AnnotationMirror; import javax.lang.model.element.AnnotationValue; import javax.lang.model.type.TypeMirror; -import javax.lang.model.util.SimpleAnnotationValueVisitor6; +import javax.lang.model.util.SimpleAnnotationValueVisitor8; /** * A utility class for working with {@link AnnotationValue} instances. @@ -31,11 +31,11 @@ public final class AnnotationValues { private static final Equivalence<AnnotationValue> ANNOTATION_VALUE_EQUIVALENCE = new Equivalence<AnnotationValue>() { @Override protected boolean doEquivalent(AnnotationValue left, AnnotationValue right) { - return left.accept(new SimpleAnnotationValueVisitor6<Boolean, AnnotationValue>() { + return left.accept(new SimpleAnnotationValueVisitor8<Boolean, AnnotationValue>() { // LHS is not an annotation or array of annotation values, so just test equality. @Override protected Boolean defaultAction(Object left, AnnotationValue right) { return left.equals(right.accept( - new SimpleAnnotationValueVisitor6<Object, Void>() { + new SimpleAnnotationValueVisitor8<Object, Void>() { @Override protected Object defaultAction(Object object, Void unused) { return object; } @@ -46,7 +46,7 @@ public final class AnnotationValues { // and false for other types. @Override public Boolean visitAnnotation(AnnotationMirror left, AnnotationValue right) { return right.accept( - new SimpleAnnotationValueVisitor6<Boolean, AnnotationMirror>() { + new SimpleAnnotationValueVisitor8<Boolean, AnnotationMirror>() { @Override protected Boolean defaultAction(Object right, AnnotationMirror left) { return false; // Not an annotation mirror, so can't be equal to such. } @@ -62,7 +62,7 @@ public final class AnnotationValues { @Override public Boolean visitArray(List<? extends AnnotationValue> left, AnnotationValue right) { return right.accept( - new SimpleAnnotationValueVisitor6<Boolean, List<? extends AnnotationValue>>() { + new SimpleAnnotationValueVisitor8<Boolean, List<? extends AnnotationValue>>() { @Override protected Boolean defaultAction( Object ignored, List<? extends AnnotationValue> alsoIgnored) { return false; // Not an array, so can't be equal to such. @@ -81,7 +81,7 @@ public final class AnnotationValues { @Override public Boolean visitType(TypeMirror left, AnnotationValue right) { return right.accept( - new SimpleAnnotationValueVisitor6<Boolean, TypeMirror>() { + new SimpleAnnotationValueVisitor8<Boolean, TypeMirror>() { @Override protected Boolean defaultAction( Object ignored, TypeMirror alsoIgnored) { return false; // Not an annotation mirror, so can't be equal to such. @@ -96,7 +96,7 @@ public final class AnnotationValues { } @Override protected int doHash(AnnotationValue value) { - return value.accept(new SimpleAnnotationValueVisitor6<Integer, Void>() { + return value.accept(new SimpleAnnotationValueVisitor8<Integer, Void>() { @Override public Integer visitAnnotation(AnnotationMirror value, Void ignore) { return AnnotationMirrors.equivalence().hash(value); } diff --git a/common/src/main/java/com/google/auto/common/BasicAnnotationProcessor.java b/common/src/main/java/com/google/auto/common/BasicAnnotationProcessor.java index 39ffbeaa..2d9c1199 100644 --- a/common/src/main/java/com/google/auto/common/BasicAnnotationProcessor.java +++ b/common/src/main/java/com/google/auto/common/BasicAnnotationProcessor.java @@ -53,7 +53,7 @@ import javax.lang.model.element.PackageElement; import javax.lang.model.element.TypeElement; import javax.lang.model.type.ErrorType; import javax.lang.model.util.Elements; -import javax.lang.model.util.SimpleElementVisitor6; +import javax.lang.model.util.SimpleElementVisitor8; /** * An abstract {@link Processor} implementation that defers processing of {@link Element}s to later @@ -404,7 +404,7 @@ public abstract class BasicAnnotationProcessor extends AbstractProcessor { */ // TODO(cgruber) move to MoreElements and make public. private static TypeElement getEnclosingType(Element element) { - return element.accept(new SimpleElementVisitor6<TypeElement, Void>() { + return element.accept(new SimpleElementVisitor8<TypeElement, Void>() { @Override protected TypeElement defaultAction(Element e, Void p) { return e.getEnclosingElement().accept(this, p); } diff --git a/common/src/main/java/com/google/auto/common/MoreElements.java b/common/src/main/java/com/google/auto/common/MoreElements.java index 5d01fc74..5e8e3541 100644 --- a/common/src/main/java/com/google/auto/common/MoreElements.java +++ b/common/src/main/java/com/google/auto/common/MoreElements.java @@ -44,7 +44,7 @@ import javax.lang.model.type.TypeKind; import javax.lang.model.type.TypeMirror; import javax.lang.model.util.ElementFilter; import javax.lang.model.util.Elements; -import javax.lang.model.util.SimpleElementVisitor6; +import javax.lang.model.util.SimpleElementVisitor8; import javax.lang.model.util.Types; /** @@ -476,7 +476,7 @@ public final class MoreElements { } } - private abstract static class CastingElementVisitor<T> extends SimpleElementVisitor6<T, Void> { + private abstract static class CastingElementVisitor<T> extends SimpleElementVisitor8<T, Void> { private final String label; CastingElementVisitor(String label) { diff --git a/common/src/main/java/com/google/auto/common/MoreTypes.java b/common/src/main/java/com/google/auto/common/MoreTypes.java index 94e0b059..bd613fe4 100644 --- a/common/src/main/java/com/google/auto/common/MoreTypes.java +++ b/common/src/main/java/com/google/auto/common/MoreTypes.java @@ -56,7 +56,7 @@ import javax.lang.model.type.TypeMirror; import javax.lang.model.type.TypeVariable; import javax.lang.model.type.WildcardType; import javax.lang.model.util.Elements; -import javax.lang.model.util.SimpleTypeVisitor6; +import javax.lang.model.util.SimpleTypeVisitor8; import javax.lang.model.util.Types; /** @@ -165,7 +165,7 @@ public final class MoreTypes { } } - private static final class EqualVisitor extends SimpleTypeVisitor6<Boolean, EqualVisitorParam> { + private static final class EqualVisitor extends SimpleTypeVisitor8<Boolean, EqualVisitorParam> { private static final EqualVisitor INSTANCE = new EqualVisitor(); @Override @@ -355,7 +355,7 @@ public final class MoreTypes { private static final int HASH_SEED = 17; private static final int HASH_MULTIPLIER = 31; - private static final class HashVisitor extends SimpleTypeVisitor6<Integer, Set<Element>> { + private static final class HashVisitor extends SimpleTypeVisitor8<Integer, Set<Element>> { private static final HashVisitor INSTANCE = new HashVisitor(); int hashKind(int seed, TypeMirror t) { @@ -463,7 +463,7 @@ public final class MoreTypes { } private static final class ReferencedTypes - extends SimpleTypeVisitor6<Void, ImmutableSet.Builder<TypeElement>> { + extends SimpleTypeVisitor8<Void, ImmutableSet.Builder<TypeElement>> { private static final ReferencedTypes INSTANCE = new ReferencedTypes(); @Override @@ -515,7 +515,7 @@ public final class MoreTypes { return typeMirror.accept(AsElementVisitor.INSTANCE, null); } - private static final class AsElementVisitor extends SimpleTypeVisitor6<Element, Void> { + private static final class AsElementVisitor extends SimpleTypeVisitor8<Element, Void> { private static final AsElementVisitor INSTANCE = new AsElementVisitor(); @Override @@ -776,7 +776,7 @@ public final class MoreTypes { return type.accept(IsTypeVisitor.INSTANCE, null); } - private static final class IsTypeVisitor extends SimpleTypeVisitor6<Boolean, Void> { + private static final class IsTypeVisitor extends SimpleTypeVisitor8<Boolean, Void> { private static final IsTypeVisitor INSTANCE = new IsTypeVisitor(); @Override @@ -815,7 +815,7 @@ public final class MoreTypes { return type.accept(new IsTypeOf(clazz), null); } - private static final class IsTypeOf extends SimpleTypeVisitor6<Boolean, Void> { + private static final class IsTypeOf extends SimpleTypeVisitor8<Boolean, Void> { private final Class<?> clazz; IsTypeOf(Class<?> clazz) { @@ -941,7 +941,7 @@ public final class MoreTypes { } } - private abstract static class CastingTypeVisitor<T> extends SimpleTypeVisitor6<T, Void> { + private abstract static class CastingTypeVisitor<T> extends SimpleTypeVisitor8<T, Void> { private final String label; CastingTypeVisitor(String label) { diff --git a/common/src/main/java/com/google/auto/common/Overrides.java b/common/src/main/java/com/google/auto/common/Overrides.java index 3321588c..19a45862 100644 --- a/common/src/main/java/com/google/auto/common/Overrides.java +++ b/common/src/main/java/com/google/auto/common/Overrides.java @@ -36,7 +36,7 @@ import javax.lang.model.type.TypeMirror; import javax.lang.model.type.TypeVariable; import javax.lang.model.util.ElementFilter; import javax.lang.model.util.Elements; -import javax.lang.model.util.SimpleTypeVisitor6; +import javax.lang.model.util.SimpleTypeVisitor8; import javax.lang.model.util.Types; /** @@ -232,7 +232,7 @@ abstract class Overrides { * {@code class MyList implements List<Set<? extends Number>>} but that doesn't matter * because the {@code E} of the {@code List} is going to be erased to raw {@code Set}. */ - private class TypeSubstVisitor extends SimpleTypeVisitor6<TypeMirror, Void> { + private class TypeSubstVisitor extends SimpleTypeVisitor8<TypeMirror, Void> { /** * The bindings of type variables. We can put them all in one map because E in {@code List<E>} * is not the same as E in {@code Collection<E>}. As we ascend the type hierarchy we'll add diff --git a/common/src/main/java/com/google/auto/common/SuperficialValidation.java b/common/src/main/java/com/google/auto/common/SuperficialValidation.java index a7b8ebcf..dddb1be9 100644 --- a/common/src/main/java/com/google/auto/common/SuperficialValidation.java +++ b/common/src/main/java/com/google/auto/common/SuperficialValidation.java @@ -35,9 +35,9 @@ import javax.lang.model.type.TypeKind; import javax.lang.model.type.TypeMirror; import javax.lang.model.type.TypeVisitor; import javax.lang.model.type.WildcardType; -import javax.lang.model.util.AbstractElementVisitor6; -import javax.lang.model.util.SimpleAnnotationValueVisitor6; -import javax.lang.model.util.SimpleTypeVisitor6; +import javax.lang.model.util.AbstractElementVisitor8; +import javax.lang.model.util.SimpleAnnotationValueVisitor8; +import javax.lang.model.util.SimpleTypeVisitor8; /** * A utility class that traverses {@link Element} instances and ensures that all type information @@ -56,7 +56,7 @@ public final class SuperficialValidation { } private static final ElementVisitor<Boolean, Void> ELEMENT_VALIDATING_VISITOR = - new AbstractElementVisitor6<Boolean, Void>() { + new AbstractElementVisitor8<Boolean, Void>() { @Override public Boolean visitPackage(PackageElement e, Void p) { // don't validate enclosed elements because it will return types in the package return validateAnnotations(e.getAnnotationMirrors()); @@ -119,7 +119,7 @@ public final class SuperficialValidation { * bounds. */ private static final TypeVisitor<Boolean, Void> TYPE_VALIDATING_VISITOR = - new SimpleTypeVisitor6<Boolean, Void>() { + new SimpleTypeVisitor8<Boolean, Void>() { @Override protected Boolean defaultAction(TypeMirror t, Void p) { return true; @@ -196,7 +196,7 @@ public final class SuperficialValidation { } private static final AnnotationValueVisitor<Boolean, TypeMirror> VALUE_VALIDATING_VISITOR = - new SimpleAnnotationValueVisitor6<Boolean, TypeMirror>() { + new SimpleAnnotationValueVisitor8<Boolean, TypeMirror>() { @Override protected Boolean defaultAction(Object o, TypeMirror expectedType) { return MoreTypes.isTypeOf(o.getClass(), expectedType); } |