Full Code of google/auto for AI

main 74bb96d2ef9f cached
377 files
2.4 MB
640.7k tokens
5154 symbols
1 requests
Download .txt
Showing preview only (2,565K chars total). Download the full file or copy to clipboard to get everything.
Repository: google/auto
Branch: main
Commit: 74bb96d2ef9f
Files: 377
Total size: 2.4 MB

Directory structure:
gitextract_g32a_pij/

├── .github/
│   ├── dependabot.yml
│   └── workflows/
│       └── ci.yml
├── .gitignore
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── build-pom.xml
├── common/
│   ├── README.md
│   ├── pom.xml
│   └── src/
│       ├── main/
│       │   └── java/
│       │       └── com/
│       │           └── google/
│       │               └── auto/
│       │                   └── common/
│       │                       ├── AnnotationMirrors.java
│       │                       ├── AnnotationOutput.java
│       │                       ├── AnnotationValues.java
│       │                       ├── BasicAnnotationProcessor.java
│       │                       ├── GeneratedAnnotationSpecs.java
│       │                       ├── GeneratedAnnotations.java
│       │                       ├── MoreElements.java
│       │                       ├── MoreStreams.java
│       │                       ├── MoreTypes.java
│       │                       ├── Overrides.java
│       │                       ├── SimpleAnnotationMirror.java
│       │                       ├── SimpleTypeAnnotationValue.java
│       │                       ├── SuperficialValidation.java
│       │                       ├── Visibility.java
│       │                       └── package-info.java
│       └── test/
│           └── java/
│               └── com/
│                   └── google/
│                       └── auto/
│                           └── common/
│                               ├── AnnotationMirrorsTest.java
│                               ├── AnnotationValuesTest.java
│                               ├── BasicAnnotationProcessorTest.java
│                               ├── GeneratedAnnotationsTest.java
│                               ├── MoreElementsTest.java
│                               ├── MoreTypesIsTypeOfTest.java
│                               ├── MoreTypesTest.java
│                               ├── OverridesTest.java
│                               ├── SimpleAnnotationMirrorTest.java
│                               ├── SimpleTypeAnnotationValueTest.java
│                               ├── SuperficialValidationTest.java
│                               └── VisibilityTest.java
├── factory/
│   ├── README.md
│   ├── pom.xml
│   └── src/
│       ├── it/
│       │   └── functional/
│       │       ├── pom.xml
│       │       └── src/
│       │           ├── main/
│       │           │   └── java/
│       │           │       └── com/
│       │           │           └── google/
│       │           │               └── auto/
│       │           │                   └── factory/
│       │           │                       ├── DaggerModule.java
│       │           │                       ├── Dependency.java
│       │           │                       ├── DependencyImpl.java
│       │           │                       ├── FactoryComponent.java
│       │           │                       ├── FactoryInterface.java
│       │           │                       ├── Foo.java
│       │           │                       ├── GenericFoo.java
│       │           │                       ├── GuiceModule.java
│       │           │                       ├── QualifiedDependencyImpl.java
│       │           │                       ├── Qualifier.java
│       │           │                       ├── ReferencePackage.java
│       │           │                       └── otherpackage/
│       │           │                           └── OtherPackage.java
│       │           └── test/
│       │               └── java/
│       │                   └── com/
│       │                       └── google/
│       │                           └── auto/
│       │                               └── factory/
│       │                                   └── DependencyInjectionIntegrationTest.java
│       ├── main/
│       │   └── java/
│       │       └── com/
│       │           └── google/
│       │               └── auto/
│       │                   └── factory/
│       │                       ├── AutoFactory.java
│       │                       ├── Provided.java
│       │                       ├── package-info.java
│       │                       └── processor/
│       │                           ├── AnnotationValues.java
│       │                           ├── AutoFactoryDeclaration.java
│       │                           ├── AutoFactoryProcessor.java
│       │                           ├── Elements2.java
│       │                           ├── FactoryDescriptor.java
│       │                           ├── FactoryDescriptorGenerator.java
│       │                           ├── FactoryMethodDescriptor.java
│       │                           ├── FactoryWriter.java
│       │                           ├── ImplementationMethodDescriptor.java
│       │                           ├── InjectApi.java
│       │                           ├── Key.java
│       │                           ├── Mirrors.java
│       │                           ├── PackageAndClass.java
│       │                           ├── Parameter.java
│       │                           ├── ProvidedChecker.java
│       │                           ├── ProviderField.java
│       │                           ├── TypeVariables.java
│       │                           └── package-info.java
│       └── test/
│           ├── java/
│           │   └── com/
│           │       └── google/
│           │           └── auto/
│           │               └── factory/
│           │                   └── processor/
│           │                       ├── AutoFactoryDeclarationTest.java
│           │                       ├── AutoFactoryProcessorNegativeTest.java
│           │                       └── AutoFactoryProcessorTest.java
│           └── resources/
│               ├── bad/
│               │   ├── AnnotationsToApplyMultiple.java
│               │   ├── AnnotationsToApplyNotAnnotations.java
│               │   ├── AnnotationsToApplyRepeated.java
│               │   ├── EnumSupertype.java
│               │   ├── FactoryExtendingAbstractClassWithConstructorParams.java
│               │   ├── FinalSupertype.java
│               │   ├── InterfaceSupertype.java
│               │   ├── InvalidCustomName.java
│               │   ├── MixedFinals.java
│               │   ├── ProvidedButNoAutoFactory.java
│               │   └── ProvidedOnMethodParameter.java
│               ├── expected/
│               │   ├── CheckerFrameworkNullableFactory.java
│               │   ├── ClassUsingQualifierWithArgsFactory.java
│               │   ├── ConstructorAnnotatedFactory.java
│               │   ├── ConstructorAnnotatedNonFinalFactory.java
│               │   ├── ConstructorAnnotatedThrowsFactory.java
│               │   ├── CustomAnnotationsFactory.java
│               │   ├── CustomNamedFactory.java
│               │   ├── CustomNullableFactory.java
│               │   ├── DefaultPackageFactory.java
│               │   ├── FactoryExtendingAbstractClassFactory.java
│               │   ├── FactoryExtendingAbstractClassThrowsFactory.java
│               │   ├── FactoryImplementingCreateMethod_ConcreteClassFactory.java
│               │   ├── FactoryImplementingGenericInterfaceExtensionFactory.java
│               │   ├── Generics_ExplicitFooImplFactory.java
│               │   ├── Generics_FooImplFactory.java
│               │   ├── Generics_FooImplWithClassFactory.java
│               │   ├── MixedDepsImplementingInterfacesFactory.java
│               │   ├── MultipleFactoriesConflictingParameterNamesFactory.java
│               │   ├── MultipleFactoriesImplementingInterface_ClassAFactory.java
│               │   ├── MultipleFactoriesImplementingInterface_ClassBFactory.java
│               │   ├── MultipleProvidedParamsSameKeyFactory.java
│               │   ├── NestedClassCustomNamedFactory.java
│               │   ├── NestedClasses_SimpleNestedClassFactory.java
│               │   ├── OnlyPrimitivesFactory.java
│               │   ├── ParameterAnnotationsFactory.java
│               │   ├── ProviderArgumentToCreateMethodFactory.java
│               │   ├── PublicClassFactory.java
│               │   ├── SimpleClassFactory.java
│               │   ├── SimpleClassImplementingMarkerFactory.java
│               │   ├── SimpleClassImplementingSimpleInterfaceFactory.java
│               │   ├── SimpleClassMixedDepsFactory.java
│               │   ├── SimpleClassNonFinalFactory.java
│               │   ├── SimpleClassNullableParametersFactory.java
│               │   ├── SimpleClassPassedDepsFactory.java
│               │   ├── SimpleClassProvidedDepsFactory.java
│               │   ├── SimpleClassProvidedProviderDepsFactory.java
│               │   ├── SimpleClassThrowsFactory.java
│               │   └── SimpleClassVarargsFactory.java
│               ├── good/
│               │   ├── CheckerFrameworkNullable.java
│               │   ├── ClassUsingQualifierWithArgs.java
│               │   ├── ConstructorAnnotated.java
│               │   ├── ConstructorAnnotatedNonFinal.java
│               │   ├── ConstructorAnnotatedThrows.java
│               │   ├── CustomAnnotations.java
│               │   ├── CustomNullable.java
│               │   ├── DefaultPackage.java
│               │   ├── FactoryExtendingAbstractClass.java
│               │   ├── FactoryExtendingAbstractClassThrows.java
│               │   ├── FactoryExtendingAbstractClassWithMultipleConstructors.java
│               │   ├── FactoryImplementingCreateMethod.java
│               │   ├── FactoryImplementingGenericInterfaceExtension.java
│               │   ├── Generics.java
│               │   ├── MixedDepsImplementingInterfaces.java
│               │   ├── MultipleFactoriesConflictingParameterNames.java
│               │   ├── MultipleFactoriesImplementingInterface.java
│               │   ├── MultipleProvidedParamsSameKey.java
│               │   ├── NestedClasses.java
│               │   ├── OnlyPrimitives.java
│               │   ├── ParameterAnnotations.java
│               │   ├── ProviderArgumentToCreateMethod.java
│               │   ├── PublicClass.java
│               │   ├── SimpleClass.java
│               │   ├── SimpleClassCustomName.java
│               │   ├── SimpleClassImplementingMarker.java
│               │   ├── SimpleClassImplementingSimpleInterface.java
│               │   ├── SimpleClassMixedDeps.java
│               │   ├── SimpleClassNonFinal.java
│               │   ├── SimpleClassNullableParameters.java
│               │   ├── SimpleClassPassedDeps.java
│               │   ├── SimpleClassProvidedDeps.java
│               │   ├── SimpleClassProvidedProviderDeps.java
│               │   ├── SimpleClassThrows.java
│               │   └── SimpleClassVarargs.java
│               └── support/
│                   ├── AQualifier.java
│                   ├── BQualifier.java
│                   └── QualifierWithArgs.java
├── service/
│   ├── README.md
│   ├── annotations/
│   │   ├── pom.xml
│   │   └── src/
│   │       └── main/
│   │           └── java/
│   │               └── com/
│   │                   └── google/
│   │                       └── auto/
│   │                           └── service/
│   │                               └── AutoService.java
│   ├── pom.xml
│   └── processor/
│       ├── pom.xml
│       └── src/
│           ├── main/
│           │   ├── java/
│           │   │   └── com/
│           │   │       └── google/
│           │   │           └── auto/
│           │   │               └── service/
│           │   │                   └── processor/
│           │   │                       ├── AutoServiceProcessor.java
│           │   │                       ├── ServicesFiles.java
│           │   │                       └── package-info.java
│           │   └── resources/
│           │       └── META-INF/
│           │           ├── gradle/
│           │           │   └── incremental.annotation.processors
│           │           └── services/
│           │               └── javax.annotation.processing.Processor
│           └── test/
│               ├── java/
│               │   └── com/
│               │       └── google/
│               │           └── auto/
│               │               └── service/
│               │                   └── processor/
│               │                       └── AutoServiceProcessorTest.java
│               └── resources/
│                   ├── META-INF/
│                   │   └── services/
│                   │       ├── test.AnotherService
│                   │       └── test.SomeService
│                   └── test/
│                       ├── AnotherService.java
│                       ├── AnotherServiceProvider.java
│                       ├── AutoServiceOnAbstractClass.java
│                       ├── AutoServiceOnInterface.java
│                       ├── DoesNotImplement.java
│                       ├── DoesNotImplementSuppressed.java
│                       ├── Enclosing.java
│                       ├── EnclosingGeneric.java
│                       ├── GenericService.java
│                       ├── GenericServiceProvider.java
│                       ├── GenericServiceProviderSuppressWarnings.java
│                       ├── GenericServiceProviderWithMissingServiceClass.java
│                       ├── MultiServiceProvider.java
│                       ├── NoServices.java
│                       ├── SomeService.java
│                       ├── SomeServiceProvider1.java
│                       └── SomeServiceProvider2.java
├── util/
│   ├── generate-latest-docs.sh
│   └── publish-snapshot-on-commit.sh
└── value/
    ├── CHANGES.md
    ├── README.md
    ├── annotations/
    │   └── pom.xml
    ├── pom.xml
    ├── processor/
    │   └── pom.xml
    ├── src/
    │   ├── it/
    │   │   ├── functional/
    │   │   │   ├── invoker.properties
    │   │   │   ├── pom.xml
    │   │   │   └── src/
    │   │   │       ├── main/
    │   │   │       │   └── java/
    │   │   │       │       ├── PackagelessNestedValueType.java
    │   │   │       │       ├── PackagelessValueType.java
    │   │   │       │       └── com/
    │   │   │       │           └── google/
    │   │   │       │               └── auto/
    │   │   │       │                   └── value/
    │   │   │       │                       ├── NestedValueType.java
    │   │   │       │                       └── SimpleValueType.java
    │   │   │       └── test/
    │   │   │           └── java/
    │   │   │               ├── PackagelessValueTypeTest.java
    │   │   │               └── com/
    │   │   │                   └── google/
    │   │   │                       └── auto/
    │   │   │                           └── value/
    │   │   │                               ├── AutoAnnotationDefaultsTest.java
    │   │   │                               ├── AutoAnnotationTest.java
    │   │   │                               ├── AutoBuilderKotlinTest.java
    │   │   │                               ├── AutoBuilderTest.java
    │   │   │                               ├── AutoOneOfJava8Test.java
    │   │   │                               ├── AutoOneOfTest.java
    │   │   │                               ├── AutoValueJava8Test.java
    │   │   │                               ├── AutoValueNotEclipseTest.java
    │   │   │                               ├── AutoValueTest.java
    │   │   │                               ├── CompileWithEclipseTest.java
    │   │   │                               ├── GradleIT.java
    │   │   │                               ├── KotlinData.kt
    │   │   │                               ├── SimpleValueTypeTest.java
    │   │   │                               ├── annotations/
    │   │   │                               │   ├── Empty.java
    │   │   │                               │   ├── GwtArrays.java
    │   │   │                               │   ├── StringValues.java
    │   │   │                               │   └── TestAnnotation.java
    │   │   │                               ├── enums/
    │   │   │                               │   └── MyEnum.java
    │   │   │                               └── gwt/
    │   │   │                                   ├── CustomFieldSerializerTest.java
    │   │   │                                   ├── EmptyExtension.java
    │   │   │                                   ├── GwtCompilationTest.java
    │   │   │                                   ├── GwtValueType.java
    │   │   │                                   ├── GwtValueTypeWithBuilder.java
    │   │   │                                   ├── NonSerializableGwtValueType.java
    │   │   │                                   └── SerialSignatureTest.java
    │   │   └── gwtserializer/
    │   │       ├── invoker.properties
    │   │       ├── pom.xml
    │   │       └── src/
    │   │           └── test/
    │   │               └── java/
    │   │                   └── com/
    │   │                       └── google/
    │   │                           └── auto/
    │   │                               └── value/
    │   │                                   ├── GwtSerializerSuite.gwt.xml
    │   │                                   ├── GwtSerializerSuite.java
    │   │                                   └── client/
    │   │                                       └── GwtSerializerTest.java
    │   ├── main/
    │   │   └── java/
    │   │       └── com/
    │   │           └── google/
    │   │               └── auto/
    │   │                   └── value/
    │   │                       ├── AutoAnnotation.java
    │   │                       ├── AutoBuilder.java
    │   │                       ├── AutoOneOf.java
    │   │                       ├── AutoValue.java
    │   │                       ├── extension/
    │   │                       │   ├── AutoValueExtension.java
    │   │                       │   ├── memoized/
    │   │                       │   │   ├── Memoized.java
    │   │                       │   │   └── processor/
    │   │                       │   │       ├── ClassNames.java
    │   │                       │   │       ├── MemoizeExtension.java
    │   │                       │   │       └── MemoizedValidator.java
    │   │                       │   ├── serializable/
    │   │                       │   │   ├── SerializableAutoValue.java
    │   │                       │   │   ├── g3doc/
    │   │                       │   │   │   ├── index.md
    │   │                       │   │   │   └── serializer-extension.md
    │   │                       │   │   ├── processor/
    │   │                       │   │   │   ├── ClassNames.java
    │   │                       │   │   │   ├── PropertyMirror.java
    │   │                       │   │   │   └── SerializableAutoValueExtension.java
    │   │                       │   │   └── serializer/
    │   │                       │   │       ├── SerializerFactoryLoader.java
    │   │                       │   │       ├── impl/
    │   │                       │   │       │   ├── IdentitySerializerFactory.java
    │   │                       │   │       │   ├── ImmutableListSerializerExtension.java
    │   │                       │   │       │   ├── ImmutableMapSerializerExtension.java
    │   │                       │   │       │   ├── OptionalSerializerExtension.java
    │   │                       │   │       │   └── SerializerFactoryImpl.java
    │   │                       │   │       ├── interfaces/
    │   │                       │   │       │   ├── Serializer.java
    │   │                       │   │       │   ├── SerializerExtension.java
    │   │                       │   │       │   └── SerializerFactory.java
    │   │                       │   │       └── runtime/
    │   │                       │   │           └── FunctionWithExceptions.java
    │   │                       │   └── toprettystring/
    │   │                       │       ├── ToPrettyString.java
    │   │                       │       └── processor/
    │   │                       │           ├── Annotations.java
    │   │                       │           ├── ClassNames.java
    │   │                       │           ├── ExtensionClassTypeSpecBuilder.java
    │   │                       │           ├── ToPrettyStringExtension.java
    │   │                       │           ├── ToPrettyStringMethods.java
    │   │                       │           └── ToPrettyStringValidator.java
    │   │                       └── processor/
    │   │                           ├── AbortProcessingException.java
    │   │                           ├── AnnotatedTypeMirror.java
    │   │                           ├── AnnotationOutput.java
    │   │                           ├── AutoAnnotationProcessor.java
    │   │                           ├── AutoAnnotationTemplateVars.java
    │   │                           ├── AutoBuilderAnnotationTemplateVars.java
    │   │                           ├── AutoBuilderProcessor.java
    │   │                           ├── AutoBuilderTemplateVars.java
    │   │                           ├── AutoOneOfProcessor.java
    │   │                           ├── AutoOneOfTemplateVars.java
    │   │                           ├── AutoValueBuilderProcessor.java
    │   │                           ├── AutoValueOrBuilderTemplateVars.java
    │   │                           ├── AutoValueProcessor.java
    │   │                           ├── AutoValueTemplateVars.java
    │   │                           ├── AutoValueishProcessor.java
    │   │                           ├── AutoValueishTemplateVars.java
    │   │                           ├── BuilderMethodClassifier.java
    │   │                           ├── BuilderMethodClassifierForAutoBuilder.java
    │   │                           ├── BuilderMethodClassifierForAutoValue.java
    │   │                           ├── BuilderRequiredProperties.java
    │   │                           ├── BuilderSpec.java
    │   │                           ├── ClassNames.java
    │   │                           ├── EclipseHack.java
    │   │                           ├── ErrorReporter.java
    │   │                           ├── Executable.java
    │   │                           ├── ExtensionContext.java
    │   │                           ├── ForwardingClassGenerator.java
    │   │                           ├── GwtCompatibility.java
    │   │                           ├── GwtSerialization.java
    │   │                           ├── JavaScanner.java
    │   │                           ├── KotlinMetadata.java
    │   │                           ├── MethodSignature.java
    │   │                           ├── MissingTypes.java
    │   │                           ├── Nullables.java
    │   │                           ├── Optionalish.java
    │   │                           ├── PropertyBuilderClassifier.java
    │   │                           ├── PropertyNames.java
    │   │                           ├── Reformatter.java
    │   │                           ├── SimpleMethod.java
    │   │                           ├── SimpleServiceLoader.java
    │   │                           ├── TemplateVars.java
    │   │                           ├── TypeEncoder.java
    │   │                           ├── TypeMirrorSet.java
    │   │                           ├── TypeSimplifier.java
    │   │                           ├── TypeVariables.java
    │   │                           ├── autoannotation.vm
    │   │                           ├── autobuilder.vm
    │   │                           ├── autobuilderannotation.vm
    │   │                           ├── autooneof.vm
    │   │                           ├── autovalue.vm
    │   │                           ├── builder.vm
    │   │                           ├── equalshashcode.vm
    │   │                           ├── gwtserializer.vm
    │   │                           └── package-info.java
    │   └── test/
    │       └── java/
    │           └── com/
    │               └── google/
    │                   └── auto/
    │                       └── value/
    │                           ├── extension/
    │                           │   ├── memoized/
    │                           │   │   ├── MemoizedMethodSubject.java
    │                           │   │   ├── MemoizedMethodSubjectFactory.java
    │                           │   │   ├── MemoizedTest.java
    │                           │   │   └── MemoizedValidationTest.java
    │                           │   ├── serializable/
    │                           │   │   ├── processor/
    │                           │   │   │   └── SerializableAutoValueExtensionTest.java
    │                           │   │   └── serializer/
    │                           │   │       ├── SerializerFactoryLoaderTest.java
    │                           │   │       ├── impl/
    │                           │   │       │   ├── IdentitySerializerFactoryTest.java
    │                           │   │       │   ├── ImmutableListSerializerExtensionTest.java
    │                           │   │       │   ├── ImmutableMapSerializerExtensionTest.java
    │                           │   │       │   ├── OptionalSerializerExtensionTest.java
    │                           │   │       │   └── SerializerFactoryImplTest.java
    │                           │   │       └── utils/
    │                           │   │           ├── CompilationAbstractTest.java
    │                           │   │           ├── FakeSerializerFactory.java
    │                           │   │           └── TestStringSerializerFactory.java
    │                           │   └── toprettystring/
    │                           │       ├── ToPrettyStringTest.java
    │                           │       └── ToPrettyStringValidatorTest.java
    │                           └── processor/
    │                               ├── AutoAnnotationCompilationTest.java
    │                               ├── AutoAnnotationErrorsTest.java
    │                               ├── AutoBuilderCompilationTest.java
    │                               ├── AutoOneOfCompilationTest.java
    │                               ├── AutoValueCompilationTest.java
    │                               ├── BuilderRequiredPropertiesTest.java
    │                               ├── ExtensionTest.java
    │                               ├── ForwardingClassGeneratorTest.java
    │                               ├── GeneratedDoesNotExistTest.java
    │                               ├── GeneratedImport.java
    │                               ├── GuavaCollectionBuildersTest.java
    │                               ├── IncrementalExtensionTest.java
    │                               ├── JavaScannerTest.java
    │                               ├── NullablesTest.java
    │                               ├── PropertyAnnotationsTest.java
    │                               ├── PropertyNamesTest.java
    │                               ├── ReformatterTest.java
    │                               ├── SimpleServiceLoaderTest.java
    │                               ├── SimplifyWithAnnotationsTest.java
    │                               ├── TemplateVarsTest.java
    │                               ├── TypeEncoderTest.java
    │                               ├── TypeSimplifierTest.java
    │                               ├── TypeVariablesTest.java
    │                               └── testclasses/
    │                                   └── RuntimePermission.java
    └── userguide/
        ├── autobuilder.md
        ├── builders-howto.md
        ├── builders.md
        ├── design-faq.md
        ├── extensions.md
        ├── generated-builder-example.md
        ├── generated-example.md
        ├── howto.md
        ├── index.md
        ├── performance.md
        ├── practices.md
        ├── records.md
        ├── trouble.md
        └── why.md

================================================
FILE CONTENTS
================================================

================================================
FILE: .github/dependabot.yml
================================================
version: 2
updates:
  - package-ecosystem: "maven"
    directory: "/common"
    schedule:
      interval: "weekly"
    groups:
      dependencies:
        applies-to: version-updates
        patterns:
          - "*"
  - package-ecosystem: "maven"
    directory: "/factory"
    schedule:
      interval: "weekly"
    groups:
      dependencies:
        applies-to: version-updates
        patterns:
          - "*"
  - package-ecosystem: "maven"
    directory: "/service"
    schedule:
      interval: "weekly"
    groups:
      dependencies:
        applies-to: version-updates
        patterns:
          - "*"
  - package-ecosystem: "maven"
    directory: "/value"
    schedule:
      interval: "weekly"
    groups:
      dependencies:
        applies-to: version-updates
        patterns:
          - "*"
  - package-ecosystem: "github-actions"
    directory: "/"
    schedule:
      interval: "monthly"
    groups:
      github-actions:
        applies-to: version-updates
        patterns:
          - "*"


================================================
FILE: .github/workflows/ci.yml
================================================
name: CI

on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main

jobs:
  test:
    name: "JDK ${{ matrix.java }}"
    strategy:
      matrix:
        java: [ 8, 11, 17 ]
    runs-on: ubuntu-latest
    steps:
      # Cancel any previous runs for the same branch that are still running.
      - name: 'Cancel previous runs'
        uses: styfle/cancel-workflow-action@3155a141048f8f89c06b4cdae32e7853e97536bc
        with:
          access_token: ${{ github.token }}
      - name: 'Check out repository'
        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
      - name: 'Cache local Maven repository'
        uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306
        with:
          path: ~/.m2/repository
          key: maven-${{ hashFiles('**/pom.xml') }}
          restore-keys: |
            maven-
      - name: 'Set up JDK ${{ matrix.java }}'
        uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654
        with:
          java-version: ${{ matrix.java }}
          distribution: 'temurin'
      - name: 'Install'
        shell: bash
        run: mvn -B dependency:go-offline test clean -U --quiet --fail-never -DskipTests=true -f build-pom.xml
      - name: 'Test'
        shell: bash
        run: mvn -B verify -U --fail-at-end -Dsource.skip=true -Dmaven.javadoc.skip=true -f build-pom.xml

  publish_snapshot:
    name: 'Publish snapshot'
    needs: test
    if: github.event_name == 'push' && github.repository == 'google/auto'
    runs-on: ubuntu-latest
    steps:
      - name: 'Check out repository'
        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
      - name: 'Cache local Maven repository'
        uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306
        with:
          path: ~/.m2/repository
          key: maven-${{ hashFiles('**/pom.xml') }}
          restore-keys: |
            maven-
      - name: 'Set up JDK 11'
        uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654
        with:
          java-version: 11
          distribution: 'temurin'
          server-id: central
          server-username: CI_DEPLOY_USERNAME
          server-password: CI_DEPLOY_PASSWORD
      - name: 'Publish'
        env:
          CI_DEPLOY_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }}
          CI_DEPLOY_PASSWORD: ${{ secrets.CI_DEPLOY_PASSWORD }}
        run: ./util/publish-snapshot-on-commit.sh

  generate_docs:
    permissions:
      contents: write
    name: 'Generate latest docs'
    needs: test
    if: github.event_name == 'push' && github.repository == 'google/auto'
    runs-on: ubuntu-latest
    steps:
      - name: 'Check out repository'
        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
      - name: 'Cache local Maven repository'
        uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306
        with:
          path: ~/.m2/repository
          key: maven-${{ hashFiles('**/pom.xml') }}
          restore-keys: |
            maven-
      - name: 'Set up JDK 17' # need 15+ to avoid https://bugs.openjdk.org/browse/JDK-8241780
        uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654
        with:
          java-version: 17
          distribution: 'temurin'
      - name: 'Generate latest docs'
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: ./util/generate-latest-docs.sh


================================================
FILE: .gitignore
================================================
.classpath
.factorypath
.project
.settings
eclipsebin

bin
gen
build
out
lib

target
*.class
pom.xml.*
release.properties

.idea
*.iml
classes

obj

.DS_Store
*~
dependency-reduced-pom.xml


================================================
FILE: CONTRIBUTING.md
================================================
Contributing
============

If you would like to contribute code to Auto you can do so through GitHub
by forking the repository and sending a pull request.

When submitting code, please make every effort to follow existing conventions
and style in order to keep the code as readable as possible.

Where appropriate, please provide unit tests or integration tests. Unit tests
should be JUnit based tests and can use either standard JUnit assertions or
Truth assertions and be added to `<project>/src/test/java`.  Changes to
code generation or other build-time behaviour should go into small maven
projects using the `maven-invoker-plugin`.  Examples of this are in
`generator/src/it` and can include bean-shell verification scripts and other
facilities provided by `maven-invoker-plugin`.

Please make sure your code compiles by running `mvn clean verify` which will
execute both unit and integration test phases.  Additionally, consider using
http://travis-ci.org to validate your branches before you even put them into
pull requests.  All pull requests will be validated by Travis-ci in any case
and must pass before being merged.

If you are adding or modifying files you may add your own copyright line, but
please ensure that the form is consistent with the existing files, and please
note that a Google, Inc. copyright line must appear in every copyright notice.
All files are released with the Apache 2.0 license and any new files may only
be accepted under the terms of that license.

Before your code can be accepted into the project you must sign the
[Individual Contributor License Agreement (CLA)][1].


 [1]: https://developers.google.com/open-source/cla/individual


================================================
FILE: LICENSE
================================================

                                 Apache License
                           Version 2.0, January 2004
                        http://www.apache.org/licenses/

   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

   1. Definitions.

      "License" shall mean the terms and conditions for use, reproduction,
      and distribution as defined by Sections 1 through 9 of this document.

      "Licensor" shall mean the copyright owner or entity authorized by
      the copyright owner that is granting the License.

      "Legal Entity" shall mean the union of the acting entity and all
      other entities that control, are controlled by, or are under common
      control with that entity. For the purposes of this definition,
      "control" means (i) the power, direct or indirect, to cause the
      direction or management of such entity, whether by contract or
      otherwise, or (ii) ownership of fifty percent (50%) or more of the
      outstanding shares, or (iii) beneficial ownership of such entity.

      "You" (or "Your") shall mean an individual or Legal Entity
      exercising permissions granted by this License.

      "Source" form shall mean the preferred form for making modifications,
      including but not limited to software source code, documentation
      source, and configuration files.

      "Object" form shall mean any form resulting from mechanical
      transformation or translation of a Source form, including but
      not limited to compiled object code, generated documentation,
      and conversions to other media types.

      "Work" shall mean the work of authorship, whether in Source or
      Object form, made available under the License, as indicated by a
      copyright notice that is included in or attached to the work
      (an example is provided in the Appendix below).

      "Derivative Works" shall mean any work, whether in Source or Object
      form, that is based on (or derived from) the Work and for which the
      editorial revisions, annotations, elaborations, or other modifications
      represent, as a whole, an original work of authorship. For the purposes
      of this License, Derivative Works shall not include works that remain
      separable from, or merely link (or bind by name) to the interfaces of,
      the Work and Derivative Works thereof.

      "Contribution" shall mean any work of authorship, including
      the original version of the Work and any modifications or additions
      to that Work or Derivative Works thereof, that is intentionally
      submitted to Licensor for inclusion in the Work by the copyright owner
      or by an individual or Legal Entity authorized to submit on behalf of
      the copyright owner. For the purposes of this definition, "submitted"
      means any form of electronic, verbal, or written communication sent
      to the Licensor or its representatives, including but not limited to
      communication on electronic mailing lists, source code control systems,
      and issue tracking systems that are managed by, or on behalf of, the
      Licensor for the purpose of discussing and improving the Work, but
      excluding communication that is conspicuously marked or otherwise
      designated in writing by the copyright owner as "Not a Contribution."

      "Contributor" shall mean Licensor and any individual or Legal Entity
      on behalf of whom a Contribution has been received by Licensor and
      subsequently incorporated within the Work.

   2. Grant of Copyright License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      copyright license to reproduce, prepare Derivative Works of,
      publicly display, publicly perform, sublicense, and distribute the
      Work and such Derivative Works in Source or Object form.

   3. Grant of Patent License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      (except as stated in this section) patent license to make, have made,
      use, offer to sell, sell, import, and otherwise transfer the Work,
      where such license applies only to those patent claims licensable
      by such Contributor that are necessarily infringed by their
      Contribution(s) alone or by combination of their Contribution(s)
      with the Work to which such Contribution(s) was submitted. If You
      institute patent litigation against any entity (including a
      cross-claim or counterclaim in a lawsuit) alleging that the Work
      or a Contribution incorporated within the Work constitutes direct
      or contributory patent infringement, then any patent licenses
      granted to You under this License for that Work shall terminate
      as of the date such litigation is filed.

   4. Redistribution. You may reproduce and distribute copies of the
      Work or Derivative Works thereof in any medium, with or without
      modifications, and in Source or Object form, provided that You
      meet the following conditions:

      (a) You must give any other recipients of the Work or
          Derivative Works a copy of this License; and

      (b) You must cause any modified files to carry prominent notices
          stating that You changed the files; and

      (c) You must retain, in the Source form of any Derivative Works
          that You distribute, all copyright, patent, trademark, and
          attribution notices from the Source form of the Work,
          excluding those notices that do not pertain to any part of
          the Derivative Works; and

      (d) If the Work includes a "NOTICE" text file as part of its
          distribution, then any Derivative Works that You distribute must
          include a readable copy of the attribution notices contained
          within such NOTICE file, excluding those notices that do not
          pertain to any part of the Derivative Works, in at least one
          of the following places: within a NOTICE text file distributed
          as part of the Derivative Works; within the Source form or
          documentation, if provided along with the Derivative Works; or,
          within a display generated by the Derivative Works, if and
          wherever such third-party notices normally appear. The contents
          of the NOTICE file are for informational purposes only and
          do not modify the License. You may add Your own attribution
          notices within Derivative Works that You distribute, alongside
          or as an addendum to the NOTICE text from the Work, provided
          that such additional attribution notices cannot be construed
          as modifying the License.

      You may add Your own copyright statement to Your modifications and
      may provide additional or different license terms and conditions
      for use, reproduction, or distribution of Your modifications, or
      for any such Derivative Works as a whole, provided Your use,
      reproduction, and distribution of the Work otherwise complies with
      the conditions stated in this License.

   5. Submission of Contributions. Unless You explicitly state otherwise,
      any Contribution intentionally submitted for inclusion in the Work
      by You to the Licensor shall be under the terms and conditions of
      this License, without any additional terms or conditions.
      Notwithstanding the above, nothing herein shall supersede or modify
      the terms of any separate license agreement you may have executed
      with Licensor regarding such Contributions.

   6. Trademarks. This License does not grant permission to use the trade
      names, trademarks, service marks, or product names of the Licensor,
      except as required for reasonable and customary use in describing the
      origin of the Work and reproducing the content of the NOTICE file.

   7. Disclaimer of Warranty. Unless required by applicable law or
      agreed to in writing, Licensor provides the Work (and each
      Contributor provides its Contributions) on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
      implied, including, without limitation, any warranties or conditions
      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
      PARTICULAR PURPOSE. You are solely responsible for determining the
      appropriateness of using or redistributing the Work and assume any
      risks associated with Your exercise of permissions under this License.

   8. Limitation of Liability. In no event and under no legal theory,
      whether in tort (including negligence), contract, or otherwise,
      unless required by applicable law (such as deliberate and grossly
      negligent acts) or agreed to in writing, shall any Contributor be
      liable to You for damages, including any direct, indirect, special,
      incidental, or consequential damages of any character arising as a
      result of this License or out of the use or inability to use the
      Work (including but not limited to damages for loss of goodwill,
      work stoppage, computer failure or malfunction, or any and all
      other commercial damages or losses), even if such Contributor
      has been advised of the possibility of such damages.

   9. Accepting Warranty or Additional Liability. While redistributing
      the Work or Derivative Works thereof, You may choose to offer,
      and charge a fee for, acceptance of support, warranty, indemnity,
      or other liability obligations and/or rights consistent with this
      License. However, in accepting such obligations, You may act only
      on Your own behalf and on Your sole responsibility, not on behalf
      of any other Contributor, and only if You agree to indemnify,
      defend, and hold each Contributor harmless for any liability
      incurred by, or claims asserted against, such Contributor by reason
      of your accepting any such warranty or additional liability.

   END OF TERMS AND CONDITIONS

   APPENDIX: How to apply the Apache License to your work.

      To apply the Apache License to your work, attach the following
      boilerplate notice, with the fields enclosed by brackets "[]"
      replaced with your own identifying information. (Don't include
      the brackets!)  The text should be enclosed in the appropriate
      comment syntax for the file format. We also recommend that a
      file or class name and description of purpose be included on the
      same "printed page" as the copyright notice for easier
      identification within third-party archives.

   Copyright [yyyy] [name of copyright owner]

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.


================================================
FILE: README.md
================================================
# Auto

[![Build Status](https://github.com/google/auto/actions/workflows/ci.yml/badge.svg)](https://github.com/google/auto/actions/workflows/ci.yml)

A collection of source code generators for [Java][java].

## Overview

[Java][java] is full of code that is mechanical, repetitive, typically untested
and sometimes the source of subtle bugs. _Sounds like a job for robots!_

The Auto subprojects are a collection of code generators that automate those
types of tasks. They create the code you would have written, but without
the bugs.

Save time.  Save code.  Save sanity.

## Subprojects

  * [AutoFactory] - JSR-330-compatible factories

    [![Maven Central](https://img.shields.io/maven-central/v/com.google.auto.factory/auto-factory.svg)](https://mvnrepository.com/artifact/com.google.auto.factory/auto-factory)

  * [AutoService] - Provider-configuration files for [`ServiceLoader`]

    [![Maven Central](https://img.shields.io/maven-central/v/com.google.auto.service/auto-service.svg)](https://mvnrepository.com/artifact/com.google.auto.service/auto-service)

  * [AutoValue] - Immutable [value-type] code generation for Java 8+.

    [![Maven Central](https://img.shields.io/maven-central/v/com.google.auto.value/auto-value.svg)](https://mvnrepository.com/artifact/com.google.auto.value/auto-value)

  * [Common] - Helper utilities for writing annotation processors.

    [![Maven Central](https://img.shields.io/maven-central/v/com.google.auto/auto-common.svg)](https://mvnrepository.com/artifact/com.google.auto/auto-common)

## License

    Copyright 2013 Google LLC

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

[AutoFactory]: https://github.com/google/auto/tree/main/factory
[AutoService]: https://github.com/google/auto/tree/main/service
[AutoValue]: https://github.com/google/auto/tree/main/value
[Common]: https://github.com/google/auto/tree/main/common

[java]: https://en.wikipedia.org/wiki/Java_(programming_language)
[value-type]: http://en.wikipedia.org/wiki/Value_object
[`ServiceLoader`]: https://docs.oracle.com/en/java/javase/23/docs/api/java.base/java/util/ServiceLoader.html


================================================
FILE: build-pom.xml
================================================
<!-- A pure convenience for local builds and travis-ci. -->
<project>
  <modelVersion>4.0.0</modelVersion>
  <groupId>build-only</groupId>
  <artifactId>build-only</artifactId>
  <version>NO_VERSION</version>
  <packaging>pom</packaging>
  <modules>
    <module>common</module>
    <module>factory</module>
    <module>service</module>
    <module>value</module>
  </modules>
  <distributionManagement>
    <repository>
      <id>sonatype-nexus-staging</id>
      <name>Nexus Release Repository</name>
      <url>file:///tmp/auto_project_maven_fake_repo/</url>
    </repository>
    <snapshotRepository>
      <id>sonatype-nexus-snapshots</id>
      <name>Sonatype Nexus Snapshots</name>
      <url>file:///tmp/auto_project_maven_fake_repo/</url>
    </snapshotRepository>
  </distributionManagement>
</project>


================================================
FILE: common/README.md
================================================
# Auto Common Utilities

## Overview

The Auto project has a set of common utilities to help ease use of the
annotation processing environment.

## Utility classes of note

`MoreTypes`
:   Utilities and `Equivalence` wrappers for `TypeMirror` and related subtypes

`MoreElements`
:   Utilities for `Element` and related subtypes

`SuperficialValidation`
:   Very simple scanner to ensure an `Element` is valid and free from distortion
    from upstream compilation errors

`Visibility`
:   Utilities for working with `Element`s' visibility levels (public, protected,
    etc.)

`BasicAnnotationProcessor`/`Step`
:   Simple types that
    -   implement a validating annotation processor
    -   defer invalid elements until later
    -   break processor actions into multiple steps (which may each handle
        different annotations)

## Usage/Setup

Auto common utilities have a standard [Maven](http://maven.apache.org) setup
which can also be used from Gradle, Ivy, Ant, or other systems which consume
binary artifacts from the central Maven binary artifact repositories.

```xml
<dependency>
  <groupId>com.google.auto</groupId>
  <artifactId>auto-common</artifactId>
  <version>1.0-SNAPSHOT</version> <!-- or use a known release version -->
</dependency>
```


================================================
FILE: common/pom.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<!--
  Copyright 2014 Google LLC

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>com.google.auto</groupId>
  <artifactId>auto-common</artifactId>
  <version>HEAD-SNAPSHOT</version>
  <name>Auto Common Libraries</name>
  <description>
    Common utilities for creating annotation processors.
  </description>
  <url>https://github.com/google/auto/tree/main/common</url>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <java.version>1.8</java.version>
    <guava.version>33.5.0-jre</guava.version>
    <truth.version>1.4.5</truth.version>
  </properties>

  <scm>
    <url>http://github.com/google/auto</url>
    <connection>scm:git:git://github.com/google/auto.git</connection>
    <developerConnection>scm:git:ssh://git@github.com/google/auto.git</developerConnection>
    <tag>HEAD</tag>
  </scm>

  <issueManagement>
    <system>GitHub Issues</system>
    <url>http://github.com/google/auto/issues</url>
  </issueManagement>

  <licenses>
    <license>
      <name>Apache 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
    </license>
  </licenses>

  <organization>
    <name>Google LLC</name>
    <url>http://www.google.com</url>
  </organization>

  <dependencies>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>${guava.version}</version>
    </dependency>
    <dependency>
      <groupId>org.jspecify</groupId>
      <artifactId>jspecify</artifactId>
      <version>1.0.0</version>
    </dependency>
    <dependency>
      <!-- Used only by GeneratedAnnotationSpecs.
           If you use JavaPoet, you can use GeneratedAnnotationSpecs. -->
      <groupId>com.squareup</groupId>
      <artifactId>javapoet</artifactId>
      <version>1.13.0</version>
      <optional>true</optional>
    </dependency>

    <!-- test dependencies -->
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava-testlib</artifactId>
      <version>${guava.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.google.testing.compile</groupId>
      <artifactId>compile-testing</artifactId>
      <version>0.23.0</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.13.2</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.google.truth</groupId>
      <artifactId>truth</artifactId>
      <version>${truth.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.15.0</version>
        <configuration>
          <source>${java.version}</source>
          <target>${java.version}</target>
          <compilerArgument>-Xlint:all</compilerArgument>
          <showWarnings>true</showWarnings>
          <showDeprecation>true</showDeprecation>
          <testExcludes combine.children="append" />
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <version>3.5.0</version>
      </plugin>
      <plugin>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>3.12.0</version>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-source-plugin</artifactId>
        <version>3.4.0</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.sonatype.central</groupId>
        <artifactId>central-publishing-maven-plugin</artifactId>
        <version>0.10.0</version>
        <extensions>true</extensions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>test-with-ecj</id>
      <activation>
        <jdk>[17,)</jdk>
      </activation>
      <dependencies>
        <!-- test dependencies -->
        <dependency>
          <groupId>org.eclipse.jdt</groupId>
          <artifactId>ecj</artifactId>
          <version>3.45.0</version>
          <scope>test</scope>
        </dependency>
      </dependencies>
    </profile>

    <profile>
      <id>test-without-ecj</id>
      <activation>
        <jdk>(,17)</jdk>
      </activation>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
              <testExcludes>
                <exclude>**/OverridesTest.java</exclude>
              </testExcludes>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>sonatype-oss-release</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>3.2.8</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>


================================================
FILE: common/src/main/java/com/google/auto/common/AnnotationMirrors.java
================================================
/*
 * Copyright 2014 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.google.auto.common;

import static com.google.auto.common.MoreElements.isAnnotationPresent;
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.collect.ImmutableSet.toImmutableSet;
import static java.util.Collections.unmodifiableMap;

import com.google.common.base.Equivalence;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import java.lang.annotation.Annotation;
import java.util.Arrays;
import java.util.Map;
import javax.lang.model.element.AnnotationMirror;
import javax.lang.model.element.AnnotationValue;
import javax.lang.model.element.Element;
import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.TypeElement;
import javax.lang.model.type.DeclaredType;
import javax.lang.model.util.ElementFilter;
import javax.lang.model.util.Elements;

/**
 * A utility class for working with {@link AnnotationMirror} instances.
 *
 * @author Gregory Kick
 */
public final class AnnotationMirrors {
  private static final Equivalence<AnnotationMirror> ANNOTATION_MIRROR_EQUIVALENCE =
      new Equivalence<AnnotationMirror>() {
        @Override
        protected boolean doEquivalent(AnnotationMirror left, AnnotationMirror right) {
          return MoreTypes.equivalence()
                  .equivalent(left.getAnnotationType(), right.getAnnotationType())
              && AnnotationValues.equivalence()
                  .pairwise()
                  .equivalent(
                      getAnnotationValuesWithDefaults(left).values(),
                      getAnnotationValuesWithDefaults(right).values());
        }

        @Override
        protected int doHash(AnnotationMirror annotation) {
          DeclaredType type = annotation.getAnnotationType();
          Iterable<AnnotationValue> annotationValues =
              getAnnotationValuesWithDefaults(annotation).values();
          return Arrays.hashCode(
              new int[] {
                MoreTypes.equivalence().hash(type),
                AnnotationValues.equivalence().pairwise().hash(annotationValues)
              });
        }

        @Override
        public String toString() {
          return "AnnotationMirrors.equivalence()";
        }
      };

  /**
   * Returns an {@link Equivalence} for {@link AnnotationMirror} as some implementations delegate
   * equality tests to {@link Object#equals} whereas the documentation explicitly states that
   * instance/reference equality is not the proper test.
   */
  public static Equivalence<AnnotationMirror> equivalence() {
    return ANNOTATION_MIRROR_EQUIVALENCE;
  }

  /**
   * Returns the {@link AnnotationMirror}'s map of {@link AnnotationValue} indexed by {@link
   * ExecutableElement}, supplying default values from the annotation if the annotation property has
   * not been set. This is equivalent to {@link
   * Elements#getElementValuesWithDefaults(AnnotationMirror)} but can be called statically without
   * an {@link Elements} instance.
   *
   * <p>The iteration order of elements of the returned map will be the order in which the {@link
   * ExecutableElement}s are defined in {@code annotation}'s {@linkplain
   * AnnotationMirror#getAnnotationType() type}.
   */
  public static ImmutableMap<ExecutableElement, AnnotationValue> getAnnotationValuesWithDefaults(
      AnnotationMirror annotation) {
    ImmutableMap.Builder<ExecutableElement, AnnotationValue> values = ImmutableMap.builder();
    // Use unmodifiableMap to eliminate wildcards, which cause issues for our nullness checker.
    @SuppressWarnings("GetElementValues")
    Map<ExecutableElement, AnnotationValue> declaredValues =
        unmodifiableMap(annotation.getElementValues());
    for (ExecutableElement method :
        ElementFilter.methodsIn(annotation.getAnnotationType().asElement().getEnclosedElements())) {
      // Must iterate and put in this order, to ensure consistency in generated code.
      if (declaredValues.containsKey(method)) {
        values.put(method, declaredValues.get(method));
      } else if (method.getDefaultValue() != null) {
        values.put(method, method.getDefaultValue());
      } else {
        throw new IllegalStateException(
            "Unset annotation value without default should never happen: "
                + MoreElements.asType(method.getEnclosingElement()).getQualifiedName()
                + '.'
                + method.getSimpleName()
                + "()");
      }
    }
    return values.build();
  }

  /**
   * Returns an {@link AnnotationValue} for the named element if such an element was either declared
   * in the usage represented by the provided {@link AnnotationMirror}, or if such an element was
   * defined with a default.
   *
   * @throws IllegalArgumentException if no element is defined with the given elementName.
   */
  public static AnnotationValue getAnnotationValue(
      AnnotationMirror annotationMirror, String elementName) {
    return getAnnotationElementAndValue(annotationMirror, elementName).getValue();
  }

  /**
   * Returns a {@link ExecutableElement} and its associated {@link AnnotationValue} if such an
   * element was either declared in the usage represented by the provided {@link AnnotationMirror},
   * or if such an element was defined with a default.
   *
   * @throws IllegalArgumentException if no element is defined with the given elementName.
   */
  public static Map.Entry<ExecutableElement, AnnotationValue> getAnnotationElementAndValue(
      AnnotationMirror annotationMirror, final String elementName) {
    checkNotNull(annotationMirror);
    checkNotNull(elementName);
    for (Map.Entry<ExecutableElement, AnnotationValue> entry :
        getAnnotationValuesWithDefaults(annotationMirror).entrySet()) {
      if (entry.getKey().getSimpleName().contentEquals(elementName)) {
        return entry;
      }
    }
    throw new IllegalArgumentException(
        String.format(
            "@%s does not define an element %s()",
            MoreElements.asType(annotationMirror.getAnnotationType().asElement())
                .getQualifiedName(),
            elementName));
  }

  /**
   * Returns all {@linkplain AnnotationMirror annotations} that are present on the given {@link
   * Element} which are themselves annotated with {@code annotationClass}.
   */
  public static ImmutableSet<AnnotationMirror> getAnnotatedAnnotations(
      Element element, Class<? extends Annotation> annotationClass) {
    String name = annotationClass.getCanonicalName();
    if (name == null) {
      return ImmutableSet.of();
    }
    return getAnnotatedAnnotations(element, name);
  }

  /**
   * Returns all {@linkplain AnnotationMirror annotations} that are present on the given {@link
   * Element} which are themselves annotated with {@code annotation}.
   */
  public static ImmutableSet<AnnotationMirror> getAnnotatedAnnotations(
      Element element, TypeElement annotation) {
    return element.getAnnotationMirrors().stream()
        .filter(input -> isAnnotationPresent(input.getAnnotationType().asElement(), annotation))
        .collect(toImmutableSet());
  }

  /**
   * Returns all {@linkplain AnnotationMirror annotations} that are present on the given {@link
   * Element} which are themselves annotated with an annotation whose type's canonical name is
   * {@code annotationName}.
   */
  public static ImmutableSet<AnnotationMirror> getAnnotatedAnnotations(
      Element element, String annotationName) {
    return element.getAnnotationMirrors().stream()
        .filter(input -> isAnnotationPresent(input.getAnnotationType().asElement(), annotationName))
        .collect(toImmutableSet());
  }

  /**
   * Returns a string representation of the given annotation mirror, suitable for inclusion in a
   * Java source file to reproduce the annotation in source form.
   *
   * <p>Fully qualified names are used for types in annotations, class literals, and enum constants,
   * ensuring that the source form will compile without requiring additional imports.
   */
  public static String toString(AnnotationMirror annotationMirror) {
    return AnnotationOutput.toString(annotationMirror);
  }

  private AnnotationMirrors() {}
}


================================================
FILE: common/src/main/java/com/google/auto/common/AnnotationOutput.java
================================================
/*
 * Copyright 2014 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.google.auto.common;

import static com.google.auto.common.MoreTypes.asTypeElement;

import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Iterables;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.lang.model.element.AnnotationMirror;
import javax.lang.model.element.AnnotationValue;
import javax.lang.model.element.AnnotationValueVisitor;
import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.VariableElement;
import javax.lang.model.type.TypeMirror;
import javax.lang.model.util.SimpleAnnotationValueVisitor8;
import org.jspecify.annotations.Nullable;

/**
 * Handling of default values for annotation members.
 *
 * @author emcmanus@google.com (Éamonn McManus)
 */
final class AnnotationOutput {
  private AnnotationOutput() {} // There are no instances of this class.

  /**
   * Visitor that produces a string representation of an annotation value, suitable for inclusion in
   * a Java source file as an annotation member or as the initializer of a variable of the
   * appropriate type. The syntax for the two is the same except for annotation members that are
   * themselves annotations. Within an annotation, an annotation member can be written as
   * {@code @NestedAnnotation(...)}, while in an initializer it must be written as an object, for
   * example the construction of an {@code @AutoAnnotation} class. That's why we have this abstract
   * class and two concrete subclasses.
   */
  private static class SourceFormVisitor
      extends SimpleAnnotationValueVisitor8<@Nullable Void, StringBuilder> {

    private String formatType(TypeMirror typeMirror) {
      return asTypeElement(typeMirror).getQualifiedName().toString();
    }

    @Override
    protected @Nullable Void defaultAction(Object value, StringBuilder sb) {
      sb.append(value);
      return null;
    }

    @Override
    public @Nullable Void visitArray(List<? extends AnnotationValue> values, StringBuilder sb) {
      sb.append('{');
      String sep = "";
      for (AnnotationValue value : values) {
        sb.append(sep);
        visit(value, sb);
        sep = ", ";
      }
      sb.append('}');
      return null;
    }

    @Override
    public @Nullable Void visitByte(byte b, StringBuilder sb) {
      sb.append("(byte) ").append(b);
      return null;
    }

    @Override
    public @Nullable Void visitShort(short s, StringBuilder sb) {
      sb.append("(short) ").append(s);
      return null;
    }

    @Override
    public @Nullable Void visitChar(char c, StringBuilder sb) {
      appendQuoted(sb, c);
      return null;
    }

    @Override
    public @Nullable Void visitLong(long i, StringBuilder sb) {
      sb.append(i).append('L');
      return null;
    }

    @Override
    public @Nullable Void visitDouble(double d, StringBuilder sb) {
      if (Double.isNaN(d)) {
        sb.append("Double.NaN");
      } else if (d == Double.POSITIVE_INFINITY) {
        sb.append("Double.POSITIVE_INFINITY");
      } else if (d == Double.NEGATIVE_INFINITY) {
        sb.append("Double.NEGATIVE_INFINITY");
      } else {
        sb.append(d);
      }
      return null;
    }

    @Override
    public @Nullable Void visitFloat(float f, StringBuilder sb) {
      if (Float.isNaN(f)) {
        sb.append("Float.NaN");
      } else if (f == Float.POSITIVE_INFINITY) {
        sb.append("Float.POSITIVE_INFINITY");
      } else if (f == Float.NEGATIVE_INFINITY) {
        sb.append("Float.NEGATIVE_INFINITY");
      } else {
        sb.append(f).append('F');
      }
      return null;
    }

    @Override
    public @Nullable Void visitEnumConstant(VariableElement c, StringBuilder sb) {
      sb.append(formatType(c.asType())).append('.').append(c.getSimpleName());
      return null;
    }

    @Override
    public @Nullable Void visitString(String s, StringBuilder sb) {
      appendQuoted(sb, s);
      return null;
    }

    @Override
    public @Nullable Void visitType(TypeMirror classConstant, StringBuilder sb) {
      sb.append(formatType(classConstant)).append(".class");
      return null;
    }

    @Override
    public @Nullable Void visitAnnotation(AnnotationMirror a, StringBuilder sb) {
      sb.append('@').append(formatType(a.getAnnotationType()));
      ImmutableMap<ExecutableElement, AnnotationValue> map =
          ImmutableMap.copyOf(a.getElementValues());
      if (!map.isEmpty()) {
        sb.append('(');
        Optional<AnnotationValue> shortForm = shortForm(map);
        if (shortForm.isPresent()) {
          this.visit(maybeShorten(shortForm.get()), sb);
        } else {
          String sep = "";
          for (Map.Entry<ExecutableElement, AnnotationValue> entry : map.entrySet()) {
            sb.append(sep).append(entry.getKey().getSimpleName()).append(" = ");
            sep = ", ";
            this.visit(maybeShorten(entry.getValue()), sb);
          }
        }
        sb.append(')');
      }
      return null;
    }
  }

  private static AnnotationValue maybeShorten(AnnotationValue value) {
    return ARRAY_VISITOR.visit(value, value);
  }

  private static final AnnotationValueVisitor<AnnotationValue, AnnotationValue> ARRAY_VISITOR =
      new SimpleAnnotationValueVisitor8<AnnotationValue, AnnotationValue>() {
        @Override
        public AnnotationValue visitArray(
            List<? extends AnnotationValue> values, AnnotationValue input) {
          if (values.size() == 1) {
            // We can shorten @Foo(a = {23}) to @Foo(a = 23). For the specific case where `a` is
            // actually `value`, we'll already have shortened that in visitAnnotation, so
            // effectively we go from @Foo(value = {23}) to @Foo({23}) to @Foo(23).
            return Iterables.getOnlyElement(values);
          }
          return input;
        }

        @Override
        protected AnnotationValue defaultAction(Object o, AnnotationValue input) {
          return input;
        }
      };

  // We can shorten @Annot(value = 23) to @Annot(23).
  private static Optional<AnnotationValue> shortForm(
      Map<ExecutableElement, AnnotationValue> values) {
    if (values.size() == 1
        && Iterables.getOnlyElement(values.keySet()).getSimpleName().contentEquals("value")) {
      return Optional.of(Iterables.getOnlyElement(values.values()));
    }
    return Optional.empty();
  }

  /**
   * Returns a string representation of the given annotation value, suitable for inclusion in a Java
   * source file as the initializer of a variable of the appropriate type.
   */
  static String toString(AnnotationValue annotationValue) {
    StringBuilder sb = new StringBuilder();
    new SourceFormVisitor().visit(annotationValue, sb);
    return sb.toString();
  }

  /**
   * Returns a string representation of the given annotation mirror, suitable for inclusion in a
   * Java source file to reproduce the annotation in source form.
   */
  static String toString(AnnotationMirror annotationMirror) {
    StringBuilder sb = new StringBuilder();
    new SourceFormVisitor().visitAnnotation(annotationMirror, sb);
    return sb.toString();
  }

  private static StringBuilder appendQuoted(StringBuilder sb, String s) {
    sb.append('"');
    for (int i = 0; i < s.length(); i++) {
      appendEscaped(sb, s.charAt(i));
    }
    return sb.append('"');
  }

  private static StringBuilder appendQuoted(StringBuilder sb, char c) {
    sb.append('\'');
    appendEscaped(sb, c);
    return sb.append('\'');
  }

  private static void appendEscaped(StringBuilder sb, char c) {
    switch (c) {
      case '\\':
      case '"':
      case '\'':
        sb.append('\\').append(c);
        break;
      case '\n':
        sb.append("\\n");
        break;
      case '\r':
        sb.append("\\r");
        break;
      case '\t':
        sb.append("\\t");
        break;
      default:
        if (c < 0x20) {
          sb.append(String.format("\\%03o", (int) c));
        } else if (c < 0x7f || Character.isLetter(c)) {
          sb.append(c);
        } else {
          sb.append(String.format("\\u%04x", (int) c));
        }
        break;
    }
  }
}


================================================
FILE: common/src/main/java/com/google/auto/common/AnnotationValues.java
================================================
/*
 * Copyright 2014 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.google.auto.common;

import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.collect.ImmutableList.toImmutableList;

import com.google.common.base.Equivalence;
import com.google.common.collect.ImmutableList;
import java.util.List;
import java.util.function.Function;
import javax.lang.model.element.AnnotationMirror;
import javax.lang.model.element.AnnotationValue;
import javax.lang.model.element.VariableElement;
import javax.lang.model.type.DeclaredType;
import javax.lang.model.type.TypeMirror;
import javax.lang.model.util.SimpleAnnotationValueVisitor8;

/**
 * A utility class for working with {@link AnnotationValue} instances.
 *
 * @author Christian Gruber
 */
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 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 SimpleAnnotationValueVisitor8<Object, Void>() {
                            @Override
                            protected Object defaultAction(Object object, Void unused) {
                              return object;
                            }
                          },
                          null));
                }

                // LHS is an annotation mirror so test equivalence for RHS annotation mirrors
                // and false for other types.
                @Override
                public Boolean visitAnnotation(AnnotationMirror left, AnnotationValue right) {
                  return right.accept(
                      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.
                        }

                        @Override
                        public Boolean visitAnnotation(
                            AnnotationMirror right, AnnotationMirror left) {
                          return AnnotationMirrors.equivalence().equivalent(left, right);
                        }
                      },
                      left);
                }

                // LHS is a list of annotation values have to collect-test equivalences, or false
                // for any other types.
                @Override
                public Boolean visitArray(
                    List<? extends AnnotationValue> left, AnnotationValue right) {
                  return right.accept(
                      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.
                        }

                        @SuppressWarnings("unchecked") // safe covariant cast
                        @Override
                        public Boolean visitArray(
                            List<? extends AnnotationValue> right,
                            List<? extends AnnotationValue> left) {
                          return AnnotationValues.equivalence()
                              .pairwise()
                              .equivalent(
                                  (List<AnnotationValue>) left, (List<AnnotationValue>) right);
                        }
                      },
                      left);
                }

                @Override
                public Boolean visitType(TypeMirror left, AnnotationValue right) {
                  return right.accept(
                      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.
                        }

                        @Override
                        public Boolean visitType(TypeMirror right, TypeMirror left) {
                          return MoreTypes.equivalence().equivalent(left, right);
                        }
                      },
                      left);
                }
              },
              right);
        }

        @Override
        protected int doHash(AnnotationValue value) {
          return value.accept(
              new SimpleAnnotationValueVisitor8<Integer, Void>() {
                @Override
                public Integer visitAnnotation(AnnotationMirror value, Void ignore) {
                  return AnnotationMirrors.equivalence().hash(value);
                }

                @SuppressWarnings("unchecked") // safe covariant cast
                @Override
                public Integer visitArray(List<? extends AnnotationValue> values, Void ignore) {
                  return AnnotationValues.equivalence()
                      .pairwise()
                      .hash((List<AnnotationValue>) values);
                }

                @Override
                public Integer visitType(TypeMirror value, Void ignore) {
                  return MoreTypes.equivalence().hash(value);
                }

                @Override
                protected Integer defaultAction(Object value, Void ignored) {
                  return value.hashCode();
                }
              },
              null);
        }

        @Override
        public String toString() {
          return "AnnotationValues.equivalence()";
        }
      };

  /**
   * Returns an {@link Equivalence} for {@link AnnotationValue} as annotation values may contain
   * {@link AnnotationMirror} instances some of whose implementations delegate equality tests to
   * {@link Object#equals} whereas the documentation explicitly states that instance/reference
   * equality is not the proper test.
   *
   * @see AnnotationMirrors#equivalence()
   */
  public static Equivalence<AnnotationValue> equivalence() {
    return ANNOTATION_VALUE_EQUIVALENCE;
  }

  private static class DefaultVisitor<T> extends SimpleAnnotationValueVisitor8<T, Void> {
    final Class<T> clazz;

    DefaultVisitor(Class<T> clazz) {
      this.clazz = checkNotNull(clazz);
    }

    @Override
    public T defaultAction(Object o, Void unused) {
      throw new IllegalArgumentException(
          "Expected a " + clazz.getSimpleName() + ", got instead: " + o);
    }
  }

  private static final class TypeMirrorVisitor extends DefaultVisitor<DeclaredType> {
    static final TypeMirrorVisitor INSTANCE = new TypeMirrorVisitor();

    TypeMirrorVisitor() {
      super(DeclaredType.class);
    }

    @Override
    public DeclaredType visitType(TypeMirror value, Void unused) {
      return MoreTypes.asDeclared(value);
    }
  }
  ;

  /**
   * Returns the value as a class.
   *
   * @throws IllegalArgumentException if the value is not a class.
   */
  public static DeclaredType getTypeMirror(AnnotationValue value) {
    return TypeMirrorVisitor.INSTANCE.visit(value);
  }

  private static final class AnnotationMirrorVisitor extends DefaultVisitor<AnnotationMirror> {
    static final AnnotationMirrorVisitor INSTANCE = new AnnotationMirrorVisitor();

    AnnotationMirrorVisitor() {
      super(AnnotationMirror.class);
    }

    @Override
    public AnnotationMirror visitAnnotation(AnnotationMirror value, Void unused) {
      return value;
    }
  }
  ;

  /**
   * Returns the value as an AnnotationMirror.
   *
   * @throws IllegalArgumentException if the value is not an annotation.
   */
  public static AnnotationMirror getAnnotationMirror(AnnotationValue value) {
    return AnnotationMirrorVisitor.INSTANCE.visit(value);
  }

  private static final class EnumVisitor extends DefaultVisitor<VariableElement> {
    static final EnumVisitor INSTANCE = new EnumVisitor();

    EnumVisitor() {
      super(VariableElement.class);
    }

    @Override
    public VariableElement visitEnumConstant(VariableElement value, Void unused) {
      return value;
    }
  }

  /**
   * Returns the value as a VariableElement.
   *
   * @throws IllegalArgumentException if the value is not an enum.
   */
  public static VariableElement getEnum(AnnotationValue value) {
    return EnumVisitor.INSTANCE.visit(value);
  }

  private static <T> T valueOfType(AnnotationValue annotationValue, Class<T> type) {
    Object value = annotationValue.getValue();
    if (!type.isInstance(value)) {
      throw new IllegalArgumentException(
          "Expected " + type.getSimpleName() + ", got instead: " + value);
    }
    return type.cast(value);
  }

  /**
   * Returns the value as a string.
   *
   * @throws IllegalArgumentException if the value is not a string.
   */
  public static String getString(AnnotationValue value) {
    return valueOfType(value, String.class);
  }

  /**
   * Returns the value as an int.
   *
   * @throws IllegalArgumentException if the value is not an int.
   */
  public static int getInt(AnnotationValue value) {
    return valueOfType(value, Integer.class);
  }

  /**
   * Returns the value as a long.
   *
   * @throws IllegalArgumentException if the value is not a long.
   */
  public static long getLong(AnnotationValue value) {
    return valueOfType(value, Long.class);
  }

  /**
   * Returns the value as a byte.
   *
   * @throws IllegalArgumentException if the value is not a byte.
   */
  public static byte getByte(AnnotationValue value) {
    return valueOfType(value, Byte.class);
  }

  /**
   * Returns the value as a short.
   *
   * @throws IllegalArgumentException if the value is not a short.
   */
  public static short getShort(AnnotationValue value) {
    return valueOfType(value, Short.class);
  }

  /**
   * Returns the value as a float.
   *
   * @throws IllegalArgumentException if the value is not a float.
   */
  public static float getFloat(AnnotationValue value) {
    return valueOfType(value, Float.class);
  }

  /**
   * Returns the value as a double.
   *
   * @throws IllegalArgumentException if the value is not a double.
   */
  public static double getDouble(AnnotationValue value) {
    return valueOfType(value, Double.class);
  }

  /**
   * Returns the value as a boolean.
   *
   * @throws IllegalArgumentException if the value is not a boolean.
   */
  public static boolean getBoolean(AnnotationValue value) {
    return valueOfType(value, Boolean.class);
  }

  /**
   * Returns the value as a char.
   *
   * @throws IllegalArgumentException if the value is not a char.
   */
  public static char getChar(AnnotationValue value) {
    return valueOfType(value, Character.class);
  }

  private static final class ArrayVisitor<T>
      extends SimpleAnnotationValueVisitor8<ImmutableList<T>, Void> {
    final Function<AnnotationValue, T> visitT;

    ArrayVisitor(Function<AnnotationValue, T> visitT) {
      this.visitT = checkNotNull(visitT);
    }

    @Override
    public ImmutableList<T> defaultAction(Object o, Void unused) {
      throw new IllegalArgumentException("Expected an array, got instead: " + o);
    }

    @Override
    public ImmutableList<T> visitArray(List<? extends AnnotationValue> values, Void unused) {
      return values.stream().map(visitT).collect(toImmutableList());
    }
  }

  private static final ArrayVisitor<DeclaredType> TYPE_MIRRORS_VISITOR =
      new ArrayVisitor<>(AnnotationValues::getTypeMirror);

  /**
   * Returns the value as a list of classes.
   *
   * @throws IllegalArgumentException if the value is not an array of classes.
   */
  public static ImmutableList<DeclaredType> getTypeMirrors(AnnotationValue value) {
    return TYPE_MIRRORS_VISITOR.visit(value);
  }

  private static final ArrayVisitor<AnnotationMirror> ANNOTATION_MIRRORS_VISITOR =
      new ArrayVisitor<>(AnnotationValues::getAnnotationMirror);

  /**
   * Returns the value as a list of annotations.
   *
   * @throws IllegalArgumentException if the value if not an array of annotations.
   */
  public static ImmutableList<AnnotationMirror> getAnnotationMirrors(AnnotationValue value) {
    return ANNOTATION_MIRRORS_VISITOR.visit(value);
  }

  private static final ArrayVisitor<VariableElement> ENUMS_VISITOR =
      new ArrayVisitor<>(AnnotationValues::getEnum);

  /**
   * Returns the value as a list of enums.
   *
   * @throws IllegalArgumentException if the value is not an array of enums.
   */
  public static ImmutableList<VariableElement> getEnums(AnnotationValue value) {
    return ENUMS_VISITOR.visit(value);
  }

  private static final ArrayVisitor<String> STRINGS_VISITOR =
      new ArrayVisitor<>(AnnotationValues::getString);

  /**
   * Returns the value as a list of strings.
   *
   * @throws IllegalArgumentException if the value is not an array of strings.
   */
  public static ImmutableList<String> getStrings(AnnotationValue value) {
    return STRINGS_VISITOR.visit(value);
  }

  private static final ArrayVisitor<Integer> INTS_VISITOR =
      new ArrayVisitor<>(AnnotationValues::getInt);

  /**
   * Returns the value as a list of integers.
   *
   * @throws IllegalArgumentException if the value is not an array of ints.
   */
  public static ImmutableList<Integer> getInts(AnnotationValue value) {
    return INTS_VISITOR.visit(value);
  }

  private static final ArrayVisitor<Long> LONGS_VISITOR =
      new ArrayVisitor<>(AnnotationValues::getLong);

  /**
   * Returns the value as a list of longs.
   *
   * @throws IllegalArgumentException if the value is not an array of longs.
   */
  public static ImmutableList<Long> getLongs(AnnotationValue value) {
    return LONGS_VISITOR.visit(value);
  }

  private static final ArrayVisitor<Byte> BYTES_VISITOR =
      new ArrayVisitor<>(AnnotationValues::getByte);

  /**
   * Returns the value as a list of bytes.
   *
   * @throws IllegalArgumentException if the value is not an array of bytes.
   */
  public static ImmutableList<Byte> getBytes(AnnotationValue value) {
    return BYTES_VISITOR.visit(value);
  }

  private static final ArrayVisitor<Short> SHORTS_VISITOR =
      new ArrayVisitor<>(AnnotationValues::getShort);

  /**
   * Returns the value as a list of shorts.
   *
   * @throws IllegalArgumentException if the value is not an array of shorts.
   */
  public static ImmutableList<Short> getShorts(AnnotationValue value) {
    return SHORTS_VISITOR.visit(value);
  }

  private static final ArrayVisitor<Float> FLOATS_VISITOR =
      new ArrayVisitor<>(AnnotationValues::getFloat);

  /**
   * Returns the value as a list of floats.
   *
   * @throws IllegalArgumentException if the value is not an array of floats.
   */
  public static ImmutableList<Float> getFloats(AnnotationValue value) {
    return FLOATS_VISITOR.visit(value);
  }

  private static final ArrayVisitor<Double> DOUBLES_VISITOR =
      new ArrayVisitor<>(AnnotationValues::getDouble);

  /**
   * Returns the value as a list of doubles.
   *
   * @throws IllegalArgumentException if the value is not an array of doubles.
   */
  public static ImmutableList<Double> getDoubles(AnnotationValue value) {
    return DOUBLES_VISITOR.visit(value);
  }

  private static final ArrayVisitor<Boolean> BOOLEANS_VISITOR =
      new ArrayVisitor<>(AnnotationValues::getBoolean);

  /**
   * Returns the value as a list of booleans.
   *
   * @throws IllegalArgumentException if the value is not an array of booleans.
   */
  public static ImmutableList<Boolean> getBooleans(AnnotationValue value) {
    return BOOLEANS_VISITOR.visit(value);
  }

  private static final ArrayVisitor<Character> CHARS_VISITOR =
      new ArrayVisitor<>(AnnotationValues::getChar);

  /**
   * Returns the value as a list of characters.
   *
   * @throws IllegalArgumentException if the value is not an array of chars.
   */
  public static ImmutableList<Character> getChars(AnnotationValue value) {
    return CHARS_VISITOR.visit(value);
  }

  private static final ArrayVisitor<AnnotationValue> ANNOTATION_VALUES_VISITOR =
      new ArrayVisitor<>(x -> x);

  /**
   * Returns the value as a list of {@link AnnotationValue}s.
   *
   * @throws IllegalArgumentException if the value is not an array.
   */
  public static ImmutableList<AnnotationValue> getAnnotationValues(AnnotationValue value) {
    return ANNOTATION_VALUES_VISITOR.visit(value);
  }

  /**
   * Returns a string representation of the given annotation value, suitable for inclusion in a Java
   * source file as part of an annotation. For example, if {@code annotationValue} represents the
   * string {@code unchecked} in the annotation {@code @SuppressWarnings("unchecked")}, this method
   * will return the string {@code "unchecked"}, which you can then use as part of an annotation
   * being generated.
   *
   * <p>For all annotation values other than nested annotations, the returned string can also be
   * used to initialize a variable of the appropriate type.
   *
   * <p>Fully qualified names are used for types in annotations, class literals, and enum constants,
   * ensuring that the source form will compile without requiring additional imports.
   */
  public static String toString(AnnotationValue annotationValue) {
    return AnnotationOutput.toString(annotationValue);
  }

  private AnnotationValues() {}
}


================================================
FILE: common/src/main/java/com/google/auto/common/BasicAnnotationProcessor.java
================================================
/*
 * Copyright 2014 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.google.auto.common;

import static com.google.auto.common.MoreElements.asExecutable;
import static com.google.auto.common.MoreElements.asType;
import static com.google.auto.common.MoreElements.isAnnotationPresent;
import static com.google.auto.common.MoreElements.isType;
import static com.google.auto.common.SuperficialValidation.validateElement;
import static com.google.common.base.Preconditions.checkState;
import static com.google.common.collect.ImmutableList.toImmutableList;
import static com.google.common.collect.ImmutableMap.toImmutableMap;
import static com.google.common.collect.ImmutableSet.toImmutableSet;
import static com.google.common.collect.MoreCollectors.onlyElement;
import static com.google.common.collect.Multimaps.filterKeys;
import static java.util.Objects.requireNonNull;
import static javax.lang.model.element.ElementKind.CONSTRUCTOR;
import static javax.lang.model.element.ElementKind.METHOD;
import static javax.lang.model.element.ElementKind.PACKAGE;
import static javax.tools.Diagnostic.Kind.ERROR;
import static javax.tools.Diagnostic.Kind.WARNING;

import com.google.common.base.Ascii;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.ImmutableSetMultimap;
import com.google.common.collect.Iterables;
import com.google.common.collect.LinkedHashMultimap;
import com.google.common.collect.SetMultimap;
import com.google.common.collect.Sets;
import java.lang.annotation.Annotation;
import java.util.LinkedHashSet;
import java.util.Objects;
import java.util.Set;
import javax.annotation.processing.AbstractProcessor;
import javax.annotation.processing.Messager;
import javax.annotation.processing.ProcessingEnvironment;
import javax.annotation.processing.RoundEnvironment;
import javax.lang.model.element.Element;
import javax.lang.model.element.ElementKind;
import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.Name;
import javax.lang.model.element.PackageElement;
import javax.lang.model.element.Parameterizable;
import javax.lang.model.element.TypeElement;
import javax.lang.model.element.TypeParameterElement;
import javax.lang.model.element.VariableElement;
import javax.lang.model.util.Elements;
import org.jspecify.annotations.Nullable;

/**
 * An abstract {@link javax.annotation.processing.Processor Processor} implementation that defers
 * processing of {@link Element}s to later rounds if they cannot be processed.
 *
 * <p>Subclasses put their processing logic in {@link Step} implementations. The steps are passed to
 * the processor by returning them in the {@link #steps()} method, and can access the {@link
 * ProcessingEnvironment} using {@link #processingEnv}.
 *
 * <p>Any logic that needs to happen once per round can be specified by overriding {@link
 * #postRound(RoundEnvironment)}.
 *
 * <h2>Ill-formed elements are deferred</h2>
 *
 * Any annotated element whose nearest enclosing type is not well-formed is deferred, and not passed
 * to any {@code Step}. This helps processors to avoid many common pitfalls, such as {@link
 * javax.lang.model.type.ErrorType ErrorType} instances, {@link ClassCastException}s and badly
 * coerced types.
 *
 * <p>A non-package element is considered well-formed if its type, type parameters, parameters,
 * default values, supertypes, annotations, and enclosed elements are. Package elements are treated
 * similarly, except that their enclosed elements are not validated. See {@link
 * SuperficialValidation#validateElement(Element)} for details.
 *
 * <p>The primary disadvantage to this validation is that any element that forms a circular
 * dependency with a type generated by another {@code BasicAnnotationProcessor} will never compile
 * because the element will never be fully complete. All such compilations will fail with an error
 * message on the offending type that describes the issue.
 *
 * <h2>Each {@code Step} can defer elements</h2>
 *
 * <p>Each {@code Step} can defer elements by including them in the set returned by {@link
 * Step#process(ImmutableSetMultimap)}; elements deferred by a step will be passed back to that step
 * in a later round of processing.
 *
 * <p>This feature is useful when one processor may depend on code generated by another, independent
 * processor, in a way that isn't caught by the well-formedness check described above. For example,
 * if an element {@code A} cannot be processed because processing it depends on the existence of
 * some class {@code B}, then {@code A} should be deferred until a later round of processing, when
 * {@code B} will have been generated by another processor.
 *
 * <p>If {@code A} directly references {@code B}, then the well-formedness check will correctly
 * defer processing of {@code A} until {@code B} has been generated.
 *
 * <p>However, if {@code A} references {@code B} only indirectly (for example, from within a method
 * body), then the well-formedness check will not defer processing {@code A}, but a processing step
 * can reject {@code A}.
 */
public abstract class BasicAnnotationProcessor extends AbstractProcessor {

  /* For every element that is not module/package, to be well-formed its
   * enclosing-type in its entirety should be well-formed. Since modules
   * don't get annotated (and are not supported here) they can be ignored.
   */

  /**
   * Packages and types that have been deferred because either they themselves reference
   * as-yet-undefined types, or at least one of their contained elements does.
   */
  private final Set<ElementFactory> deferredEnclosingElements = new LinkedHashSet<>();

  /**
   * Elements that were explicitly deferred in some {@link Step} by being returned from {@link
   * Step#process}.
   */
  private final SetMultimap<Step, ElementFactory> elementsDeferredBySteps =
      LinkedHashMultimap.create();

  private Elements elementUtils;
  private Messager messager;
  private ImmutableList<? extends Step> steps;

  @Override
  public final synchronized void init(ProcessingEnvironment processingEnv) {
    super.init(processingEnv);
    this.elementUtils = processingEnv.getElementUtils();
    this.messager = processingEnv.getMessager();
    this.steps = ImmutableList.copyOf(steps());
  }

  /**
   * Creates {@linkplain ProcessingStep processing steps} for this processor. {@link #processingEnv}
   * is guaranteed to be set when this method is invoked.
   *
   * @deprecated Implement {@link #steps()} instead.
   */
  @Deprecated
  protected Iterable<? extends ProcessingStep> initSteps() {
    throw new AssertionError("If steps() is not implemented, initSteps() must be.");
  }

  /**
   * Creates {@linkplain Step processing steps} for this processor. {@link #processingEnv} is
   * guaranteed to be set when this method is invoked.
   *
   * <p>Note: If you are migrating some steps from {@link ProcessingStep} to {@link Step}, then you
   * can call {@link #asStep(ProcessingStep)} on any unmigrated steps.
   */
  protected Iterable<? extends Step> steps() {
    return Iterables.transform(initSteps(), BasicAnnotationProcessor::asStep);
  }

  /**
   * An optional hook for logic to be executed at the end of each round.
   *
   * @deprecated use {@link #postRound(RoundEnvironment)} instead
   */
  @Deprecated
  protected void postProcess() {}

  /** An optional hook for logic to be executed at the end of each round. */
  protected void postRound(RoundEnvironment roundEnv) {
    if (!roundEnv.processingOver()) {
      postProcess();
    }
  }

  private ImmutableSet<TypeElement> getSupportedAnnotationTypeElements() {
    checkState(steps != null);
    return steps.stream()
        .flatMap(step -> getSupportedAnnotationTypeElements(step).stream())
        .collect(toImmutableSet());
  }

  private ImmutableSet<TypeElement> getSupportedAnnotationTypeElements(Step step) {
    return step.annotations().stream()
        .map(elementUtils::getTypeElement)
        .filter(Objects::nonNull)
        .collect(toImmutableSet());
  }

  /**
   * Returns the set of supported annotation types as collected from registered {@linkplain Step
   * processing steps}.
   */
  @Override
  public final ImmutableSet<String> getSupportedAnnotationTypes() {
    checkState(steps != null);
    return steps.stream().flatMap(step -> step.annotations().stream()).collect(toImmutableSet());
  }

  @Override
  public final boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
    checkState(elementUtils != null);
    checkState(messager != null);
    checkState(steps != null);

    // If this is the last round, report all of the missing elements if there
    // were no errors raised in the round; otherwise reporting the missing
    // elements just adds noise to the output.
    if (roundEnv.processingOver()) {
      postRound(roundEnv);
      if (!roundEnv.errorRaised()) {
        reportMissingElements(
            ImmutableSet.<ElementFactory>builder()
                .addAll(deferredEnclosingElements)
                .addAll(elementsDeferredBySteps.values())
                .build());
      }
      return false;
    }

    process(getWellFormedElementsByAnnotationType(roundEnv));

    postRound(roundEnv);

    return false;
  }

  /** Processes the valid elements, including those previously deferred by each step. */
  private void process(ImmutableSetMultimap<TypeElement, Element> wellFormedElements) {
    for (Step step : steps) {
      ImmutableSet<TypeElement> annotationTypes = getSupportedAnnotationTypeElements(step);
      ImmutableSetMultimap<TypeElement, Element> stepElements =
          new ImmutableSetMultimap.Builder<TypeElement, Element>()
              .putAll(indexByAnnotation(elementsDeferredBySteps.get(step), annotationTypes))
              .putAll(filterKeys(wellFormedElements, annotationTypes::contains))
              .build();
      if (stepElements.isEmpty()) {
        elementsDeferredBySteps.removeAll(step);
      } else {
        Set<? extends Element> rejectedElements =
            step.process(toClassNameKeyedMultimap(stepElements));
        elementsDeferredBySteps.replaceValues(
            step,
            rejectedElements.stream()
                .map(element -> ElementFactory.forAnnotatedElement(element, messager))
                .collect(toImmutableList()));
      }
    }
  }

  private void reportMissingElements(Set<ElementFactory> missingElementFactories) {
    for (ElementFactory missingElementFactory : missingElementFactories) {
      Element missingElement = missingElementFactory.getElement(elementUtils);
      if (missingElement != null) {
        messager.printMessage(
            ERROR,
            processingErrorMessage("this " + Ascii.toLowerCase(missingElement.getKind().name())),
            missingElement);
      } else {
        messager.printMessage(ERROR, processingErrorMessage(missingElementFactory.toString));
      }
    }
  }

  private String processingErrorMessage(String target) {
    return String.format(
        "[%s:MiscError] %s was unable to process %s because not all of its dependencies could be "
            + "resolved. Check for compilation errors or a circular dependency with generated "
            + "code.",
        getClass().getSimpleName(), getClass().getCanonicalName(), target);
  }

  /**
   * Returns the superficially validated annotated elements of this round, including the validated
   * previously ill-formed elements. Also update {@link #deferredEnclosingElements}.
   *
   * <p>Note that the elements deferred by processing steps are guaranteed to be well-formed;
   * therefore, they are ignored (not returned) here, and they will be considered directly in the
   * {@link #process(ImmutableSetMultimap)} method.
   */
  private ImmutableSetMultimap<TypeElement, Element> getWellFormedElementsByAnnotationType(
      RoundEnvironment roundEnv) {
    ImmutableSet<ElementFactory> deferredEnclosingElementsCopy =
        ImmutableSet.copyOf(deferredEnclosingElements);
    deferredEnclosingElements.clear();

    ImmutableSetMultimap.Builder<TypeElement, Element> prevIllFormedElementsBuilder =
        ImmutableSetMultimap.builder();
    for (ElementFactory deferredElementFactory : deferredEnclosingElementsCopy) {
      Element deferredElement = deferredElementFactory.getElement(elementUtils);
      if (deferredElement != null) {
        findAnnotatedElements(
            deferredElement, getSupportedAnnotationTypeElements(), prevIllFormedElementsBuilder);
      } else {
        deferredEnclosingElements.add(deferredElementFactory);
      }
    }

    ImmutableSetMultimap<TypeElement, Element> prevIllFormedElements =
        prevIllFormedElementsBuilder.build();

    ImmutableSetMultimap.Builder<TypeElement, Element> wellFormedElementsBuilder =
        ImmutableSetMultimap.builder();

    // For optimization purposes, the ElementFactory instances for packages and types that have
    // already been verified to be well-formed are stored.
    Set<ElementFactory> wellFormedPackageOrTypeElements = new LinkedHashSet<>();

    /* Look at
     *   1. the previously ill-formed elements which have a present enclosing type (in case of
     *      Package element, the package itself), and
     *   2. the new elements from this round
     * and validate them.
     */
    for (TypeElement annotationType : getSupportedAnnotationTypeElements()) {
      Set<? extends Element> roundElements = roundEnv.getElementsAnnotatedWith(annotationType);

      for (Element element : Sets.union(roundElements, prevIllFormedElements.get(annotationType))) {
        // For every element that is not module/package, to be well-formed its
        // enclosing-type in its entirety should be well-formed. Since modules
        // don't get annotated (and not supported here) they can be ignored.
        Element enclosing = (element.getKind() == PACKAGE) ? element : getEnclosingType(element);
        ElementFactory enclosingFactory = ElementFactory.forAnnotatedElement(enclosing, messager);

        boolean isWellFormedElement =
            wellFormedPackageOrTypeElements.contains(enclosingFactory)
                || (!deferredEnclosingElements.contains(enclosingFactory)
                    && validateElement(enclosing));
        if (isWellFormedElement) {
          wellFormedElementsBuilder.put(annotationType, element);
          wellFormedPackageOrTypeElements.add(enclosingFactory);
        } else {
          deferredEnclosingElements.add(enclosingFactory);
        }
      }
    }

    return wellFormedElementsBuilder.build();
  }

  private ImmutableSetMultimap<TypeElement, Element> indexByAnnotation(
      Set<ElementFactory> annotatedElementFactories, ImmutableSet<TypeElement> annotationTypes) {
    ImmutableSetMultimap.Builder<TypeElement, Element> deferredElementsByAnnotationTypeBuilder =
        ImmutableSetMultimap.builder();
    for (ElementFactory elementFactory : annotatedElementFactories) {
      Element element = elementFactory.getElement(elementUtils);
      if (element != null) {
        for (TypeElement annotationType : annotationTypes) {
          if (isAnnotationPresent(element, annotationType)) {
            deferredElementsByAnnotationTypeBuilder.put(annotationType, element);
          }
        }
      }
    }
    return deferredElementsByAnnotationTypeBuilder.build();
  }

  /**
   * Adds {@code element} and its enclosed elements to {@code annotatedElements} if they are
   * annotated with any annotations in {@code annotationTypes}. Does not traverse to member types of
   * {@code element}, so that if {@code Outer} is passed in the example below, looking for
   * {@code @X}, then {@code Outer}, {@code Outer.foo}, and {@code Outer.foo()} will be added to the
   * multimap, but neither {@code Inner} nor its members will.
   *
   * <pre>{@code
   * @X class Outer {
   *   @X Object foo;
   *   @X void foo() {}
   *   @X static class Inner {
   *     @X Object bar;
   *     @X void bar() {}
   *   }
   * }
   * }</pre>
   */
  private static void findAnnotatedElements(
      Element element,
      ImmutableSet<TypeElement> annotationTypes,
      ImmutableSetMultimap.Builder<TypeElement, Element> annotatedElements) {
    for (Element enclosedElement : element.getEnclosedElements()) {
      if (!enclosedElement.getKind().isClass() && !enclosedElement.getKind().isInterface()) {
        findAnnotatedElements(enclosedElement, annotationTypes, annotatedElements);
      }
    }

    // element.getEnclosedElements() does NOT return parameter or type parameter elements

    Parameterizable parameterizable = null;
    if (isType(element)) {
      parameterizable = asType(element);
    } else if (isExecutable(element)) {
      ExecutableElement executableElement = asExecutable(element);
      parameterizable = executableElement;
      for (VariableElement parameterElement : executableElement.getParameters()) {
        findAnnotatedElements(parameterElement, annotationTypes, annotatedElements);
      }
    }
    if (parameterizable != null) {
      for (TypeParameterElement parameterElement : parameterizable.getTypeParameters()) {
        findAnnotatedElements(parameterElement, annotationTypes, annotatedElements);
      }
    }

    for (TypeElement annotationType : annotationTypes) {
      if (isAnnotationPresent(element, annotationType)) {
        annotatedElements.put(annotationType, element);
      }
    }
  }

  /**
   * Returns the nearest enclosing {@link TypeElement} to the current element, throwing an {@link
   * IllegalArgumentException} if the provided {@link Element} is not enclosed by a type.
   */
  // TODO(user) move to MoreElements and make public.
  private static TypeElement getEnclosingType(Element element) {
    Element enclosingTypeElement = element;
    while (enclosingTypeElement != null && !isType(enclosingTypeElement)) {
      enclosingTypeElement = enclosingTypeElement.getEnclosingElement();
    }

    if (enclosingTypeElement == null) {
      throw new IllegalArgumentException(element + " is not enclosed in any TypeElement.");
    }
    return asType(enclosingTypeElement);
  }

  private static ImmutableSetMultimap<String, Element> toClassNameKeyedMultimap(
      SetMultimap<TypeElement, Element> elements) {
    ImmutableSetMultimap.Builder<String, Element> builder = ImmutableSetMultimap.builder();
    elements
        .asMap()
        .forEach(
            (annotation, element) ->
                builder.putAll(annotation.getQualifiedName().toString(), element));
    return builder.build();
  }

  private static boolean isExecutable(Element element) {
    return element.getKind() == METHOD || element.getKind() == CONSTRUCTOR;
  }

  /**
   * Wraps the passed {@link ProcessingStep} in a {@link Step}. This is a convenience method to
   * allow incremental migration to a String-based API. This method can be used to return a not yet
   * converted {@link ProcessingStep} from {@link BasicAnnotationProcessor#steps()}.
   */
  protected static Step asStep(ProcessingStep processingStep) {
    return new ProcessingStepAsStep(processingStep);
  }

  /**
   * The unit of processing logic that runs under the guarantee that all elements are complete and
   * well-formed. A step may reject elements that are not ready for processing but may be at a later
   * round.
   */
  public interface Step {

    /**
     * The set of fully-qualified annotation type names processed by this step.
     *
     * <p>Warning: If the returned names are not names of annotations, they'll be ignored.
     */
    Set<String> annotations();

    /**
     * The implementation of processing logic for the step. It is guaranteed that the keys in {@code
     * elementsByAnnotation} will be a subset of the set returned by {@link #annotations()}.
     *
     * @return the elements (a subset of the values of {@code elementsByAnnotation}) that this step
     *     is unable to process, possibly until a later processing round. These elements will be
     *     passed back to this step at the next round of processing.
     */
    Set<? extends Element> process(ImmutableSetMultimap<String, Element> elementsByAnnotation);
  }

  /**
   * The unit of processing logic that runs under the guarantee that all elements are complete and
   * well-formed. A step may reject elements that are not ready for processing but may be at a later
   * round.
   *
   * @deprecated Implement {@link Step} instead. See {@link BasicAnnotationProcessor#steps()}.
   */
  @Deprecated
  public interface ProcessingStep {

    /** The set of annotation types processed by this step. */
    Set<? extends Class<? extends Annotation>> annotations();

    /**
     * The implementation of processing logic for the step. It is guaranteed that the keys in {@code
     * elementsByAnnotation} will be a subset of the set returned by {@link #annotations()}.
     *
     * @return the elements (a subset of the values of {@code elementsByAnnotation}) that this step
     *     is unable to process, possibly until a later processing round. These elements will be
     *     passed back to this step at the next round of processing.
     */
    Set<? extends Element> process(
        SetMultimap<Class<? extends Annotation>, Element> elementsByAnnotation);
  }

  private static class ProcessingStepAsStep implements Step {

    private final ProcessingStep processingStep;
    private final ImmutableMap<String, Class<? extends Annotation>> annotationsByName;

    ProcessingStepAsStep(ProcessingStep processingStep) {
      this.processingStep = processingStep;
      this.annotationsByName =
          processingStep.annotations().stream()
              .collect(
                  toImmutableMap(
                      c -> requireNonNull(c.getCanonicalName()),
                      (Class<? extends Annotation> aClass) -> aClass));
    }

    @Override
    public Set<String> annotations() {
      return annotationsByName.keySet();
    }

    @Override
    public Set<? extends Element> process(
        ImmutableSetMultimap<String, Element> elementsByAnnotation) {
      return processingStep.process(toClassKeyedMultimap(elementsByAnnotation));
    }

    private ImmutableSetMultimap<Class<? extends Annotation>, Element> toClassKeyedMultimap(
        SetMultimap<String, Element> elements) {
      ImmutableSetMultimap.Builder<Class<? extends Annotation>, Element> builder =
          ImmutableSetMultimap.builder();
      elements
          .asMap()
          .forEach(
              (annotationName, annotatedElements) -> {
                Class<? extends Annotation> annotation = annotationsByName.get(annotationName);
                if (annotation != null) { // should not be null
                  builder.putAll(annotation, annotatedElements);
                }
              });
      return builder.build();
    }
  }

  /* Element Factories */

  /**
   * A factory for looking up the "same" annotated element in a new round.
   *
   * <p>When deferring work across rounds, {@link BasicAnnotationProcessor} saves an {@link
   * ElementFactory} instead of an {@link Element}. It does this because an {@link Element} from one
   * round is not necessarily valid in future rounds.
   */
  private abstract static class ElementFactory {
    final String toString;

    private ElementFactory(Element element) {
      this.toString = element.toString();
    }

    /** An {@link ElementFactory} for an annotated element. */
    static ElementFactory forAnnotatedElement(Element element, Messager messager) {
      /* The name of the ElementKind constants is used instead to accommodate for RECORD
       * and RECORD_COMPONENT kinds, which are introduced in Java 16.
       */
      switch (element.getKind().name()) {
        case "PACKAGE":
          return new PackageElementFactory(element);
        case "CLASS":
        case "ENUM":
        case "INTERFACE":
        case "ANNOTATION_TYPE":
        case "RECORD":
          return new TypeElementFactory(element);
        case "TYPE_PARAMETER":
          return new TypeParameterElementFactory(element, messager);
        case "FIELD":
        case "ENUM_CONSTANT":
        case "RECORD_COMPONENT":
          return new FieldOrRecordComponentElementFactory(element);
        case "CONSTRUCTOR":
        case "METHOD":
          return new ExecutableElementFactory(element);
        case "PARAMETER":
          return new ParameterElementFactory(element);
        default:
          messager.printMessage(
              WARNING,
              String.format(
                  "%s does not support element type %s.",
                  ElementFactory.class.getCanonicalName(), element.getKind()));
          return new UnsupportedElementFactory(element);
      }
    }

    @Override
    public boolean equals(@Nullable Object object) {
      if (this == object) {
        return true;
      } else if (!(object instanceof ElementFactory)) {
        return false;
      }

      ElementFactory that = (ElementFactory) object;
      return this.toString.equals(that.toString);
    }

    @Override
    public int hashCode() {
      return toString.hashCode();
    }

    /**
     * Returns the {@link Element} corresponding to the name information saved in this factory, or
     * null if none exists.
     */
    abstract @Nullable Element getElement(Elements elementUtils);
  }

  /**
   * Saves the Element reference and returns it when inquired, with the hope that the same object
   * still represents that element, or the required information is present.
   */
  private static final class UnsupportedElementFactory extends ElementFactory {
    private final Element element;

    private UnsupportedElementFactory(Element element) {
      super(element);
      this.element = element;
    }

    @Override
    Element getElement(Elements elementUtils) {
      return element;
    }
  }

  /* It's unfortunate that we have to track types and packages separately, but since there are
   * two different methods to look them up in `Elements`, we end up with a lot of parallel
   * logic. :(
   */
  private static final class PackageElementFactory extends ElementFactory {
    private PackageElementFactory(Element element) {
      super(element);
    }

    @Override
    @Nullable PackageElement getElement(Elements elementUtils) {
      return elementUtils.getPackageElement(toString);
    }
  }

  private static final class TypeElementFactory extends ElementFactory {
    private TypeElementFactory(Element element) {
      super(element);
    }

    @Override
    @Nullable TypeElement getElement(Elements elementUtils) {
      return elementUtils.getTypeElement(toString);
    }
  }

  private static final class TypeParameterElementFactory extends ElementFactory {
    private final ElementFactory enclosingElementFactory;

    private TypeParameterElementFactory(Element element, Messager messager) {
      super(element);
      this.enclosingElementFactory =
          ElementFactory.forAnnotatedElement(element.getEnclosingElement(), messager);
    }

    @Override
    @Nullable TypeParameterElement getElement(Elements elementUtils) {
      Parameterizable enclosingElement =
          (Parameterizable) enclosingElementFactory.getElement(elementUtils);
      if (enclosingElement == null) {
        return null;
      }
      return enclosingElement.getTypeParameters().stream()
          .filter(typeParamElement -> toString.equals(typeParamElement.toString()))
          .collect(onlyElement());
    }

    @Override
    public boolean equals(@Nullable Object object) {
      if (this == object) {
        return true;
      } else if (!(object instanceof TypeParameterElementFactory)) {
        return false;
      }

      TypeParameterElementFactory that = (TypeParameterElementFactory) object;
      return this.toString.equals(that.toString)
          && this.enclosingElementFactory.equals(that.enclosingElementFactory);
    }

    @Override
    public int hashCode() {
      return Objects.hash(toString, enclosingElementFactory);
    }
  }

  /** Represents FIELD, ENUM_CONSTANT, and RECORD_COMPONENT */
  private static class FieldOrRecordComponentElementFactory extends ElementFactory {
    private final TypeElementFactory enclosingTypeElementFactory;
    private final ElementKind elementKind;

    private FieldOrRecordComponentElementFactory(Element element) {
      super(element); // toString is its simple name.
      this.enclosingTypeElementFactory = new TypeElementFactory(getEnclosingType(element));
      this.elementKind = element.getKind();
    }

    @Override
    @Nullable Element getElement(Elements elementUtils) {
      TypeElement enclosingTypeElement = enclosingTypeElementFactory.getElement(elementUtils);
      if (enclosingTypeElement == null) {
        return null;
      }
      return enclosingTypeElement.getEnclosedElements().stream()
          .filter(
              element ->
                  elementKind.equals(element.getKind()) && toString.equals(element.toString()))
          .collect(onlyElement());
    }

    @Override
    public boolean equals(@Nullable Object object) {
      if (!super.equals(object) || !(object instanceof FieldOrRecordComponentElementFactory)) {
        return false;
      }
      // To distinguish between a field and record_component
      FieldOrRecordComponentElementFactory that = (FieldOrRecordComponentElementFactory) object;
      return this.elementKind == that.elementKind;
    }

    @Override
    public int hashCode() {
      return Objects.hash(toString, elementKind);
    }
  }

  /**
   * Represents METHOD and CONSTRUCTOR.
   *
   * <p>The {@code equals()} and {@code hashCode()} have been overridden since the {@code toString}
   * alone is not sufficient to make a distinction in all overloaded cases. For example, {@code <C
   * extends Set<String>> void m(C c) {}}, and {@code <C extends SortedSet<String>> void m(C c) {}}
   * both have the same toString {@code <C>m(C)} but are valid cases for overloading methods.
   * Moreover, the needed enclosing type-element information is not included in the toString.
   *
   * <p>The executable element is retrieved by saving its enclosing type element, simple name, and
   * ordinal position in the source code relative to other related overloaded methods, meaning those
   * with the same simple name. This is possible because according to Java language specification
   * for {@link TypeElement#getEnclosedElements()}: "As a particular instance of the general
   * accuracy requirements and the ordering behavior required of this interface, the list of
   * enclosed elements will be returned to the natural order for the originating source of
   * information about the type. For example, if the information about the type is originating from
   * a source file, the elements will be returned in source code order. (However, in that case the
   * ordering of implicitly declared elements, such as default constructors, is not specified.)"
   *
   * <p>Simple name is saved since comparing the toString is not reliable when at least one
   * parameter references ERROR, possibly because it is not generated yet. For example, method
   * {@code void m(SomeGeneratedClass sgc)}, before the generation of {@code SomeGeneratedClass} has
   * the toString {@code m(SomeGeneratedClass)}; however, after the generation it will have toString
   * equal to {@code m(test.SomeGeneratedClass)} assuming that the package name is "test".
   */
  private static final class ExecutableElementFactory extends ElementFactory {
    private final TypeElementFactory enclosingTypeElementFactory;
    private final Name simpleName;

    /**
     * The index of the element among all elements of the same kind within the enclosing type. If
     * this is method {@code foo(...)} and the index is 0, that means that the method is the first
     * method called {@code foo} in the enclosing type.
     */
    private final int sameNameIndex;

    private ExecutableElementFactory(Element element) {
      super(element);
      TypeElement enclosingTypeElement = getEnclosingType(element);
      this.enclosingTypeElementFactory = new TypeElementFactory(enclosingTypeElement);
      this.simpleName = element.getSimpleName();

      ImmutableList<Element> methods = sameNameMethods(enclosingTypeElement, simpleName);
      this.sameNameIndex = methods.indexOf(element);
      checkState(this.sameNameIndex >= 0, "Did not find %s in %s", element, methods);
    }

    @Override
    @Nullable ExecutableElement getElement(Elements elementUtils) {
      TypeElement enclosingTypeElement = enclosingTypeElementFactory.getElement(elementUtils);
      if (enclosingTypeElement == null) {
        return null;
      }
      ImmutableList<Element> methods = sameNameMethods(enclosingTypeElement, simpleName);
      return asExecutable(methods.get(sameNameIndex));
    }

    private static ImmutableList<Element> sameNameMethods(
        TypeElement enclosingTypeElement, Name simpleName) {
      return enclosingTypeElement.getEnclosedElements().stream()
          .filter(element -> element.getSimpleName().equals(simpleName) && isExecutable(element))
          .collect(toImmutableList());
    }

    @Override
    public boolean equals(@Nullable Object object) {
      if (this == object) {
        return true;
      } else if (!(object instanceof ExecutableElementFactory)) {
        return false;
      }

      ExecutableElementFactory that = (ExecutableElementFactory) object;
      return this.simpleName.equals(that.simpleName)
          && this.sameNameIndex == that.sameNameIndex
          && this.enclosingTypeElementFactory.equals(that.enclosingTypeElementFactory);
    }

    @Override
    public int hashCode() {
      return Objects.hash(simpleName, sameNameIndex, enclosingTypeElementFactory);
    }
  }

  private static final class ParameterElementFactory extends ElementFactory {
    private final ExecutableElementFactory enclosingExecutableElementFactory;

    private ParameterElementFactory(Element element) {
      super(element);
      this.enclosingExecutableElementFactory =
          new ExecutableElementFactory(element.getEnclosingElement());
    }

    @Override
    @Nullable VariableElement getElement(Elements elementUtils) {
      ExecutableElement enclosingExecutableElement =
          enclosingExecutableElementFactory.getElement(elementUtils);
      if (enclosingExecutableElement == null) {
        return null;
      } else {
        return enclosingExecutableElement.getParameters().stream()
            .filter(paramElement -> toString.equals(paramElement.toString()))
            .collect(onlyElement());
      }
    }

    @Override
    public boolean equals(@Nullable Object object) {
      if (this == object) {
        return true;
      } else if (!(object instanceof ParameterElementFactory)) {
        return false;
      }

      ParameterElementFactory that = (ParameterElementFactory) object;
      return this.toString.equals(that.toString)
          && this.enclosingExecutableElementFactory.equals(that.enclosingExecutableElementFactory);
    }

    @Override
    public int hashCode() {
      return Objects.hash(toString, enclosingExecutableElementFactory);
    }
  }
}


================================================
FILE: common/src/main/java/com/google/auto/common/GeneratedAnnotationSpecs.java
================================================
/*
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.google.auto.common;

import com.squareup.javapoet.AnnotationSpec;
import com.squareup.javapoet.ClassName;
import java.util.Optional;
import javax.lang.model.SourceVersion;
import javax.lang.model.util.Elements;

/** Utility methods for writing {@code @Generated} annotations using JavaPoet. */
public final class GeneratedAnnotationSpecs {

  private GeneratedAnnotationSpecs() {}

  /**
   * Returns {@code @Generated("processorClass")} if either {@code
   * javax.annotation.processing.Generated} or {@code javax.annotation.Generated} is {@linkplain
   * GeneratedAnnotations#generatedAnnotation(Elements) available at compile time}.
   *
   * @deprecated prefer {@link #generatedAnnotationSpec(Elements, SourceVersion, Class)}
   */
  @Deprecated
  public static Optional<AnnotationSpec> generatedAnnotationSpec(
      Elements elements, Class<?> processorClass) {
    return generatedAnnotationSpecBuilder(elements, processorClass)
        .map(AnnotationSpec.Builder::build);
  }

  /**
   * Returns {@code @Generated(value = "processorClass", comments = "comments")} if either {@code
   * javax.annotation.processing.Generated} or {@code javax.annotation.Generated} is {@linkplain
   * GeneratedAnnotations#generatedAnnotation(Elements) available at compile time}.
   *
   * @deprecated prefer {@link #generatedAnnotationSpec(Elements, SourceVersion, Class, String)}
   */
  @Deprecated
  public static Optional<AnnotationSpec> generatedAnnotationSpec(
      Elements elements, Class<?> processorClass, String comments) {
    return generatedAnnotationSpecBuilder(elements, processorClass)
        .map(annotation -> annotation.addMember("comments", "$S", comments).build());
  }

  /**
   * Returns {@code @Generated("processorClass")} for the target {@code SourceVersion}.
   *
   * <p>Returns {@code javax.annotation.processing.Generated} for JDK 9 and newer, {@code
   * javax.annotation.Generated} for earlier releases, and Optional#empty()} if the annotation is
   * not available.
   */
  public static Optional<AnnotationSpec> generatedAnnotationSpec(
      Elements elements, SourceVersion sourceVersion, Class<?> processorClass) {
    return generatedAnnotationSpecBuilder(elements, sourceVersion, processorClass)
        .map(AnnotationSpec.Builder::build);
  }

  /**
   * Returns {@code @Generated(value = "processorClass", comments = "comments")} for the target
   * {@code SourceVersion}.
   *
   * <p>Returns {@code javax.annotation.processing.Generated} for JDK 9 and newer, {@code
   * javax.annotation.Generated} for earlier releases, and Optional#empty()} if the annotation is
   * not available.
   */
  public static Optional<AnnotationSpec> generatedAnnotationSpec(
      Elements elements, SourceVersion sourceVersion, Class<?> processorClass, String comments) {
    return generatedAnnotationSpecBuilder(elements, sourceVersion, processorClass)
        .map(annotation -> annotation.addMember("comments", "$S", comments).build());
  }

  private static Optional<AnnotationSpec.Builder> generatedAnnotationSpecBuilder(
      Elements elements, Class<?> processorClass) {
    return GeneratedAnnotations.generatedAnnotation(elements)
        .map(
            generated ->
                AnnotationSpec.builder(ClassName.get(generated))
                    .addMember("value", "$S", processorClass.getCanonicalName()));
  }

  private static Optional<AnnotationSpec.Builder> generatedAnnotationSpecBuilder(
      Elements elements, SourceVersion sourceVersion, Class<?> processorClass) {
    return GeneratedAnnotations.generatedAnnotation(elements, sourceVersion)
        .map(
            generated ->
                AnnotationSpec.builder(ClassName.get(generated))
                    .addMember("value", "$S", processorClass.getCanonicalName()));
  }
}


================================================
FILE: common/src/main/java/com/google/auto/common/GeneratedAnnotations.java
================================================
/*
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.google.auto.common;

import java.util.Optional;
import javax.lang.model.SourceVersion;
import javax.lang.model.element.TypeElement;
import javax.lang.model.util.Elements;

/** Utility methods for writing {@code @Generated} annotations. */
public final class GeneratedAnnotations {
  private GeneratedAnnotations() {}

  /**
   * Returns the element corresponding to the version of the {@code @Generated} annotation present
   * in the compile-time class- or module-path.
   *
   * <p>First looks for {@code javax.annotation.processing.Generated}, and then {@code
   * javax.annotation.Generated}. Returns whichever is in the classpath (or modulepath), or {@link
   * Optional#empty()} if neither is.
   *
   * @deprecated prefer {@link #generatedAnnotation(Elements, SourceVersion)}
   */
  @Deprecated
  public static Optional<TypeElement> generatedAnnotation(Elements elements) {
    TypeElement jdk9Generated = elements.getTypeElement("javax.annotation.processing.Generated");
    if (jdk9Generated != null) {
      return Optional.of(jdk9Generated);
    }
    return Optional.ofNullable(elements.getTypeElement("javax.annotation.Generated"));
  }

  /**
   * Returns the element corresponding to the {@code @Generated} annotation present at the target
   * {@code SourceVersion}.
   *
   * <p>Returns {@code javax.annotation.processing.Generated} for JDK 9 and newer, {@code
   * javax.annotation.Generated} for earlier releases, and Optional#empty()} if the annotation is
   * not available.
   */
  public static Optional<TypeElement> generatedAnnotation(
      Elements elements, SourceVersion sourceVersion) {
    return Optional.ofNullable(
        elements.getTypeElement(
            sourceVersion.compareTo(SourceVersion.RELEASE_8) > 0
                ? "javax.annotation.processing.Generated"
                : "javax.annotation.Generated"));
  }
}


================================================
FILE: common/src/main/java/com/google/auto/common/MoreElements.java
================================================
/*
 * Copyright 2013 Google LLC
 * Copyright (C) 2013 Square, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.google.auto.common;

import static com.google.common.collect.ImmutableSet.toImmutableSet;
import static javax.lang.model.element.ElementKind.PACKAGE;
import static javax.lang.model.element.Modifier.STATIC;

import com.google.auto.common.Overrides.ExplicitOverrides;
import com.google.common.annotations.Beta;
import com.google.common.base.Optional;
import com.google.common.base.Predicate;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.LinkedHashMultimap;
import com.google.common.collect.SetMultimap;
import java.lang.annotation.Annotation;
import java.util.Collection;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
import javax.lang.model.element.AnnotationMirror;
import javax.lang.model.element.Element;
import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.Modifier;
import javax.lang.model.element.PackageElement;
import javax.lang.model.element.TypeElement;
import javax.lang.model.element.TypeParameterElement;
import javax.lang.model.element.VariableElement;
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.SimpleElementVisitor8;
import javax.lang.model.util.Types;

/**
 * Static utility methods pertaining to {@link Element} instances.
 *
 * @author Gregory Kick
 */
@Beta
public final class MoreElements {
  /**
   * An alternate implementation of {@link Elements#getPackageOf} that does not require an {@link
   * Elements} instance.
   *
   * @throws NullPointerException if {@code element} is {@code null}
   */
  public static PackageElement getPackage(Element element) {
    while (element.getKind() != PACKAGE) {
      element = element.getEnclosingElement();
    }
    return (PackageElement) element;
  }

  private static final class PackageElementVisitor extends CastingElementVisitor<PackageElement> {
    private static final PackageElementVisitor INSTANCE = new PackageElementVisitor();

    PackageElementVisitor() {
      super("package element");
    }

    @Override
    public PackageElement visitPackage(PackageElement e, Void ignore) {
      return e;
    }
  }

  /**
   * Returns the given {@link Element} instance as {@link PackageElement}.
   *
   * <p>This method is functionally equivalent to an {@code instanceof} check and a cast, but should
   * always be used over that idiom as instructed in the documentation for {@link Element}.
   *
   * @throws NullPointerException if {@code element} is {@code null}
   * @throws IllegalArgumentException if {@code element} isn't a {@link PackageElement}.
   */
  public static PackageElement asPackage(Element element) {
    return element.accept(PackageElementVisitor.INSTANCE, null);
  }

  private static final class TypeElementVisitor extends CastingElementVisitor<TypeElement> {
    private static final TypeElementVisitor INSTANCE = new TypeElementVisitor();

    TypeElementVisitor() {
      super("type element");
    }

    @Override
    public TypeElement visitType(TypeElement e, Void ignore) {
      return e;
    }
  }

  /**
   * Returns true if the given {@link Element} instance is a {@link TypeElement}.
   *
   * <p>This method is functionally equivalent to an {@code instanceof} check, but should always be
   * used over that idiom as instructed in the documentation for {@link Element}.
   *
   * @throws NullPointerException if {@code element} is {@code null}
   */
  public static boolean isType(Element element) {
    return element.getKind().isClass() || element.getKind().isInterface();
  }

  /**
   * Returns the given {@link Element} instance as {@link TypeElement}.
   *
   * <p>This method is functionally equivalent to an {@code instanceof} check and a cast, but should
   * always be used over that idiom as instructed in the documentation for {@link Element}.
   *
   * @throws NullPointerException if {@code element} is {@code null}
   * @throws IllegalArgumentException if {@code element} isn't a {@link TypeElement}.
   */
  public static TypeElement asType(Element element) {
    return element.accept(TypeElementVisitor.INSTANCE, null);
  }

  /**
   * Returns the given {@link Element} instance as {@link TypeParameterElement}.
   *
   * <p>This method is functionally equivalent to an {@code instanceof} check and a cast, but should
   * always be used over that idiom as instructed in the documentation for {@link Element}.
   *
   * @throws NullPointerException if {@code element} is {@code null}
   * @throws IllegalArgumentException if {@code element} isn't a {@link TypeParameterElement}.
   */
  public static TypeParameterElement asTypeParameter(Element element) {
    return element.accept(TypeParameterElementVisitor.INSTANCE, null);
  }

  private static final class TypeParameterElementVisitor
      extends CastingElementVisitor<TypeParameterElement> {
    private static final TypeParameterElementVisitor INSTANCE = new TypeParameterElementVisitor();

    TypeParameterElementVisitor() {
      super("type parameter element");
    }

    @Override
    public TypeParameterElement visitTypeParameter(TypeParameterElement e, Void ignore) {
      return e;
    }
  }

  private static final class VariableElementVisitor extends CastingElementVisitor<VariableElement> {
    private static final VariableElementVisitor INSTANCE = new VariableElementVisitor();

    VariableElementVisitor() {
      super("variable element");
    }

    @Override
    public VariableElement visitVariable(VariableElement e, Void ignore) {
      return e;
    }
  }

  /**
   * Returns the given {@link Element} instance as {@link VariableElement}.
   *
   * <p>This method is functionally equivalent to an {@code instanceof} check and a cast, but should
   * always be used over that idiom as instructed in the documentation for {@link Element}.
   *
   * @throws NullPointerException if {@code element} is {@code null}
   * @throws IllegalArgumentException if {@code element} isn't a {@link VariableElement}.
   */
  public static VariableElement asVariable(Element element) {
    return element.accept(VariableElementVisitor.INSTANCE, null);
  }

  private static final class ExecutableElementVisitor
      extends CastingElementVisitor<ExecutableElement> {
    private static final ExecutableElementVisitor INSTANCE = new ExecutableElementVisitor();

    ExecutableElementVisitor() {
      super("executable element");
    }

    @Override
    public ExecutableElement visitExecutable(ExecutableElement e, Void label) {
      return e;
    }
  }

  /**
   * Returns the given {@link Element} instance as {@link ExecutableElement}.
   *
   * <p>This method is functionally equivalent to an {@code instanceof} check and a cast, but should
   * always be used over that idiom as instructed in the documentation for {@link Element}.
   *
   * @throws NullPointerException if {@code element} is {@code null}
   * @throws IllegalArgumentException if {@code element} isn't a {@link ExecutableElement}.
   */
  public static ExecutableElement asExecutable(Element element) {
    return element.accept(ExecutableElementVisitor.INSTANCE, null);
  }

  /**
   * Returns {@code true} iff the given element has an {@link AnnotationMirror} whose {@linkplain
   * AnnotationMirror#getAnnotationType() annotation type} has the same canonical name as that of
   * {@code annotationClass}. This method is a safer alternative to calling {@link
   * Element#getAnnotation} and checking for {@code null} as it avoids any interaction with
   * annotation proxies.
   */
  public static boolean isAnnotationPresent(
      Element element, Class<? extends Annotation> annotationClass) {
    return getAnnotationMirror(element, annotationClass).isPresent();
  }

  /**
   * Returns {@code true} iff the given element has an {@link AnnotationMirror} whose {@linkplain
   * AnnotationMirror#getAnnotationType() annotation type} has the same fully qualified name as that
   * of {@code annotation}. This method is a safer alternative to calling {@link
   * Element#getAnnotation} and checking for {@code null} as it avoids any interaction with
   * annotation proxies.
   */
  public static boolean isAnnotationPresent(Element element, TypeElement annotation) {
    return getAnnotationMirror(element, annotation).isPresent();
  }

  /**
   * Returns {@code true} iff the given element has an {@link AnnotationMirror} whose {@linkplain
   * AnnotationMirror#getAnnotationType() annotation type} has {@code annotationName} as its
   * canonical name. This method is a safer alternative to calling {@link Element#getAnnotation} and
   * checking for {@code null} as it avoids any interaction with annotation proxies.
   */
  public static boolean isAnnotationPresent(Element element, String annotationName) {
    return getAnnotationMirror(element, annotationName).isPresent();
  }

  /**
   * Returns an {@link AnnotationMirror} for the annotation of type {@code annotationClass} on
   * {@code element}, or {@link Optional#absent()} if no such annotation exists. This method is a
   * safer alternative to calling {@link Element#getAnnotation} as it avoids any interaction with
   * annotation proxies.
   */
  public static Optional<AnnotationMirror> getAnnotationMirror(
      Element element, Class<? extends Annotation> annotationClass) {
    String name = annotationClass.getCanonicalName();
    if (name == null) {
      return Optional.absent();
    }
    return getAnnotationMirror(element, name);
  }

  /**
   * Returns an {@link AnnotationMirror} for the annotation of type {@code annotation} on {@code
   * element}, or {@link Optional#absent()} if no such annotation exists. This method is a safer
   * alternative to calling {@link Element#getAnnotation} as it avoids any interaction with
   * annotation proxies.
   */
  public static Optional<AnnotationMirror> getAnnotationMirror(
      Element element, TypeElement annotation) {
    for (AnnotationMirror elementAnnotation : element.getAnnotationMirrors()) {
      if (elementAnnotation.getAnnotationType().asElement().equals(annotation)) {
        return Optional.of(elementAnnotation);
      }
    }
    return Optional.absent();
  }

  /**
   * Returns an {@link AnnotationMirror} for the annotation whose type's canonical name is on {@code
   * element}, or {@link Optional#absent()} if no such annotation exists. This method is a safer
   * alternative to calling {@link Element#getAnnotation} as it avoids any interaction with
   * annotation proxies.
   */
  public static Optional<AnnotationMirror> getAnnotationMirror(
      Element element, String annotationName) {
    for (AnnotationMirror annotationMirror : element.getAnnotationMirrors()) {
      TypeElement annotationTypeElement = asType(annotationMirror.getAnnotationType().asElement());
      if (annotationTypeElement.getQualifiedName().contentEquals(annotationName)) {
        return Optional.of(annotationMirror);
      }
    }
    return Optional.absent();
  }

  /**
   * Returns a {@link Predicate} that can be used to filter elements by {@link Modifier}. The
   * predicate returns {@code true} if the input {@link Element} has all of the given {@code
   * modifiers}, perhaps in addition to others.
   *
   * <p>Here is an example how one could get a List of static methods of a class:
   *
   * <pre>{@code
   * FluentIterable.from(ElementFilter.methodsIn(clazzElement.getEnclosedElements()))
   *     .filter(MoreElements.hasModifiers(Modifier.STATIC)).toList();
   * }</pre>
   */
  public static <T extends Element> Predicate<T> hasModifiers(Modifier... modifiers) {
    return hasModifiers(ImmutableSet.copyOf(modifiers));
  }

  /**
   * Returns a {@link Predicate} that can be used to filter elements by {@link Modifier}. The
   * predicate returns {@code true} if the input {@link Element} has all of the given {@code
   * modifiers}, perhaps in addition to others.
   *
   * <p>Here is an example how one could get a List of methods with certain modifiers of a class:
   *
   * <pre>{@code
   * Set<Modifier> modifiers = ...;
   * FluentIterable.from(ElementFilter.methodsIn(clazzElement.getEnclosedElements()))
   *     .filter(MoreElements.hasModifiers(modifiers)).toList();
   * }</pre>
   */
  public static <T extends Element> Predicate<T> hasModifiers(final Set<Modifier> modifiers) {
    return new Predicate<T>() {
      @Override
      public boolean apply(T input) {
        return input.getModifiers().containsAll(modifiers);
      }
    };
  }

  /**
   * Returns the set of all non-private, non-static methods from {@code type}, including methods
   * that it inherits from its ancestors. Inherited methods that are overridden are not included in
   * the result. So if {@code type} defines {@code public String toString()}, the returned set will
   * contain that method, but not the {@code toString()} method defined by {@code Object}.
   *
   * <p>The returned set may contain more than one method with the same signature, if {@code type}
   * inherits those methods from different ancestors. For example, if it inherits from unrelated
   * interfaces {@code One} and {@code Two} which each define {@code void foo();}, and if it does
   * not itself override the {@code foo()} method, then both {@code One.foo()} and {@code Two.foo()}
   * will be in the returned set.
   *
   * <p>The order of the returned set is deterministic: within a class or interface, methods are in
   * the order they appear in the source code; methods in ancestors come before methods in
   * descendants; methods in interfaces come before methods in classes; and in a class or interface
   * that has more than one superinterface, the interfaces are in the order of their appearance in
   * {@code implements} or {@code extends}.
   *
   * @param type the type whose own and inherited methods are to be returned
   * @param elementUtils an {@link Elements} object, typically returned by {@link
   *     javax.annotation.processing.AbstractProcessor#processingEnv processingEnv}.{@link
   *     javax.annotation.processing.ProcessingEnvironment#getElementUtils getElementUtils()}
   * @deprecated The method {@link #getLocalAndInheritedMethods(TypeElement, Types, Elements)} has
   *     better consistency between Java compilers.
   */
  @Deprecated
  public static ImmutableSet<ExecutableElement> getLocalAndInheritedMethods(
      TypeElement type, Elements elementUtils) {
    Overrides overrides = new Overrides.NativeOverrides(elementUtils);
    return getLocalAndInheritedMethods(type, overrides);
  }

  /**
   * Returns the set of all non-private, non-static methods from {@code type}, including methods
   * that it inherits from its ancestors. Inherited methods that are overridden are not included in
   * the result. So if {@code type} defines {@code public String toString()}, the returned set will
   * contain that method, but not the {@code toString()} method defined by {@code Object}.
   *
   * <p>The returned set may contain more than one method with the same signature, if {@code type}
   * inherits those methods from different ancestors. For example, if it inherits from unrelated
   * interfaces {@code One} and {@code Two} which each define {@code void foo();}, and if it does
   * not itself override the {@code foo()} method, then both {@code One.foo()} and {@code Two.foo()}
   * will be in the returned set.
   *
   * <p>The order of the returned set is deterministic: within a class or interface, methods are in
   * the order they appear in the source code; methods in ancestors come before methods in
   * descendants; methods in interfaces come before methods in classes; and in a class or interface
   * that has more than one superinterface, the interfaces are in the order of their appearance in
   * {@code implements} or {@code extends}.
   *
   * @param type the type whose own and inherited methods are to be returned
   * @param typeUtils a {@link Types} object, typically returned by {@link
   *     javax.annotation.processing.AbstractProcessor#processingEnv processingEnv}.{@link
   *     javax.annotation.processing.ProcessingEnvironment#getTypeUtils getTypeUtils()}
   * @param elementUtils an {@link Elements} object, typically returned by {@link
   *     javax.annotation.processing.AbstractProcessor#processingEnv processingEnv}.{@link
   *     javax.annotation.processing.ProcessingEnvironment#getElementUtils getElementUtils()}
   */
  public static ImmutableSet<ExecutableElement> getLocalAndInheritedMethods(
      TypeElement type, Types typeUtils, Elements elementUtils) {
    return getLocalAndInheritedMethods(type, new ExplicitOverrides(typeUtils));
  }

  private static ImmutableSet<ExecutableElement> getLocalAndInheritedMethods(
      TypeElement type, Overrides overrides) {
    PackageElement pkg = getPackage(type);

    ImmutableSet.Builder<ExecutableElement> methods = ImmutableSet.builder();
    for (ExecutableElement method : getAllMethods(type, overrides)) {
      // Filter out all static and non-visible methods.
      if (!method.getModifiers().contains(STATIC) && methodVisibleFromPackage(method, pkg)) {
        methods.add(method);
      }
    }
    return methods.build();
  }

  /**
   * Tests whether one method, as a member of a given type, overrides another method.
   *
   * <p>This method does the same thing as {@link Elements#overrides(ExecutableElement,
   * ExecutableElement, TypeElement)}, but in a way that is more consistent between compilers, in
   * particular between javac and ecj (the Eclipse compiler).
   *
   * @param overrider the first method, possible overrider
   * @param overridden the second method, possibly being overridden
   * @param type the type of which the first method is a member
   * @return {@code true} if and only if the first method overrides the second
   */
  public static boolean overrides(
      ExecutableElement overrider,
      ExecutableElement overridden,
      TypeElement type,
      Types typeUtils) {
    return new ExplicitOverrides(typeUtils).overrides(overrider, overridden, type);
  }

  /**
   * Returns the set of all methods from {@code type}, including methods that it inherits from its
   * ancestors. Inherited methods that are overridden are not included in the result. So if {@code
   * type} defines {@code public String toString()}, the returned set will contain that method, but
   * not the {@code toString()} method defined by {@code Object}.
   *
   * <p>The returned set may contain more than one method with the same signature, if {@code type}
   * inherits those methods from different ancestors. For example, if it inherits from unrelated
   * interfaces {@code One} and {@code Two} which each define {@code void foo();}, and if it does
   * not itself override the {@code foo()} method, then both {@code One.foo()} and {@code Two.foo()}
   * will be in the returned set.
   *
   * <p>The order of the returned set is deterministic: within a class or interface, methods are in
   * the order they appear in the source code; methods in ancestors come before methods in
   * descendants; methods in interfaces come before methods in classes; and in a class or interface
   * that has more than one superinterface, the interfaces are in the order of their appearance in
   * {@code implements} or {@code extends}.
   *
   * @param type the type whose own and inherited methods are to be returned
   * @param typeUtils a {@link Types} object, typically returned by {@link
   *     javax.annotation.processing.AbstractProcessor#processingEnv processingEnv}.{@link
   *     javax.annotation.processing.ProcessingEnvironment#getTypeUtils getTypeUtils()}
   * @param elementUtils an {@link Elements} object, typically returned by {@link
   *     javax.annotation.processing.AbstractProcessor#processingEnv processingEnv}.{@link
   *     javax.annotation.processing.ProcessingEnvironment#getElementUtils getElementUtils()}
   */
  public static ImmutableSet<ExecutableElement> getAllMethods(
      TypeElement type, Types typeUtils, Elements elementUtils) {
    return getAllMethods(type, new ExplicitOverrides(typeUtils));
  }

  private static ImmutableSet<ExecutableElement> getAllMethods(
      TypeElement type, Overrides overrides) {
    SetMultimap<String, ExecutableElement> methodMap = LinkedHashMultimap.create();
    getAllMethods(type, methodMap);
    // Find methods that are overridden. We do this using `Elements.overrides`, which means
    // that it is inherently a quadratic operation, since we have to compare every method against
    // every other method. We reduce the performance impact by (a) grouping methods by name, since
    // a method cannot override another method with a different name, and (b) making sure that
    // methods in ancestor types precede those in descendant types, which means we only have to
    // check a method against the ones that follow it in that order.
    Set<ExecutableElement> overridden = new LinkedHashSet<ExecutableElement>();
    for (Collection<ExecutableElement> methods : methodMap.asMap().values()) {
      List<ExecutableElement> methodList = ImmutableList.copyOf(methods);
      for (int i = 0; i < methodList.size(); i++) {
        ExecutableElement methodI = methodList.get(i);
        for (int j = i + 1; j < methodList.size(); j++) {
          ExecutableElement methodJ = methodList.get(j);
          if (overrides.overrides(methodJ, methodI, type)) {
            overridden.add(methodI);
            break;
          }
        }
      }
    }
    return methodMap.values().stream()
        .filter(m -> !overridden.contains(m))
        .collect(toImmutableSet());
  }

  // Add to `methods` the static and instance methods from `type`. This means all methods from
  // `type` itself and all methods it inherits from its ancestors. This method does not take
  // overriding into account, so it will add both an ancestor method and a descendant method that
  // overrides it. `methods` is a multimap from a method name to all of the methods with that name,
  // including methods that override or overload one another. Within those methods, those in
  // ancestor types always precede those in descendant types.
  private static void getAllMethods(
      TypeElement type, SetMultimap<String, ExecutableElement> methods) {
    for (TypeMirror superInterface : type.getInterfaces()) {
      getAllMethods(MoreTypes.asTypeElement(superInterface), methods);
    }
    if (type.getSuperclass().getKind() != TypeKind.NONE) {
      // Visit the superclass after superinterfaces so we will always see the implementation of a
      // method after any interfaces that declared it.
      getAllMethods(MoreTypes.asTypeElement(type.getSuperclass()), methods);
    }
    for (ExecutableElement method : ElementFilter.methodsIn(type.getEnclosedElements())) {
      methods.put(method.getSimpleName().toString(), method);
    }
  }

  static boolean methodVisibleFromPackage(ExecutableElement method, PackageElement pkg) {
    // We use Visibility.ofElement rather than .effectiveVisibilityOfElement because it doesn't
    // really matter whether the containing class is visible. If you inherit a public method
    // then you have a public method, regardless of whether you inherit it from a public class.
    Visibility visibility = Visibility.ofElement(method);
    switch (visibility) {
      case PRIVATE:
        return false;
      case DEFAULT:
        return getPackage(method).equals(pkg);
      default:
        return true;
    }
  }

  private abstract static class CastingElementVisitor<T> extends SimpleElementVisitor8<T, Void> {
    private final String label;

    CastingElementVisitor(String label) {
      this.label = label;
    }

    @Override
    protected final T defaultAction(Element e, Void ignore) {
      throw new IllegalArgumentException(e + " does not represent a " + label);
    }
  }

  private MoreElements() {}
}


================================================
FILE: common/src/main/java/com/google/auto/common/MoreStreams.java
================================================
/*
 * Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.google.auto.common;

import static java.util.stream.Collectors.collectingAndThen;
import static java.util.stream.Collectors.toList;

import com.google.common.collect.ImmutableBiMap;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Maps;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collector;
import java.util.stream.Collectors;

/**
 * A utility class that provides legacy alternatives to Guava's streaming APIs.
 *
 * <p>This class was useful when those APIs were not part of the Android flavor of Guava, since the
 * Android flavor somehow finds its way onto the processor classpath. Now that the APIs are part of
 * the Android flavor of Guava, there is no need for this class.
 */
public final class MoreStreams {

  /** Returns a collector for an {@link ImmutableList}. */
  public static <T> Collector<T, ?, ImmutableList<T>> toImmutableList() {
    return collectingAndThen(toList(), ImmutableList::copyOf);
  }

  /** Returns a collector for an {@link ImmutableSet}. */
  public static <T> Collector<T, ?, ImmutableSet<T>> toImmutableSet() {
    return collectingAndThen(toList(), ImmutableSet::copyOf);
  }

  /** Returns a collector for an {@link ImmutableMap}. */
  public static <T, K, V> Collector<T, ?, ImmutableMap<K, V>> toImmutableMap(
      Function<? super T, K> keyMapper, Function<? super T, V> valueMapper) {
    return Collectors.mapping(
        value -> Maps.immutableEntry(keyMapper.apply(value), valueMapper.apply(value)),
        Collector.of(
            ImmutableMap::builder,
            (ImmutableMap.Builder<K, V> builder, Map.Entry<K, V> entry) -> builder.put(entry),
            (left, right) -> left.putAll(right.build()),
            ImmutableMap.Builder::build));
  }

  /** Returns a collector for an {@link ImmutableBiMap}. */
  public static <T, K, V> Collector<T, ?, ImmutableBiMap<K, V>> toImmutableBiMap(
      Function<? super T, K> keyMapper, Function<? super T, V> valueMapper) {
    return Collectors.mapping(
        value -> Maps.immutableEntry(keyMapper.apply(value), valueMapper.apply(value)),
        Collector.of(
            ImmutableBiMap::builder,
            (ImmutableBiMap.Builder<K, V> builder, Map.Entry<K, V> entry) -> builder.put(entry),
            (left, right) -> left.putAll(right.build()),
            ImmutableBiMap.Builder::build));
  }

  private MoreStreams() {}
}


================================================
FILE: common/src/main/java/com/google/auto/common/MoreTypes.java
================================================
/*
 * Copyright 2014 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.google.auto.common;

import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.Preconditions.checkState;
import static javax.lang.model.type.TypeKind.ARRAY;
import static javax.lang.model.type.TypeKind.DECLARED;
import static javax.lang.model.type.TypeKind.EXECUTABLE;
import static javax.lang.model.type.TypeKind.INTERSECTION;
import static javax.lang.model.type.TypeKind.TYPEVAR;
import static javax.lang.model.type.TypeKind.WILDCARD;

import com.google.common.base.Equivalence;
import com.google.common.base.Optional;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import javax.lang.model.element.Element;
import javax.lang.model.element.ElementKind;
import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.Modifier;
import javax.lang.model.element.TypeElement;
import javax.lang.model.element.TypeParameterElement;
import javax.lang.model.element.VariableElement;
import javax.lang.model.type.ArrayType;
import javax.lang.model.type.DeclaredType;
import javax.lang.model.type.ErrorType;
import javax.lang.model.type.ExecutableType;
import javax.lang.model.type.IntersectionType;
import javax.lang.model.type.NoType;
import javax.lang.model.type.NullType;
import javax.lang.model.type.PrimitiveType;
import javax.lang.model.type.TypeKind;
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.SimpleTypeVisitor8;
import javax.lang.model.util.Types;
import org.jspecify.annotations.Nullable;

/**
 * Utilities related to {@link TypeMirror} instances.
 *
 * @author Gregory Kick
 * @since 2.0
 */
public final class MoreTypes {
  private static final class TypeEquivalence extends Equivalence<TypeMirror> {
    private static final TypeEquivalence INSTANCE = new TypeEquivalence();

    @Override
    protected boolean doEquivalent(TypeMirror a, TypeMirror b) {
      return MoreTypes.equal(a, b, ImmutableSet.<ComparedElements>of());
    }

    @Override
    protected int doHash(TypeMirror t) {
      return MoreTypes.hash(t, ImmutableSet.<Element>of());
    }

    @Override
    public String toString() {
      return "MoreTypes.equivalence()";
    }
  }

  /**
   * Returns an {@link Equivalence} that can be used to compare types. The standard way to compare
   * types is {@link javax.lang.model.util.Types#isSameType Types.isSameType}, but this alternative
   * may be preferred in a number of cases:
   *
   * <ul>
   *   <li>If you don't have an instance of {@code Types}.
   *   <li>If you want a reliable {@code hashCode()} for the types, for example to construct a set
   *       of types using {@link java.util.HashSet} with {@link Equivalence#wrap(Object)}.
   *   <li>If you want distinct type variables to be considered equal if they have the same names
   *       and bounds.
   *   <li>If you want wildcard types to compare equal if they have the same bounds. {@code
   *       Types.isSameType} never considers wildcards equal, even when comparing a type to itself.
   * </ul>
   */
  public static Equivalence<TypeMirror> equivalence() {
    return TypeEquivalence.INSTANCE;
  }

  // So EQUAL_VISITOR can be a singleton, we maintain visiting state, in particular which types
  // have been seen already, in this object.
  // The logic for handling recursive types like Comparable<T extends Comparable<T>> is very tricky.
  // If we're not careful we'll end up with an infinite recursion. So we record the types that
  // we've already seen during the recursion, and if we see the same pair of types again we just
  // return true provisionally. But "the same pair of types" is itself poorly-defined. We can't
  // just say that it is an equal pair of TypeMirrors, because of course if we knew how to
  // determine that then we wouldn't need the complicated type visitor at all. On the other hand,
  // we can't say that it is an identical pair of TypeMirrors either, because there's no
  // guarantee that the TypeMirrors for the two Ts in Comparable<T extends Comparable<T>> will be
  // represented by the same object, and indeed with the Eclipse compiler they aren't. We could
  // compare the corresponding Elements, since equality is well-defined there, but that's not enough
  // either, because the Element for Set<Object> is the same as the one for Set<String>. So we
  // approximate by comparing the Elements and, if there are any type arguments, requiring them to
  // be identical. This may not be foolproof either but it is sufficient for all the cases we've
  // encountered so far.
  private static final class EqualVisitorParam {
    TypeMirror type;
    Set<ComparedElements> visiting;
  }

  private static class ComparedElements {
    final Element a;
    final ImmutableList<TypeMirror> aArguments;
    final Element b;
    final ImmutableList<TypeMirror> bArguments;

    ComparedElements(
        Element a,
        ImmutableList<TypeMirror> aArguments,
        Element b,
        ImmutableList<TypeMirror> bArguments) {
      this.a = a;
      this.aArguments = aArguments;
      this.b = b;
      this.bArguments = bArguments;
    }

    @Override
    public boolean equals(@Nullable Object o) {
      if (!(o instanceof ComparedElements)) {
        return false;
      }
      ComparedElements that = (ComparedElements) o;

      int nArguments = this.aArguments.size();
      if (nArguments != that.aArguments.size()) {
        return false;
      }
      // The arguments must be the same size, but we check anyway.
      if (nArguments != this.bArguments.size() || nArguments != that.bArguments.size()) {
        return false;
      }

      if (!this.a.equals(that.a) || !this.b.equals(that.b)) {
        return false;
      }

      /*
       * The purpose here is just to avoid the infinite recursion that we would otherwise have
       * if Enum<E extends Enum<E>> is compared against itself, for example. If we are able to
       * see that the inner Enum<E> is the same object as the outer one then we don't need a
       * recursive call to compare the "a" Enum<E> against the "b" Enum<E>. The same-object check
       * may not be completely justified, but it relies on the practical assumption that the
       * compiler is not going to conjure up an infinite regress of objects to represent this
       * recursive type. Other comparison methods like comparing their toString() are expensive
       * and not warranted.
       */
      for (int i = 0; i < nArguments; i++) {
        if (this.aArguments.get(i) != that.aArguments.get(i)) {
          return false;
        }
        if (this.bArguments.get(i) != that.bArguments.get(i)) {
          return false;
        }
      }

      return true;
    }

    @Override
    public int hashCode() {
      return a.hashCode() * 31 + b.hashCode();
    }
  }

  private static final class EqualVisitor extends SimpleTypeVisitor8<Boolean, EqualVisitorParam> {
    private static final EqualVisitor INSTANCE = new EqualVisitor();

    @Override
    protected Boolean defaultAction(TypeMirror a, EqualVisitorParam p) {
      return a.getKind().equals(p.type.getKind());
    }

    @Override
    public Boolean visitArray(ArrayType a, EqualVisitorParam p) {
      if (p.type.getKind().equals(ARRAY)) {
        ArrayType b = (ArrayType) p.type;
        return equal(a.getComponentType(), b.getComponentType(), p.visiting);
      }
      return false;
    }

    @Override
    public Boolean visitDeclared(DeclaredType a, EqualVisitorParam p) {
      if (p.type.getKind().equals(DECLARED)) {
        DeclaredType b = (DeclaredType) p.type;
        Element aElement = a.asElement();
        Element bElement = b.asElement();
        Set<ComparedElements> newVisiting =
            visitingSetPlus(
                p.visiting, aElement, a.getTypeArguments(), bElement, b.getTypeArguments());
        if (newVisiting.equals(p.visiting)) {
          // We're already visiting this pair of elements.
          // This can happen for example with Enum in Enum<E extends Enum<E>>. Return a
          // provisional true value since if the Elements are not in fact equal the original
          // visitor of Enum will discover that. We have to check both Elements being compared
          // though to avoid missing the fact that one of the types being compared
          // differs at exactly this point.
          return true;
        }
        return aElement.equals(bElement)
            && equal(enclosingType(a), enclosingType(b), newVisiting)
            && equalLists(a.getTypeArguments(), b.getTypeArguments(), newVisiting);
      }
      return false;
    }

    @Override
    @SuppressWarnings("TypeEquals")
    public Boolean visitError(ErrorType a, EqualVisitorParam p) {
      return a.equals(p.type);
    }

    @Override
    public Boolean visitExecutable(ExecutableType a, EqualVisitorParam p) {
      if (p.type.getKind().equals(EXECUTABLE)) {
        ExecutableType b = (ExecutableType) p.type;
        return equalLists(a.getParameterTypes(), b.getParameterTypes(), p.visiting)
            && equal(a.getReturnType(), b.getReturnType(), p.visiting)
            && equalLists(a.getThrownTypes(), b.getThrownTypes(), p.visiting)
            && equalLists(a.getTypeVariables(), b.getTypeVariables(), p.visiting);
      }
      return false;
    }

    @Override
    public Boolean visitIntersection(IntersectionType a, EqualVisitorParam p) {
      if (p.type.getKind().equals(INTERSECTION)) {
        IntersectionType b = (IntersectionType) p.type;
        return equalLists(a.getBounds(), b.getBounds(), p.visiting);
      }
      return false;
    }

    @Override
    public Boolean visitTypeVariable(TypeVariable a, EqualVisitorParam p) {
      if (p.type.getKind().equals(TYPEVAR)) {
        TypeVariable b = (TypeVariable) p.type;
        TypeParameterElement aElement = (TypeParameterElement) a.asElement();
        TypeParameterElement bElement = (TypeParameterElement) b.asElement();
        Set<ComparedElements> newVisiting = visitingSetPlus(p.visiting, aElement, bElement);
        if (newVisiting.equals(p.visiting)) {
          // We're already visiting this pair of elements.
          // This can happen with our friend Eclipse when looking at <T extends Comparable<T>>.
          // It incorrectly reports the upper bound of T as T itself.
          return true;
        }
        // We use aElement.getBounds() instead of a.getUpperBound() to avoid having to deal with
        // the different way intersection types (like <T extends Number & Comparable<T>>) are
        // represented before and after Java 8. We do have an issue that this code may consider
        // that <T extends Foo & Bar> is different from <T extends Bar & Foo>, but it's very
        // hard to avoid that, and not likely to be much of a problem in practice.
        return equalLists(aElement.getBounds(), bElement.getBounds(), newVisiting)
            && equal(a.getLowerBound(), b.getLowerBound(), newVisiting)
            && a.asElement().getSimpleName().equals(b.asElement().getSimpleName());
      }
      return false;
    }

    @Override
    public Boolean visitWildcard(WildcardType a, EqualVisitorParam p) {
      if (p.type.getKind().equals(WILDCARD)) {
        WildcardType b = (WildcardType) p.type;
        return equal(a.getExtendsBound(), b.getExtendsBound(), p.visiting)
            && equal(a.getSuperBound(), b.getSuperBound(), p.visiting);
      }
      return false;
    }

    @Override
    public Boolean visitUnknown(TypeMirror a, EqualVisitorParam p) {
      throw new UnsupportedOperationException();
    }

    private Set<ComparedElements> visitingSetPlus(
        Set<ComparedElements> visiting, Element a, Element b) {
      ImmutableList<TypeMirror> noArguments = ImmutableList.of();
      return visitingSetPlus(visiting, a, noArguments, b, noArguments);
    }

    private Set<ComparedElements> visitingSetPlus(
        Set<ComparedElements> visiting,
        Element a,
        List<? extends TypeMirror> aArguments,
        Element b,
        List<? extends TypeMirror> bArguments) {
      ComparedElements comparedElements =
          new ComparedElements(
              a, ImmutableList.<TypeMirror>copyOf(aArguments),
              b, ImmutableList.<TypeMirror>copyOf(bArguments));
      Set<ComparedElements> newVisiting = new HashSet<ComparedElements>(visiting);
      newVisiting.add(comparedElements);
      return newVisiting;
    }
  }

  @SuppressWarnings("TypeEquals")
  private static boolean equal(
      @Nullable TypeMirror a, @Nullable TypeMirror b, Set<ComparedElements> visiting) {
    if (a == b) {
      return true;
    }
    if (a == null || b == null) {
      return false;
    }
    // TypeMirror.equals is not guaranteed to return true for types that are equal, but we can
    // assume that if it does return true then the types are equal. This check also avoids getting
    // stuck in infinite recursion when Eclipse decrees that the upper bound of the second K in
    // <K extends Comparable<K>> is a distinct but equal K.
    // The javac implementation of ExecutableType, at least in some versions, does not take thrown
    // exceptions into account in its equals implementation, so avoid this optimization for
    // ExecutableType.
    @SuppressWarnings("TypesEquals")
    boolean equal = a.equals(b);
    if (equal && a.getKind() != TypeKind.EXECUTABLE) {
      return true;
    }
    EqualVisitorParam p = new EqualVisitorParam();
    p.type = b;
    p.visiting = visiting;
    return a.accept(EqualVisitor.INSTANCE, p);
  }

  /**
   * Returns the type of the innermost enclosing instance, or null if there is none. This is the
   * same as {@link DeclaredType#getEnclosingType()} except that it returns null rather than NoType
   * for a static type. We need this because of <a
   * href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=508222">this bug</a> whereby the Eclipse
   * compiler returns a value for static classes that is not NoType.
   */
  private static @Nullable TypeMirror enclosingType(DeclaredType t) {
    TypeMirror enclosing = t.getEnclosingType();
    if (enclosing.getKind().equals(TypeKind.NONE)
        || t.asElement().getModifiers().contains(Modifier.STATIC)) {
      return null;
    }
    return enclosing;
  }

  private static boolean equalLists(
      List<? extends TypeMirror> a, List<? extends TypeMirror> b, Set<ComparedElements> visiting) {
    int size = a.size();
    if (size != b.size()) {
      return false;
    }
    // Use iterators in case the Lists aren't RandomAccess
    Iterator<? extends TypeMirror> aIterator = a.iterator();
    Iterator<? extends TypeMirror> bIterator = b.iterator();
    while (aIterator.hasNext()) {
      // We checked that the lists have the same size, so we know that bIterator.hasNext() too.
      TypeMirror nextMirrorA = aIterator.next();
      TypeMirror nextMirrorB = bIterator.next();
      if (!equal(nextMirrorA, nextMirrorB, visiting)) {
        return false;
      }
    }
    return true;
  }

  private static final int HASH_SEED = 17;
  private static final int HASH_MULTIPLIER = 31;

  private static final class HashVisitor extends SimpleTypeVisitor8<Integer, Set<Element>> {
    private static final HashVisitor INSTANCE = new HashVisitor();

    int hashKind(int seed, TypeMirror t) {
      int result = seed * HASH_MULTIPLIER;
      result += t.getKind().hashCode();
      return result;
    }

    @Override
    protected Integer defaultAction(TypeMirror e, Set<Element> visiting) {
      return hashKind(HASH_SEED, e);
    }

    @Override
    public Integer visitArray(ArrayType t, Set<Element> visiting) {
      int result = hashKind(HASH_SEED, t);
      result *= HASH_MULTIPLIER;
      result += t.getComponentType().accept(this, visiting);
      return result;
    }

    @Override
    public Integer visitDeclared(DeclaredType t, Set<Element> visiting) {
      Element element = t.asElement();
      if (visiting.contains(element)) {
        return 0;
      }
      Set<Element> newVisiting = new HashSet<Element>(visiting);
      newVisiting.add(element);
      int result = hashKind(HASH_SEED, t);
      result *= HASH_MULTIPLIER;
      result += t.asElement().hashCode();
      result *= HASH_MULTIPLIER;
      result += t.getEnclosingType().accept(this, newVisiting);
      result *= HASH_MULTIPLIER;
      result += hashList(t.getTypeArguments(), newVisiting);
      return result;
    }

    @Override
    public Integer visitExecutable(ExecutableType t, Set<Element> visiting) {
      int result = hashKind(HASH_SEED, t);
      result *= HASH_MULTIPLIER;
      result += hashList(t.getParameterTypes(), visiting);
      result *= HASH_MULTIPLIER;
      result += t.getReturnType().accept(this, visiting);
      result *= HASH_MULTIPLIER;
      result += hashList(t.getThrownTypes(), visiting);
      result *= HASH_MULTIPLIER;
      result += hashList(t.getTypeVariables(), visiting);
      return result;
    }

    @Override
    public Integer visitTypeVariable(TypeVariable t, Set<Element> visiting) {
      int result = hashKind(HASH_SEED, t);
      result *= HASH_MULTIPLIER;
      result += t.getLowerBound().accept(this, visiting);
      TypeParameterElement element = (TypeParameterElement) t.asElement();
      for (TypeMirror bound : element.getBounds()) {
        result *= HASH_MULTIPLIER;
        result += bound.accept(this, visiting);
      }
      return result;
    }

    @Override
    public Integer visitWildcard(WildcardType t, Set<Element> visiting) {
      int result = hashKind(HASH_SEED, t);
      result *= HASH_MULTIPLIER;
      result += (t.getExtendsBound() == null) ? 0 : t.getExtendsBound().accept(this, visiting);
      result *= HASH_MULTIPLIER;
      result += (t.getSuperBound() == null) ? 0 : t.getSuperBound().accept(this, visiting);
      return result;
    }

    @Override
    public Integer visitUnknown(TypeMirror t, Set<Element> visiting) {
      throw new UnsupportedOperationException();
    }
  }

  private static int hashList(List<? extends TypeMirror> mirrors, Set<Element> visiting) {
    int result = HASH_SEED;
    for (TypeMirror mirror : mirrors) {
      result *= HASH_MULTIPLIER;
      result += hash(mirror, visiting);
    }
    return result;
  }

  private static int hash(TypeMirror mirror, Set<Element> visiting) {
    return mirror == null ? 0 : mirror.accept(HashVisitor.INSTANCE, visiting);
  }

  /**
   * Returns the set of {@linkplain TypeElement types} that are referenced by the given {@link
   * TypeMirror}.
   */
  public static ImmutableSet<TypeElement> referencedTypes(TypeMirror type) {
    checkNotNull(type);
    ImmutableSet.Builder<TypeElement> elements = ImmutableSet.builder();
    type.accept(ReferencedTypes.INSTANCE, elements);
    return elements.build();
  }

  private static final class ReferencedTypes
      extends SimpleTypeVisitor8<@Nullable Void, ImmutableSet.Builder<TypeElement>> {
    private static final ReferencedTypes INSTANCE = new ReferencedTypes();

    @Override
    public @Nullable Void visitArray(ArrayType t, ImmutableSet.Builder<TypeElement> p) {
      t.getComponentType().accept(this, p);
      return null;
    }

    @Override
    public @Nullable Void visitDeclared(DeclaredType t, ImmutableSet.Builder<TypeElement> p) {
      p.add(MoreElements.asType(t.asElement()));
      for (TypeMirror typeArgument : t.getTypeArguments()) {
        typeArgument.accept(this, p);
      }
      return null;
    }

    @Override
    public @Nullable Void visitTypeVariable(TypeVariable t, ImmutableSet.Builder<TypeElement> p) {
      t.getLowerBound().accept(this, p);
      t.getUpperBound().accept(this, p);
      return null;
    }

    @Override
    public @Nullable Void visitWildcard(WildcardType t, ImmutableSet.Builder<TypeElement> p) {
      TypeMirror extendsBound = t.getExtendsBound();
      if (extendsBound != null) {
        extendsBound.accept(this, p);
      }
      TypeMirror superBound = t.getSuperBound();
      if (superBound != null) {
        superBound.accept(this, p);
      }
      return null;
    }
  }

  /**
   * An alternate implementation of {@link Types#asElement} that does not require a {@link Types}
   * instance with the notable difference that it will throw {@link IllegalArgumentException}
   * instead of returning null if the {@link TypeMirror} can not be converted to an {@link Element}.
   *
   * @throws NullPointerException if {@code typeMirror} is {@code null}
   * @throws IllegalArgumentException if {@code typeMirror} cannot be converted to an {@link
   *     Element}
   */
  public static Element asElement(TypeMirror typeMirror) {
    return typeMirror.accept(AsElementVisitor.INSTANCE, null);
  }

  private static final class AsElementVisitor extends SimpleTypeVisitor8<Element, Void> {
    private static final AsElementVisitor INSTANCE = new AsElementVisitor();

    @Override
    protected Element defaultAction(TypeMirror e, Void p) {
      throw new IllegalArgumentException(e + " cannot be converted to an Element");
    }

    @Override
    public Element visitDeclared(DeclaredType t, Void p) {
      return t.asElement();
    }

    @Override
    public Element visitError(ErrorType t, Void p) {
      return t.asElement();
    }

    @Override
    public Element visitTypeVariable(TypeVariable t, Void p) {
      return t.asElement();
    }
  }
  ;

  // TODO(gak): consider removing these two methods as they're pretty trivial now
  public static TypeElement asTypeElement(TypeMirror mirror) {
    return MoreElements.asType(asElement(mirror));
  }

  public static ImmutableSet<TypeElement> asTypeElements(Iterable<? extends TypeMirror> mirrors) {
    checkNotNull(mirrors);
    ImmutableSet.Builder<TypeElement> builder = ImmutableSet.builder();
    for (TypeMirror mirror : mirrors) {
      builder.add(asTypeElement(mirror));
    }
    return builder.build();
  }

  /**
   * Returns a {@link ArrayType} if the {@link TypeMirror} represents an array or throws an {@link
   * IllegalArgumentException}.
   */
  public static ArrayType asArray(TypeMirror maybeArrayType) {
    return maybeArrayType.accept(ArrayTypeVisitor.INSTANCE, null);
  }

  private static final class ArrayTypeVisitor extends CastingTypeVisitor<ArrayType> {
    private static final ArrayTypeVisitor INSTANCE = new ArrayTypeVisitor();

    ArrayTypeVisitor() {
      super("array");
    }

    @Override
    public ArrayType visitArray(ArrayType type, Void ignore) {
      return type;
    }
  }

  /**
   * Returns a {@link DeclaredType} if the {@link TypeMirror} represents a declared type such as a
   * class, interface, union/compound, or enum or throws an {@link IllegalArgumentException}.
   */
  public static DeclaredType asDeclared(TypeMirror maybeDeclaredType) {
    return maybeDeclaredType.accept(DeclaredTypeVisitor.INSTANCE, null);
  }

  private static final class DeclaredTypeVisitor extends CastingTypeVisitor<DeclaredType> {
    private static final DeclaredTypeVisitor INSTANCE = new DeclaredTypeVisitor();

    DeclaredTypeVisitor() {
      super("declared type");
    }

    @Override
    public DeclaredType visitDeclared(DeclaredType type, Void ignore) {
      return type;
    }
  }

  /**
   * Returns a {@link ExecutableType} if the {@link TypeMirror} represents an executable type such
   * as may result from missing code, or bad compiles or throws an {@link IllegalArgumentException}.
   */
  public static ErrorType asError(TypeMirror maybeErrorType) {
    return maybeErrorType.accept(ErrorTypeVisitor.INSTANCE, null);
  }

  private static final class ErrorTypeVisitor extends CastingTypeVisitor<ErrorType> {
    private static final ErrorTypeVisitor INSTANCE = new ErrorTypeVisitor();

    ErrorTypeVisitor() {
      super("error type");
    }

    @Override
    public ErrorType visitError(ErrorType type, Void ignore) {
      return type;
    }
  }

  /**
   * Returns a {@link ExecutableType} if the {@link TypeMirror} represents an executable type such
   * as a method, constructor, or initializer or throws an {@link IllegalArgumentException}.
   */
  public static ExecutableType asExecutable(TypeMirror maybeExecutableType) {
    return maybeExecutableType.accept(ExecutableTypeVisitor.INSTANCE, null);
  }

  private static final class ExecutableTypeVisitor extends CastingTypeVisitor<ExecutableType> {
    private static final ExecutableTypeVisitor INSTANCE = new ExecutableTypeVisitor();

    ExecutableTypeVisitor() {
      super("executable type");
    }

    @Override
    public ExecutableType visitExecutable(ExecutableType type, Void ignore) {
      return type;
    }
  }

  /**
   * Returns an {@link IntersectionType} if the {@link TypeMirror} represents an intersection-type
   * or throws an {@link IllegalArgumentException}.
   */
  public static IntersectionType asIntersection(TypeMirror maybeIntersectionType) {
    return maybeIntersectionType.accept(IntersectionTypeVisitor.INSTANCE, null);
  }

  private static final class IntersectionTypeVisitor extends CastingTypeVisitor<IntersectionType> {
    private static final IntersectionTypeVisitor INSTANCE = new IntersectionTypeVisitor();

    IntersectionTypeVisitor() {
      super("intersection type");
    }

    @Override
    public IntersectionType visitIntersection(IntersectionType type, Void ignore) {
      return type;
    }
  }

  /**
   * Returns a {@link NoType} if the {@link TypeMirror} represents an non-type such as void, or
   * package, etc. or throws an {@link IllegalArgumentException}.
   */
  public static NoType asNoType(TypeMirror maybeNoType) {
    return maybeNoType.accept(NoTypeVisitor.INSTANCE, null);
  }

  private static final class NoTypeVisitor extends CastingTypeVisitor<NoType> {
    private static final NoTypeVisitor INSTANCE = new NoTypeVisitor();

    NoTypeVisitor() {
      super("non-type");
    }

    @Override
    public NoType visitNoType(NoType type, Void ignore) {
      return type;
    }
  }

  /**
   * Returns a {@link NullType} if the {@link TypeMirror} represents the null type or throws an
   * {@link IllegalArgumentException}.
   */
  public static NullType asNullType(TypeMirror maybeNullType) {
    return maybeNullType.accept(NullTypeVisitor.INSTANCE, null);
  }

  private static final class NullTypeVisitor extends CastingTypeVisitor<NullType> {
    private static final NullTypeVisitor INSTANCE = new NullTypeVisitor();

    NullTypeVisitor() {
      super("null");
    }

    @Override
    public NullType visitNull(NullType type, Void ignore) {
      return type;
    }
  }

  /**
   * Returns a {@link PrimitiveType} if the {@link TypeMirror} represents a primitive type or throws
   * an {@link IllegalArgumentException}.
   */
  public static PrimitiveType asPrimitiveType(TypeMirror maybePrimitiveType) {
    return maybePrimitiveType.accept(PrimitiveTypeVisitor.INSTANCE, null);
  }

  private static final class PrimitiveTypeVisitor extends CastingTypeVisitor<PrimitiveType> {
    private static final PrimitiveTypeVisitor INSTANCE = new PrimitiveTypeVisitor();

    PrimitiveTypeVisitor() {
      super("primitive type");
    }

    @Override
    public PrimitiveType visitPrimitive(PrimitiveType type, Void ignore) {
      return type;
    }
  }

  //
  // visitUnionType would go here, but isn't relevant for annotation processors
  //

  /**
   * Returns a {@link TypeVariable} if the {@link TypeMirror} represents a type variable or throws
   * an {@link IllegalArgumentException}.
   */
  public static TypeVariable asTypeVariable(TypeMirror maybeTypeVariable) {
    return maybeTypeVariable.accept(TypeVariableVisitor.INSTANCE, null);
  }

  private static final class TypeVariableVisitor extends CastingTypeVisitor<TypeVariable> {
    private static final TypeVariableVisitor INSTANCE = new TypeVariableVisitor();

    TypeVariableVisitor() {
      super("type variable");
    }

    @Override
    public TypeVariable visitTypeVariable(TypeVariable type, Void ignore) {
      return type;
    }
  }

  /**
   * Returns a {@link WildcardType} if the {@link TypeMirror} represents a wildcard type or throws
   * an {@link IllegalArgumentException}.
   */
  public static WildcardType asWildcard(TypeMirror maybeWildcardType) {
    return maybeWildcardType.accept(WildcardTypeVisitor.INSTANCE, null);
  }

  private static final class WildcardTypeVisitor extends CastingTypeVisitor<WildcardType> {
    private static final WildcardTypeVisitor INSTANCE = new WildcardTypeVisitor();

    WildcardTypeVisitor() {
      super("wildcard type");
    }

    @Override
    public WildcardType visitWildcard(WildcardType type, Void ignore) {
      return type;
    }
  }

  /**
   * Returns true if the raw type underlying the given {@link TypeMirror} represents a type that can
   * be referenced by a {@link Class}. If this returns true, then {@link #isTypeOf} is guaranteed to
   * not throw.
   */
  public static boolean isType(TypeMirror type) {
    return type.accept(IsTypeVisitor.INSTANCE, null);
  }

  private static final class IsTypeVisitor extends SimpleTypeVisitor8<Boolean, Void> {
    private static final IsTypeVisitor INSTANCE = new IsTypeVisitor();

    @Override
    protected Boolean defaultAction(TypeMirror type, Void ignored) {
      return false;
    }

    @Override
    public Boolean visitNoType(NoType noType, Void p) {
      return noType.getKind().equals(TypeKind.VOID);
    }

    @Override
    public Boolean visitPrimitive(PrimitiveType type, Void p) {
      return true;
    }

    @Override
    public Boolean visitArray(ArrayType array, Void p) {
      return true;
    }

    @Override
    public Boolean visitDeclared(DeclaredType type, Void ignored) {
      return MoreElements.isType(type.asElement());
    }
  }

  /**
   * Returns true if the raw type underlying the given {@link TypeMirror} represents the same raw
   * type as the given {@link Class} and throws an IllegalArgumentException if the {@link
   * TypeMirror} does not represent a type that can be referenced by a {@link Class}
   */
  public static boolean isTypeOf(final Class<?> clazz, TypeMirror type) {
    checkNotNull(clazz);
    return type.accept(new IsTypeOf(clazz), null);
  }

  private static final class IsTypeOf extends SimpleTypeVisitor8<Boolean, Void> {
    private final Class<?> clazz;

    IsTypeOf(Class<?> clazz) {
      this.clazz = clazz;
    }

    @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 visitError(ErrorType errorType, Void p) {
      return false;
    }

    @Override
    public Boolean visitPrimitive(PrimitiveType type, Void p) {
      switch (type.getKind()) {
        case BOOLEAN:
          return clazz.equals(Boolean.TYPE);
        case BYTE:
          return clazz.equals(Byte.TYPE);
        case CHAR:
          return clazz.equals(Character.TYPE);
        case DOUBLE:
          return clazz.equals(Double.TYPE);
        case FLOAT:
          return clazz.equals(Float.TYPE);
        case INT:
          return clazz.equals(Integer.TYPE);
        case LONG:
          return clazz.equals(Long.TYPE);
        case SHORT:
          return clazz.equals(Short.TYPE);
        default:
          throw new IllegalArgumentException(type + " cannot be represented as a Class<?>.");
      }
    }

    @Override
    public Boolean visitArray(ArrayType array, Void p) {
      return clazz.isArray() && isTypeOf(clazz.getComponentType(), array.getComponentType());
    }

    @Override
    public Boolean visitDeclared(DeclaredType type, Void ignored) {
      TypeElement typeElement = MoreElements.asType(type.asElement());
      return typeElement.getQualifiedName().contentEquals(clazz.getCanonicalName());
    }
  }

  /**
   * Returns the superclass of {@code type}, with any type parameters bound by {@code type}, or
   * {@link Optional#absent()} if {@code type} is an interface or {@link Object} or its superclass
   * is {@link Object}.
   */
  // TODO(bcorso): Remove unused parameter Elements?
  public static Optional<DeclaredType> nonObjectSuperclass(
      Types types, Elements elements, DeclaredType type) {
    checkNotNull(types);
    checkNotNull(elements); // This is no longer used, but here to avoid changing the API.
    checkNotNull(type);

    TypeMirror superclassType = asTypeElement(type).getSuperclass();
    if (!isType(superclassType)) { // type is Object or an interface
      return Optional.absent();
    }

    DeclaredType superclass = asDeclared(superclassType);
    if (isObjectType(superclass)) {
      return Optional.absent();
    }

    if (superclass.getTypeArguments().isEmpty()) {
      return Optional.of(superclass);
    }

    // In the case where the super class has type parameters, TypeElement#getSuperclass gives
    // SuperClass<T> rather than SuperClass<Foo>, so use Types#directSupertypes instead. The javadoc
    // for Types#directSupertypes guarantees that a super class, if it exists, comes before any
    // interfaces. Thus, we can just get the first element in the list.
    return Optional.of(asDeclared(types.directSupertypes(type).get(0)));
  }

  private static boolean isObjectType(DeclaredType type) {
    return asTypeElement(type).getQualifiedName().contentEquals("java.lang.Object");
  }

  /**
   * Resolves a {@link VariableElement} parameter to a method or constructor based on the given
   * container, or a member of a class. For parameters to a method or constructor, the variable's
   * enclosing element must be a supertype of the container type. For example, given a {@code
   * container} of type {@code Set<String>}, and a variable corresponding to the {@code E e}
   * parameter in the {@code Set.add(E e)} method, this will return a TypeMirror for {@code String}.
   */
  public static TypeMirror asMemberOf(
      Types types, DeclaredType container, VariableElement variable) {
    if (variable.getKind().equals(ElementKind.PARAMETER)) {
      ExecutableElement methodOrConstructor =
          MoreElements.asExecutable(variable.getEnclosingElement());
      ExecutableType resolvedMethodOrConstructor =
          MoreTypes.asExecutable(types.asMemberOf(container, methodOrConstructor));
      List<? extends VariableElement> parameters = methodOrConstructor.getParameters();
      List<? extends TypeMirror> parameterTypes = resolvedMethodOrConstructor.getParameterTypes();
      checkState(parameters.size() == parameterTypes.size());
      for (int i = 0; i < parameters.size(); i++) {
        // We need to capture the parameter type of the variable we're concerned about,
        // for later printing.  This is the only way to do it since we can't use
        // types.asMemberOf on variables of methods.
        if (parameters.get(i).equals(variable)) {
          return parameterTypes.get(i);
        }
      }
      throw new IllegalStateException("Could not find variable: " + variable);
    } else {
      return types.asMemberOf(container, variable);
    }
  }

  private abstract static class CastingTypeVisitor<T> extends SimpleTypeVisitor8<T, Void> {
    private final String label;

    CastingTypeVisitor(String label) {
      this.label = label;
    }

    @Override
    protected T defaultAction(TypeMirror e, Void v) {
      throw new IllegalArgumentException(e + " does not represent a " + label);
    }
  }

  /**
   * Returns true if casting {@code Object} to the given type will elicit an unchecked warning from
   * the compiler. Only type variables and parameterized types such as {@code List<String>} produce
   * such warnings. There will be no warning if the type's only type parameters are simple
   * wildcards, as in {@code Map<?, ?>}.
   */
  public static boolean isConversionFromObjectUnchecked(TypeMirror type) {
    return new CastingUncheckedVisitor().visit(type, null);
  }

  /**
   * Visitor that tells whether a type is erased, in the sense of {@link #castIsUnchecked}. Each
   * visitX method returns true if its input parameter is true or if the type being visited is
   * erased.
   */
  private static class CastingUncheckedVisitor extends SimpleTypeVisitor8<Boolean, Void> {
    CastingUncheckedVisitor() {
      super(false);
    }

    @Override
    public Boolean visitUnknown(TypeMirror t, Void p) {
      // We don't know whether casting is unchecked for this mysterious type but assume it is,
      // so we will insert a possibly unnecessary @SuppressWarnings("unchecked").
      return true;
    }

    @Override
    public Boolean visitArray(ArrayType t, Void p) {
      return visit(t.getComponentType(), p);
    }

    @Override
    public Boolean visitDeclared(DeclaredType t, Void p) {
      return t.getTypeArguments().stream().anyMatch(CastingUncheckedVisitor::uncheckedTypeArgument);
    }

    @Override
    public Boolean visitTypeVariable(TypeVariable t, Void p) {
      return true;
    }

    // If a type has a type argument, then casting to the type is unchecked, except if the argument
    // is <?> or <? extends Object>. The same applies to all type arguments, so casting to Map<?, ?>
    // does not produce an unchecked warning for example.
    private static boolean uncheckedTypeArgument(TypeMirror arg) {
      if (arg.getKind().equals(TypeKind.WILDCARD)) {
        WildcardType wildcard = asWildcard(arg);
        if (wildcard.getExtendsBound() == null || isJavaLangObject(wildcard.getExtendsBound())) {
          // This is <?>, unless there's a super bound, in which case it is <? super Foo> and
          // is erased.
          return (wildcard.getSuperBound() != null);
        }
      }
      return true;
    }

    private static boolean isJavaLangObject(TypeMirror type) {
      if (type.getKind() != TypeKind.DECLARED) {
        return false;
      }
      TypeElement typeElement = asTypeElement(type);
      return typeElement.getQualifiedName().contentEquals("java.lang.Object");
    }
  }

  private MoreTypes() {}
}


================================================
FILE: common/src/main/java/com/google/auto/common/Overrides.java
================================================
/*
 * Copyright 2016 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.google.auto.common;

import static java.util.Objects.requireNonNull;
import static java.util.stream.Collectors.toList;

import com.google.common.base.Preconditions;
import com.google.common.base.Verify;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.lang.model.element.Element;
import javax.lang.model.element.ElementKind;
import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.Modifier;
import javax.lang.model.element.TypeElement;
import javax.lang.model.element.TypeParameterElement;
import javax.lang.model.element.VariableElement;
import javax.lang.model.type.ArrayType;
import javax.lang.model.type.DeclaredType;
import javax.lang.model.type.ExecutableType;
import javax.lang.model.type.TypeKind;
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.SimpleTypeVisitor8;
import javax.lang.model.util.Types;
import org.jspecify.annotations.Nullable;

/**
 * Determines if one method overrides another. This class defines two ways of doing that: {@code
 * NativeOverrides} uses the method {@link Elements#overrides(ExecutableElement, ExecutableElement,
 * TypeElement)} while {@code ExplicitOverrides} reimplements that method in a way that is more
 * consistent between compilers, in particular between javac and ecj (the Eclipse compiler).
 *
 * @see <a href="https://github.com/google/auto/issues/372">AutoValue issue about Eclipse</a>
 * @author emcmanus@google.com (Éamonn McManus)
 */
abstract class Overrides {
  abstract boolean overrides(
      ExecutableElement overrider, ExecutableElement overridden, TypeElement in);

  static class NativeOverrides extends Overrides {
    private final Elements elementUtils;

    NativeOverrides(Elements elementUtils) {
      this.elementUtils = elementUtils;
    }

    @Override
    boolean overrides(ExecutableElement overrider, ExecutableElement overridden, TypeElement in) {
      return elementUtils.overrides(overrider, overridden, in);
    }
  }

  static class ExplicitOverrides extends Overrides {
    private final Types typeUtils;

    ExplicitOverrides(Types typeUtils) {
      this.typeUtils = typeUtils;
    }

    @Override
    public boolean overrides(
        ExecutableElement overrider, ExecutableElement overridden, TypeElement in) {
      if (!overrider.getSimpleName().equals(overridden.getSimpleName())) {
        // They must have the same name.
        return false;
      }
      // We should just be able to write overrider.equals(overridden) here, but that runs afoul
      // of a problem with Eclipse. If for example you look at the method Stream<E> stream() in
      // Collection<E>, as obtained by collectionTypeElement.getEnclosedElements(), it will not
      // compare equal to the method Stream<E> stream() as obtained by
      // elementUtils.getAllMembers(listTypeElement), even though List<E> inherits the method
      // from Collection<E>. The reason is that, in ecj, getAllMembers does type substitution,
      // so the return type of stream() is Stream<E'>, where E' is the E from List<E> rather than
      // the one from Collection<E>. Instead we compare the enclosing element, which will be
      // Collection<E> no matter how we got the method. If two methods are in the same type
      // then it's impossible for one to override the other, regardless of whether they are the
      // same method.
      if (overrider.getEnclosingElement().equals(overridden.getEnclosingElement())) {
        return false;
      }
      if (overridden.getModifiers().contains(Modifier.STATIC)) {
        // Static methods can't be overridden (though they can be hidden by other static methods).
        return false;
      }
      if (overrider.getParameters().size() != overridden.getParameters().size()) {
        // One method can't override another if they have a different number of parameters.
        // Varargs `Foo...` appears as `Foo[]` here; there is a separate
        // ExecutableElement.isVarArgs() method to tell whether a method is varargs, but that has no
        // effect on override logic.
        // The check here isn't strictly needed but avoids unnecessary work.
        return false;
      }
      Visibility overriddenVisibility = Visibility.ofElement(overridden);
      Visibility overriderVisibility = Visibility.ofElement(overrider);
      if (overriddenVisibility.equals(Visibility.PRIVATE)
          || overriderVisibility.compareTo(overriddenVisibility) < 0) {
        // Private methods can't be overridden, and methods can't be overridden by less-visible
        // methods. The latter condition is enforced by the compiler so in theory we might report
        // an "incorrect" result here for code that javac would not have allowed.
        return false;
      }
      if (!isSubsignature(overrider, overridden, in)) {
        return false;
      }
      if (!MoreElements.methodVisibleFromPackage(overridden, MoreElements.getPackage(overrider))) {
        // If the overridden method is a package-private method in a different package then it
        // can't be overridden.
        return false;
      }
      if (!MoreElements.isType(overridden.getEnclosingElement())) {
        return false;
        // We don't know how this could happen but we avoid blowing up if it does.
      }
      TypeElement overriddenType = MoreElements.asType(overridden.getEnclosingElement());
      // We erase the types before checking subtypes, because the TypeMirror we get for List<E> is
      // not a subtype of the one we get for Collection<E> since the two E instances are not the
      // same. For the purposes of overriding, type parameters in the containing type should not
      // matter because if the code compiles at all then they must be consistent.
      if (!typeUtils.isSubtype(
          typeUtils.erasure(in.asType()), typeUtils.erasure(overriddenType.asType()))) {
        return false;
      }
      if (in.getKind().isClass()) {
        // Method mC in or inherited by class C (JLS 8.4.8.1)...
        if (overriddenType.getKind().isClass()) {
          // ...overrides from C another method mA declared in class A. The only condition we
          // haven't checked is that C does not inherit mA. Ideally we could just write this:
          //    return !elementUtils.getAllMembers(in).contains(overridden);
          // But that doesn't work in Eclipse. For example, getAllMembers(AbstractList)
          // contains List.isEmpty() where you might reasonably expect it to contain
          // AbstractCollection.isEmpty(). So we need to visit superclasses until we reach
          // one that declares the same method, and check that we haven't reached mA. We compare
          // the enclosing elements rather than the methods themselves for the reason described
          // at the start of the method.
          ExecutableElement inherited = methodFromSuperclasses(in, overridden);
          return inherited != null
              && !overridden.getEnclosingElement().equals(inherited.getEnclosingElement());
        } else if (overriddenType.getKind().isInterface()) {
          // ...overrides from C another method mI declared in interface I. We've already checked
          // the conditions (assuming that the only alternative to mI being abstract or default is
          // mI being static, which we eliminated above). However, it appears that the logic here
          // is necessary in order to be compatible with javac's `overrides` method. An inherited
          // abstract method does not override another method. (But, if it is not inherited,
          // it does, including if `in` inherits a concrete method of the same name from its
          // superclass.) Here again we can use getAllMembers with javac but not with ecj. javac
          // says that getAllMembers(AbstractList) contains both AbstractCollection.size() and
          // List.size(), but ecj doesn't have the latter. The spec is not particularly clear so
          // either seems justifiable. So we need to look up the interface path that goes from `in`
          // to `overriddenType` (or the several paths if there are several) and apply similar logic
          // to methodFromSuperclasses above.
          if (overrider.getModifiers().contains(Modifier.ABSTRACT)) {
            ExecutableElement inherited = methodFromSuperinterfaces(in, overridden);
            return inherited != null
                && !overridden.getEnclosingElement().equals(inherited.getEnclosingElement());
          } else {
            return true;
          }
        } else {
          // We don't know what this is so say no.
          return false;
        }
      } else {
        // Method mI in or inherited by interface I (JLS 9.4.1.1). We've already checked everything,
        // except that `overrider` must also be in a subinterface of `overridden`.
        // If this is not an interface then we don't know what it is so we say no.
        TypeElement overriderType = MoreElements.asType(overrider.getEnclosingElement());
        return in.getKind().isInterface()
            && typeUtils.isSubtype(
                typeUtils.erasure(overriderType.asType()),
                typeUtils.erasure(overriddenType.asType()));
      }
    }

    private boolean isSubsignature(
        ExecutableElement overrider, ExecutableElement overridden, TypeElement in) {
      DeclaredType inType = MoreTypes.asDeclared(in.asType());
      try {
        ExecutableType overriderExecutable =
            MoreTypes.asExecutable(typeUtils.asMemberOf(inType, overrider));
        ExecutableType overriddenExecutable =
            MoreTypes.asExecutable(typeUtils.asMemberOf(inType, overridden));
        return typeUtils.isSubsignature(overriderExecutable, overriddenExecutable);
      } catch (IllegalArgumentException e) {
        // This might mean that at least one of the methods is not in fact declared in or inherited
        // by `in` (in which case we should indeed return false); or it might mean that we are
        // tickling an Eclipse bug such as https://bugs.eclipse.org/bugs/show_bug.cgi?id=499026
        // (in which case we fall back on explicit code to find the parameters).
        int nParams = overrider.getParameters().size();
        if (overridden.getParameters().size() != nParams) {
          return false;
        }
        List<TypeMirror> overriderParams = erasedParameterTypes(overrider, in);
        List<TypeMirror> overriddenParams = erasedParameterTypes(overridden, in);
        if (overriderParams == null || overriddenParams == null) {
          // This probably means that one or other of the methods is not in `in`.
          return false;
        }
        for (int i = 0; i < nParams; i++) {
          if (!typeUtils.isSameType(overriderParams.get(i), overriddenParams.get(i))) {
            // If the erasures of the parameters don't correspond, return false. We erase so we
            // don't get any confusion about different type variables not comparing equal.
            return false;
          }
        }
        return true;
      }
    }

    /**
     * Returns the list of erased parameter types of the given method as they appear in the given
     * type. For example, if the method is {@code add(E)} from {@code List<E>} and we ask how it
     * appears in {@code class NumberList implements List<Number>}, the answer will be {@code
     * Number}. That will also be the answer for {@code class NumberList<E extends Number>
     * implements List<E>}. The parameter types are erased since the purpose of this method is to
     * determine whether two methods are candidates for one to override the other.
     */
    @Nullable ImmutableList<TypeMirror> erasedParameterTypes(
        ExecutableElement method, TypeElement in) {
      if (method.getParameters().isEmpty()) {
        return ImmutableList.of();
      }
      return new TypeSubstVisitor().erasedParameterTypes(method, in);
    }

    /**
     * Visitor that replaces type variables with their values in the types it sees. If we know that
     * {@code E} is {@code String}, then we can return {@code String} for {@code E}, {@code
     * List<String>} for {@code List<E>}, {@code String[]} for {@code E[]}, etc. We don't have to
     * cover all types here because (1) the type is going to end up being erased, and (2) wildcards
     * can't appear in direct supertypes. So for example it is illegal to write {@code class MyList
     * implements List<? extends Number>}. It's legal to write {@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 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
       * mappings for all the variables we see. We could equivalently create a new map for each type
       * we visit, but this is slightly simpler and probably about as performant.
       */
      private final Map<TypeParameterElement, TypeMirror> typeBindings = Maps.newLinkedHashMap();

      /**
       * Type elements that we are currently visiting. This helps us stay out of trouble when
       * looking at something like {@code Enum<E extends Enum<E>>}. At the second {@code Enum} we
       * will just return raw {@code Enum}.
       */
      private final Set<TypeElement> visitingTypes = new LinkedHashSet<>();

      @Nullable ImmutableList<TypeMirror> erasedParameterTypes(
          ExecutableElement method, TypeElement in) {
        if (method.getEnclosingElement().equals(in)) {
          ImmutableList.Builder<TypeMirror> params = ImmutableList.builder();
          for (VariableElement param : method.getParameters()) {
            params.add(typeUtils.erasure(visit(param.asType())));
          }
          return params.build();
        }
        // Make a list of supertypes we are going to visit recursively: the superclass, if there
        // is one, plus the superinterfaces.
        List<TypeMirror> supers = Lists.newArrayList();
        if (in.getSuperclass().getKind() == TypeKind.DECLARED) {
          supers.add(in.getSuperclass());
        }
        supers.addAll(in.getInterfaces());
        for (TypeMirror supertype : supers) {
          DeclaredType declared = MoreTypes.asDeclared(supertype);
          TypeElement element = MoreElements.asType(declared.asElement());
          List<? extends TypeMirror> actuals = declared.getTypeArguments();
          List<? extends TypeParameterElement> formals = element.getTypeParameters();
          if (actuals.isEmpty()) {
            // Either the formal type arguments are also empty or `declared` is raw.
            actuals = formals.stream().map(t -> t.getBounds().get(0)).collect(toList());
          }
          Verify.verify(actuals.size() == formals.size());
          for (int i = 0; i < actuals.size(); i++) {
            typeBindings.put(formals.get(i), actuals.get(i));
          }
          ImmutableList<TypeMirror> params = erasedParameterTypes(method, element);
          if (params != null) {
            return params;
          }
        }
        return null;
      }

      @Override
      protected TypeMirror defaultAction(TypeMirror e, Void p) {
        return e;
      }

      @Override
      public TypeMirror visitTypeVariable(TypeVariable t, Void p) {
        Element element = t.asElement();
        if (element.getKind() == ElementKind.TYPE_PARAMETER) {
          TypeParameterElement e = (TypeParameterElement) element;
          if (typeBindings.containsKey(e)) {
            return visit(typeBindings.get(e));
          }
        }
        // We erase the upper bound to avoid infinite recursion. We can get away with erasure for
        // the reasons described above.
        return visit(typeUtils.erasure(t.getUpperBound()));
      }

      @Override
      public TypeMirror visitDeclared(DeclaredType t, Void p) {
        if (t.getTypeArguments().isEmpty()) {
          return t;
        }
        TypeElement typeElement = asTypeElement(t);
        if (!visitingTypes.add(typeElement)) {
          return typeUtils.erasure(t);
        }
        List<TypeMirror> newArgs = Lists.newArrayList();
        for (TypeMirror arg : t.getTypeArguments()) {
          newArgs.add(visit(arg));
        }
        TypeMirror result =
            typeUtils.getDeclaredType(asTypeElement(t), newArgs.toArray(new TypeMirror[0]));
        visitingTypes.remove(typeElement);
        return result;
      }

      @Override
      public TypeMirror visitArray(ArrayType t, Void p) {
        return typeUtils.getArrayType(visit(t.getComponentType()));
      }
    }

    /**
     * Returns the given method as it appears in the given type. This is the method itself, or the
     * nearest override in a superclass of the given type, or null if the method is not found in the
     * given type or any of its superclasses.
     */
    @Nullable ExecutableElement methodFromSuperclasses(TypeElement in, ExecutableElement method) {
      for (TypeElement t = in; t != null; t = superclass(t)) {
        ExecutableElement tMethod = methodInType(t, method);
        if (tMethod != null) {
          return tMethod;
        }
      }
      return null;
    }

    /**
     * Returns the given interface method as it appears in the given type. This is the method
     * itself, or the nearest override in a superinterface of the given type, or null if the method
     * is not found in the given type or any of its transitive superinterfaces.
     */
    @Nullable ExecutableElement methodFromSuperinterfaces(
        TypeElement in, ExecutableElement method) {
      TypeElement methodContainer = MoreElements.asType(method.getEnclosingElement());
      Preconditions.checkArgument(methodContainer.getKind().isInterface());
      TypeMirror methodContainerType = typeUtils.erasure(methodContainer.asType());
      ImmutableList<TypeElement> types = ImmutableList.of(in);
      // On the first pass through this loop, `types` is the type we're starting from,
      // which might be a class or an interface. On later passes it is a list of direct
      // superinterfaces we saw in the previous pass, but only the ones that were assignable
      // to the interface that `method` appears in.
      while (!types.isEmpty()) {
        ImmutableList.Builder<TypeElement> newTypes = ImmutableList.builder();
        for (TypeElement t : types) {
          TypeMirror candidateType = typeUtils.erasure(t.asType());
          if (typeUtils.isAssignable(candidateType, methodContainerType)) {
            ExecutableElement tMethod = methodInType(t, method);
            if (tMethod != null) {
              return tMethod;
            }
            newTypes.addAll(superinterfaces(t));
          }
          if (t.getKind().isClass()) {
            TypeElement sup = superclass(t);
            if (sup != null) {
              newTypes.add(sup);
            }
          }
        }
        types = newTypes.build();
      }
      return null;
    }

    /**
     * Returns the method from within the given type that has the same erased signature as the given
     * method, or null if there is no such method.
     */
    private @Nullable ExecutableElement methodInType(TypeElement type, ExecutableElement method) {
      int nParams = method.getParameters().size();
      List<TypeMirror> params = erasedParameterTypes(method, type);
      if (params == null) {
        return null;
      }
      methods:
      for (ExecutableElement tMethod : ElementFilter.methodsIn(type.getEnclosedElements())) {
        if (tMethod.getSimpleName().equals(method.getSimpleName())
            && tMethod.getParameters().size() == nParams) {
          for (int i = 0; i < nParams; i++) {
            TypeMirror tParamType = typeUtils.erasure(tMethod.getParameters().get(i).asType());
            if (!typeUtils.isSameType(params.get(i), tParamType)) {
              continue methods;
            }
          }
          return tMethod;
        }
      }
      return null;
    }

    private @Nullable TypeElement superclass(TypeElement type) {
      TypeMirror sup = type.getSuperclass();
      if (sup.getKind() == TypeKind.DECLARED) {
        // asElement returns non-null for DECLARED types.
        return MoreElements.asType(requireNonNull(typeUtils.asElement(sup)));
      } else {
        return null;
      }
    }

    private ImmutableList<TypeElement> superinterfaces(TypeElement type) {
      ImmutableList.Builder<TypeElement> types = ImmutableList.builder();
      for (TypeMirror sup : type.getInterfaces()) {
        /*
         * All interfaces implemented/extended are DECLARED types, for which asElement returns
         * non-null.
         */
        types.add(MoreElements.asType(requireNonNull(typeUtils.asElement(sup))));
      }
      return types.build();
    }

    private TypeElement asTypeElement(TypeMirror typeMirror) {
      DeclaredType declaredType = MoreTypes.asDeclared(typeMirror);
      Element element = declaredType.asElement();
      return MoreElements.asType(element);
    }
  }
}


================================================
FILE: common/src/main/java/com/google/auto/common/SimpleAnnotationMirror.java
================================================
/*
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.google.auto.common;

import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.collect.Immutable
Download .txt
gitextract_g32a_pij/

├── .github/
│   ├── dependabot.yml
│   └── workflows/
│       └── ci.yml
├── .gitignore
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── build-pom.xml
├── common/
│   ├── README.md
│   ├── pom.xml
│   └── src/
│       ├── main/
│       │   └── java/
│       │       └── com/
│       │           └── google/
│       │               └── auto/
│       │                   └── common/
│       │                       ├── AnnotationMirrors.java
│       │                       ├── AnnotationOutput.java
│       │                       ├── AnnotationValues.java
│       │                       ├── BasicAnnotationProcessor.java
│       │                       ├── GeneratedAnnotationSpecs.java
│       │                       ├── GeneratedAnnotations.java
│       │                       ├── MoreElements.java
│       │                       ├── MoreStreams.java
│       │                       ├── MoreTypes.java
│       │                       ├── Overrides.java
│       │                       ├── SimpleAnnotationMirror.java
│       │                       ├── SimpleTypeAnnotationValue.java
│       │                       ├── SuperficialValidation.java
│       │                       ├── Visibility.java
│       │                       └── package-info.java
│       └── test/
│           └── java/
│               └── com/
│                   └── google/
│                       └── auto/
│                           └── common/
│                               ├── AnnotationMirrorsTest.java
│                               ├── AnnotationValuesTest.java
│                               ├── BasicAnnotationProcessorTest.java
│                               ├── GeneratedAnnotationsTest.java
│                               ├── MoreElementsTest.java
│                               ├── MoreTypesIsTypeOfTest.java
│                               ├── MoreTypesTest.java
│                               ├── OverridesTest.java
│                               ├── SimpleAnnotationMirrorTest.java
│                               ├── SimpleTypeAnnotationValueTest.java
│                               ├── SuperficialValidationTest.java
│                               └── VisibilityTest.java
├── factory/
│   ├── README.md
│   ├── pom.xml
│   └── src/
│       ├── it/
│       │   └── functional/
│       │       ├── pom.xml
│       │       └── src/
│       │           ├── main/
│       │           │   └── java/
│       │           │       └── com/
│       │           │           └── google/
│       │           │               └── auto/
│       │           │                   └── factory/
│       │           │                       ├── DaggerModule.java
│       │           │                       ├── Dependency.java
│       │           │                       ├── DependencyImpl.java
│       │           │                       ├── FactoryComponent.java
│       │           │                       ├── FactoryInterface.java
│       │           │                       ├── Foo.java
│       │           │                       ├── GenericFoo.java
│       │           │                       ├── GuiceModule.java
│       │           │                       ├── QualifiedDependencyImpl.java
│       │           │                       ├── Qualifier.java
│       │           │                       ├── ReferencePackage.java
│       │           │                       └── otherpackage/
│       │           │                           └── OtherPackage.java
│       │           └── test/
│       │               └── java/
│       │                   └── com/
│       │                       └── google/
│       │                           └── auto/
│       │                               └── factory/
│       │                                   └── DependencyInjectionIntegrationTest.java
│       ├── main/
│       │   └── java/
│       │       └── com/
│       │           └── google/
│       │               └── auto/
│       │                   └── factory/
│       │                       ├── AutoFactory.java
│       │                       ├── Provided.java
│       │                       ├── package-info.java
│       │                       └── processor/
│       │                           ├── AnnotationValues.java
│       │                           ├── AutoFactoryDeclaration.java
│       │                           ├── AutoFactoryProcessor.java
│       │                           ├── Elements2.java
│       │                           ├── FactoryDescriptor.java
│       │                           ├── FactoryDescriptorGenerator.java
│       │                           ├── FactoryMethodDescriptor.java
│       │                           ├── FactoryWriter.java
│       │                           ├── ImplementationMethodDescriptor.java
│       │                           ├── InjectApi.java
│       │                           ├── Key.java
│       │                           ├── Mirrors.java
│       │                           ├── PackageAndClass.java
│       │                           ├── Parameter.java
│       │                           ├── ProvidedChecker.java
│       │                           ├── ProviderField.java
│       │                           ├── TypeVariables.java
│       │                           └── package-info.java
│       └── test/
│           ├── java/
│           │   └── com/
│           │       └── google/
│           │           └── auto/
│           │               └── factory/
│           │                   └── processor/
│           │                       ├── AutoFactoryDeclarationTest.java
│           │                       ├── AutoFactoryProcessorNegativeTest.java
│           │                       └── AutoFactoryProcessorTest.java
│           └── resources/
│               ├── bad/
│               │   ├── AnnotationsToApplyMultiple.java
│               │   ├── AnnotationsToApplyNotAnnotations.java
│               │   ├── AnnotationsToApplyRepeated.java
│               │   ├── EnumSupertype.java
│               │   ├── FactoryExtendingAbstractClassWithConstructorParams.java
│               │   ├── FinalSupertype.java
│               │   ├── InterfaceSupertype.java
│               │   ├── InvalidCustomName.java
│               │   ├── MixedFinals.java
│               │   ├── ProvidedButNoAutoFactory.java
│               │   └── ProvidedOnMethodParameter.java
│               ├── expected/
│               │   ├── CheckerFrameworkNullableFactory.java
│               │   ├── ClassUsingQualifierWithArgsFactory.java
│               │   ├── ConstructorAnnotatedFactory.java
│               │   ├── ConstructorAnnotatedNonFinalFactory.java
│               │   ├── ConstructorAnnotatedThrowsFactory.java
│               │   ├── CustomAnnotationsFactory.java
│               │   ├── CustomNamedFactory.java
│               │   ├── CustomNullableFactory.java
│               │   ├── DefaultPackageFactory.java
│               │   ├── FactoryExtendingAbstractClassFactory.java
│               │   ├── FactoryExtendingAbstractClassThrowsFactory.java
│               │   ├── FactoryImplementingCreateMethod_ConcreteClassFactory.java
│               │   ├── FactoryImplementingGenericInterfaceExtensionFactory.java
│               │   ├── Generics_ExplicitFooImplFactory.java
│               │   ├── Generics_FooImplFactory.java
│               │   ├── Generics_FooImplWithClassFactory.java
│               │   ├── MixedDepsImplementingInterfacesFactory.java
│               │   ├── MultipleFactoriesConflictingParameterNamesFactory.java
│               │   ├── MultipleFactoriesImplementingInterface_ClassAFactory.java
│               │   ├── MultipleFactoriesImplementingInterface_ClassBFactory.java
│               │   ├── MultipleProvidedParamsSameKeyFactory.java
│               │   ├── NestedClassCustomNamedFactory.java
│               │   ├── NestedClasses_SimpleNestedClassFactory.java
│               │   ├── OnlyPrimitivesFactory.java
│               │   ├── ParameterAnnotationsFactory.java
│               │   ├── ProviderArgumentToCreateMethodFactory.java
│               │   ├── PublicClassFactory.java
│               │   ├── SimpleClassFactory.java
│               │   ├── SimpleClassImplementingMarkerFactory.java
│               │   ├── SimpleClassImplementingSimpleInterfaceFactory.java
│               │   ├── SimpleClassMixedDepsFactory.java
│               │   ├── SimpleClassNonFinalFactory.java
│               │   ├── SimpleClassNullableParametersFactory.java
│               │   ├── SimpleClassPassedDepsFactory.java
│               │   ├── SimpleClassProvidedDepsFactory.java
│               │   ├── SimpleClassProvidedProviderDepsFactory.java
│               │   ├── SimpleClassThrowsFactory.java
│               │   └── SimpleClassVarargsFactory.java
│               ├── good/
│               │   ├── CheckerFrameworkNullable.java
│               │   ├── ClassUsingQualifierWithArgs.java
│               │   ├── ConstructorAnnotated.java
│               │   ├── ConstructorAnnotatedNonFinal.java
│               │   ├── ConstructorAnnotatedThrows.java
│               │   ├── CustomAnnotations.java
│               │   ├── CustomNullable.java
│               │   ├── DefaultPackage.java
│               │   ├── FactoryExtendingAbstractClass.java
│               │   ├── FactoryExtendingAbstractClassThrows.java
│               │   ├── FactoryExtendingAbstractClassWithMultipleConstructors.java
│               │   ├── FactoryImplementingCreateMethod.java
│               │   ├── FactoryImplementingGenericInterfaceExtension.java
│               │   ├── Generics.java
│               │   ├── MixedDepsImplementingInterfaces.java
│               │   ├── MultipleFactoriesConflictingParameterNames.java
│               │   ├── MultipleFactoriesImplementingInterface.java
│               │   ├── MultipleProvidedParamsSameKey.java
│               │   ├── NestedClasses.java
│               │   ├── OnlyPrimitives.java
│               │   ├── ParameterAnnotations.java
│               │   ├── ProviderArgumentToCreateMethod.java
│               │   ├── PublicClass.java
│               │   ├── SimpleClass.java
│               │   ├── SimpleClassCustomName.java
│               │   ├── SimpleClassImplementingMarker.java
│               │   ├── SimpleClassImplementingSimpleInterface.java
│               │   ├── SimpleClassMixedDeps.java
│               │   ├── SimpleClassNonFinal.java
│               │   ├── SimpleClassNullableParameters.java
│               │   ├── SimpleClassPassedDeps.java
│               │   ├── SimpleClassProvidedDeps.java
│               │   ├── SimpleClassProvidedProviderDeps.java
│               │   ├── SimpleClassThrows.java
│               │   └── SimpleClassVarargs.java
│               └── support/
│                   ├── AQualifier.java
│                   ├── BQualifier.java
│                   └── QualifierWithArgs.java
├── service/
│   ├── README.md
│   ├── annotations/
│   │   ├── pom.xml
│   │   └── src/
│   │       └── main/
│   │           └── java/
│   │               └── com/
│   │                   └── google/
│   │                       └── auto/
│   │                           └── service/
│   │                               └── AutoService.java
│   ├── pom.xml
│   └── processor/
│       ├── pom.xml
│       └── src/
│           ├── main/
│           │   ├── java/
│           │   │   └── com/
│           │   │       └── google/
│           │   │           └── auto/
│           │   │               └── service/
│           │   │                   └── processor/
│           │   │                       ├── AutoServiceProcessor.java
│           │   │                       ├── ServicesFiles.java
│           │   │                       └── package-info.java
│           │   └── resources/
│           │       └── META-INF/
│           │           ├── gradle/
│           │           │   └── incremental.annotation.processors
│           │           └── services/
│           │               └── javax.annotation.processing.Processor
│           └── test/
│               ├── java/
│               │   └── com/
│               │       └── google/
│               │           └── auto/
│               │               └── service/
│               │                   └── processor/
│               │                       └── AutoServiceProcessorTest.java
│               └── resources/
│                   ├── META-INF/
│                   │   └── services/
│                   │       ├── test.AnotherService
│                   │       └── test.SomeService
│                   └── test/
│                       ├── AnotherService.java
│                       ├── AnotherServiceProvider.java
│                       ├── AutoServiceOnAbstractClass.java
│                       ├── AutoServiceOnInterface.java
│                       ├── DoesNotImplement.java
│                       ├── DoesNotImplementSuppressed.java
│                       ├── Enclosing.java
│                       ├── EnclosingGeneric.java
│                       ├── GenericService.java
│                       ├── GenericServiceProvider.java
│                       ├── GenericServiceProviderSuppressWarnings.java
│                       ├── GenericServiceProviderWithMissingServiceClass.java
│                       ├── MultiServiceProvider.java
│                       ├── NoServices.java
│                       ├── SomeService.java
│                       ├── SomeServiceProvider1.java
│                       └── SomeServiceProvider2.java
├── util/
│   ├── generate-latest-docs.sh
│   └── publish-snapshot-on-commit.sh
└── value/
    ├── CHANGES.md
    ├── README.md
    ├── annotations/
    │   └── pom.xml
    ├── pom.xml
    ├── processor/
    │   └── pom.xml
    ├── src/
    │   ├── it/
    │   │   ├── functional/
    │   │   │   ├── invoker.properties
    │   │   │   ├── pom.xml
    │   │   │   └── src/
    │   │   │       ├── main/
    │   │   │       │   └── java/
    │   │   │       │       ├── PackagelessNestedValueType.java
    │   │   │       │       ├── PackagelessValueType.java
    │   │   │       │       └── com/
    │   │   │       │           └── google/
    │   │   │       │               └── auto/
    │   │   │       │                   └── value/
    │   │   │       │                       ├── NestedValueType.java
    │   │   │       │                       └── SimpleValueType.java
    │   │   │       └── test/
    │   │   │           └── java/
    │   │   │               ├── PackagelessValueTypeTest.java
    │   │   │               └── com/
    │   │   │                   └── google/
    │   │   │                       └── auto/
    │   │   │                           └── value/
    │   │   │                               ├── AutoAnnotationDefaultsTest.java
    │   │   │                               ├── AutoAnnotationTest.java
    │   │   │                               ├── AutoBuilderKotlinTest.java
    │   │   │                               ├── AutoBuilderTest.java
    │   │   │                               ├── AutoOneOfJava8Test.java
    │   │   │                               ├── AutoOneOfTest.java
    │   │   │                               ├── AutoValueJava8Test.java
    │   │   │                               ├── AutoValueNotEclipseTest.java
    │   │   │                               ├── AutoValueTest.java
    │   │   │                               ├── CompileWithEclipseTest.java
    │   │   │                               ├── GradleIT.java
    │   │   │                               ├── KotlinData.kt
    │   │   │                               ├── SimpleValueTypeTest.java
    │   │   │                               ├── annotations/
    │   │   │                               │   ├── Empty.java
    │   │   │                               │   ├── GwtArrays.java
    │   │   │                               │   ├── StringValues.java
    │   │   │                               │   └── TestAnnotation.java
    │   │   │                               ├── enums/
    │   │   │                               │   └── MyEnum.java
    │   │   │                               └── gwt/
    │   │   │                                   ├── CustomFieldSerializerTest.java
    │   │   │                                   ├── EmptyExtension.java
    │   │   │                                   ├── GwtCompilationTest.java
    │   │   │                                   ├── GwtValueType.java
    │   │   │                                   ├── GwtValueTypeWithBuilder.java
    │   │   │                                   ├── NonSerializableGwtValueType.java
    │   │   │                                   └── SerialSignatureTest.java
    │   │   └── gwtserializer/
    │   │       ├── invoker.properties
    │   │       ├── pom.xml
    │   │       └── src/
    │   │           └── test/
    │   │               └── java/
    │   │                   └── com/
    │   │                       └── google/
    │   │                           └── auto/
    │   │                               └── value/
    │   │                                   ├── GwtSerializerSuite.gwt.xml
    │   │                                   ├── GwtSerializerSuite.java
    │   │                                   └── client/
    │   │                                       └── GwtSerializerTest.java
    │   ├── main/
    │   │   └── java/
    │   │       └── com/
    │   │           └── google/
    │   │               └── auto/
    │   │                   └── value/
    │   │                       ├── AutoAnnotation.java
    │   │                       ├── AutoBuilder.java
    │   │                       ├── AutoOneOf.java
    │   │                       ├── AutoValue.java
    │   │                       ├── extension/
    │   │                       │   ├── AutoValueExtension.java
    │   │                       │   ├── memoized/
    │   │                       │   │   ├── Memoized.java
    │   │                       │   │   └── processor/
    │   │                       │   │       ├── ClassNames.java
    │   │                       │   │       ├── MemoizeExtension.java
    │   │                       │   │       └── MemoizedValidator.java
    │   │                       │   ├── serializable/
    │   │                       │   │   ├── SerializableAutoValue.java
    │   │                       │   │   ├── g3doc/
    │   │                       │   │   │   ├── index.md
    │   │                       │   │   │   └── serializer-extension.md
    │   │                       │   │   ├── processor/
    │   │                       │   │   │   ├── ClassNames.java
    │   │                       │   │   │   ├── PropertyMirror.java
    │   │                       │   │   │   └── SerializableAutoValueExtension.java
    │   │                       │   │   └── serializer/
    │   │                       │   │       ├── SerializerFactoryLoader.java
    │   │                       │   │       ├── impl/
    │   │                       │   │       │   ├── IdentitySerializerFactory.java
    │   │                       │   │       │   ├── ImmutableListSerializerExtension.java
    │   │                       │   │       │   ├── ImmutableMapSerializerExtension.java
    │   │                       │   │       │   ├── OptionalSerializerExtension.java
    │   │                       │   │       │   └── SerializerFactoryImpl.java
    │   │                       │   │       ├── interfaces/
    │   │                       │   │       │   ├── Serializer.java
    │   │                       │   │       │   ├── SerializerExtension.java
    │   │                       │   │       │   └── SerializerFactory.java
    │   │                       │   │       └── runtime/
    │   │                       │   │           └── FunctionWithExceptions.java
    │   │                       │   └── toprettystring/
    │   │                       │       ├── ToPrettyString.java
    │   │                       │       └── processor/
    │   │                       │           ├── Annotations.java
    │   │                       │           ├── ClassNames.java
    │   │                       │           ├── ExtensionClassTypeSpecBuilder.java
    │   │                       │           ├── ToPrettyStringExtension.java
    │   │                       │           ├── ToPrettyStringMethods.java
    │   │                       │           └── ToPrettyStringValidator.java
    │   │                       └── processor/
    │   │                           ├── AbortProcessingException.java
    │   │                           ├── AnnotatedTypeMirror.java
    │   │                           ├── AnnotationOutput.java
    │   │                           ├── AutoAnnotationProcessor.java
    │   │                           ├── AutoAnnotationTemplateVars.java
    │   │                           ├── AutoBuilderAnnotationTemplateVars.java
    │   │                           ├── AutoBuilderProcessor.java
    │   │                           ├── AutoBuilderTemplateVars.java
    │   │                           ├── AutoOneOfProcessor.java
    │   │                           ├── AutoOneOfTemplateVars.java
    │   │                           ├── AutoValueBuilderProcessor.java
    │   │                           ├── AutoValueOrBuilderTemplateVars.java
    │   │                           ├── AutoValueProcessor.java
    │   │                           ├── AutoValueTemplateVars.java
    │   │                           ├── AutoValueishProcessor.java
    │   │                           ├── AutoValueishTemplateVars.java
    │   │                           ├── BuilderMethodClassifier.java
    │   │                           ├── BuilderMethodClassifierForAutoBuilder.java
    │   │                           ├── BuilderMethodClassifierForAutoValue.java
    │   │                           ├── BuilderRequiredProperties.java
    │   │                           ├── BuilderSpec.java
    │   │                           ├── ClassNames.java
    │   │                           ├── EclipseHack.java
    │   │                           ├── ErrorReporter.java
    │   │                           ├── Executable.java
    │   │                           ├── ExtensionContext.java
    │   │                           ├── ForwardingClassGenerator.java
    │   │                           ├── GwtCompatibility.java
    │   │                           ├── GwtSerialization.java
    │   │                           ├── JavaScanner.java
    │   │                           ├── KotlinMetadata.java
    │   │                           ├── MethodSignature.java
    │   │                           ├── MissingTypes.java
    │   │                           ├── Nullables.java
    │   │                           ├── Optionalish.java
    │   │                           ├── PropertyBuilderClassifier.java
    │   │                           ├── PropertyNames.java
    │   │                           ├── Reformatter.java
    │   │                           ├── SimpleMethod.java
    │   │                           ├── SimpleServiceLoader.java
    │   │                           ├── TemplateVars.java
    │   │                           ├── TypeEncoder.java
    │   │                           ├── TypeMirrorSet.java
    │   │                           ├── TypeSimplifier.java
    │   │                           ├── TypeVariables.java
    │   │                           ├── autoannotation.vm
    │   │                           ├── autobuilder.vm
    │   │                           ├── autobuilderannotation.vm
    │   │                           ├── autooneof.vm
    │   │                           ├── autovalue.vm
    │   │                           ├── builder.vm
    │   │                           ├── equalshashcode.vm
    │   │                           ├── gwtserializer.vm
    │   │                           └── package-info.java
    │   └── test/
    │       └── java/
    │           └── com/
    │               └── google/
    │                   └── auto/
    │                       └── value/
    │                           ├── extension/
    │                           │   ├── memoized/
    │                           │   │   ├── MemoizedMethodSubject.java
    │                           │   │   ├── MemoizedMethodSubjectFactory.java
    │                           │   │   ├── MemoizedTest.java
    │                           │   │   └── MemoizedValidationTest.java
    │                           │   ├── serializable/
    │                           │   │   ├── processor/
    │                           │   │   │   └── SerializableAutoValueExtensionTest.java
    │                           │   │   └── serializer/
    │                           │   │       ├── SerializerFactoryLoaderTest.java
    │                           │   │       ├── impl/
    │                           │   │       │   ├── IdentitySerializerFactoryTest.java
    │                           │   │       │   ├── ImmutableListSerializerExtensionTest.java
    │                           │   │       │   ├── ImmutableMapSerializerExtensionTest.java
    │                           │   │       │   ├── OptionalSerializerExtensionTest.java
    │                           │   │       │   └── SerializerFactoryImplTest.java
    │                           │   │       └── utils/
    │                           │   │           ├── CompilationAbstractTest.java
    │                           │   │           ├── FakeSerializerFactory.java
    │                           │   │           └── TestStringSerializerFactory.java
    │                           │   └── toprettystring/
    │                           │       ├── ToPrettyStringTest.java
    │                           │       └── ToPrettyStringValidatorTest.java
    │                           └── processor/
    │                               ├── AutoAnnotationCompilationTest.java
    │                               ├── AutoAnnotationErrorsTest.java
    │                               ├── AutoBuilderCompilationTest.java
    │                               ├── AutoOneOfCompilationTest.java
    │                               ├── AutoValueCompilationTest.java
    │                               ├── BuilderRequiredPropertiesTest.java
    │                               ├── ExtensionTest.java
    │                               ├── ForwardingClassGeneratorTest.java
    │                               ├── GeneratedDoesNotExistTest.java
    │                               ├── GeneratedImport.java
    │                               ├── GuavaCollectionBuildersTest.java
    │                               ├── IncrementalExtensionTest.java
    │                               ├── JavaScannerTest.java
    │                               ├── NullablesTest.java
    │                               ├── PropertyAnnotationsTest.java
    │                               ├── PropertyNamesTest.java
    │                               ├── ReformatterTest.java
    │                               ├── SimpleServiceLoaderTest.java
    │                               ├── SimplifyWithAnnotationsTest.java
    │                               ├── TemplateVarsTest.java
    │                               ├── TypeEncoderTest.java
    │                               ├── TypeSimplifierTest.java
    │                               ├── TypeVariablesTest.java
    │                               └── testclasses/
    │                                   └── RuntimePermission.java
    └── userguide/
        ├── autobuilder.md
        ├── builders-howto.md
        ├── builders.md
        ├── design-faq.md
        ├── extensions.md
        ├── generated-builder-example.md
        ├── generated-example.md
        ├── howto.md
        ├── index.md
        ├── performance.md
        ├── practices.md
        ├── records.md
        ├── trouble.md
        └── why.md
Download .txt
Showing preview only (395K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (5154 symbols across 297 files)

FILE: common/src/main/java/com/google/auto/common/AnnotationMirrors.java
  class AnnotationMirrors (line 43) | public final class AnnotationMirrors {
    method doEquivalent (line 46) | @Override
    method doHash (line 57) | @Override
    method toString (line 69) | @Override
    method equivalence (line 80) | public static Equivalence<AnnotationMirror> equivalence() {
    method getAnnotationValuesWithDefaults (line 95) | public static ImmutableMap<ExecutableElement, AnnotationValue> getAnno...
    method getAnnotationValue (line 128) | public static AnnotationValue getAnnotationValue(
    method getAnnotationElementAndValue (line 140) | public static Map.Entry<ExecutableElement, AnnotationValue> getAnnotat...
    method getAnnotatedAnnotations (line 162) | public static ImmutableSet<AnnotationMirror> getAnnotatedAnnotations(
    method getAnnotatedAnnotations (line 175) | public static ImmutableSet<AnnotationMirror> getAnnotatedAnnotations(
    method getAnnotatedAnnotations (line 187) | public static ImmutableSet<AnnotationMirror> getAnnotatedAnnotations(
    method toString (line 201) | public static String toString(AnnotationMirror annotationMirror) {
    method AnnotationMirrors (line 205) | private AnnotationMirrors() {}

FILE: common/src/main/java/com/google/auto/common/AnnotationOutput.java
  class AnnotationOutput (line 39) | final class AnnotationOutput {
    method AnnotationOutput (line 40) | private AnnotationOutput() {}
    class SourceFormVisitor (line 51) | private static class SourceFormVisitor
      method formatType (line 54) | private String formatType(TypeMirror typeMirror) {
      method defaultAction (line 58) | @Override
      method visitArray (line 64) | @Override
      method visitByte (line 77) | @Override
      method visitShort (line 83) | @Override
      method visitChar (line 89) | @Override
      method visitLong (line 95) | @Override
      method visitDouble (line 101) | @Override
      method visitFloat (line 115) | @Override
      method visitEnumConstant (line 129) | @Override
      method visitString (line 135) | @Override
      method visitType (line 141) | @Override
      method visitAnnotation (line 147) | @Override
    method maybeShorten (line 171) | private static AnnotationValue maybeShorten(AnnotationValue value) {
    method visitArray (line 177) | @Override
    method defaultAction (line 189) | @Override
    method shortForm (line 196) | private static Optional<AnnotationValue> shortForm(
    method toString (line 209) | static String toString(AnnotationValue annotationValue) {
    method toString (line 219) | static String toString(AnnotationMirror annotationMirror) {
    method appendQuoted (line 225) | private static StringBuilder appendQuoted(StringBuilder sb, String s) {
    method appendQuoted (line 233) | private static StringBuilder appendQuoted(StringBuilder sb, char c) {
    method appendEscaped (line 239) | private static void appendEscaped(StringBuilder sb, char c) {

FILE: common/src/main/java/com/google/auto/common/AnnotationValues.java
  class AnnotationValues (line 37) | public final class AnnotationValues {
    method doEquivalent (line 40) | @Override
    method doHash (line 126) | @Override
    method toString (line 156) | @Override
    method equivalence (line 170) | public static Equivalence<AnnotationValue> equivalence() {
    class DefaultVisitor (line 174) | private static class DefaultVisitor<T> extends SimpleAnnotationValueVi...
      method DefaultVisitor (line 177) | DefaultVisitor(Class<T> clazz) {
      method defaultAction (line 181) | @Override
    class TypeMirrorVisitor (line 188) | private static final class TypeMirrorVisitor extends DefaultVisitor<De...
      method TypeMirrorVisitor (line 191) | TypeMirrorVisitor() {
      method visitType (line 195) | @Override
    method getTypeMirror (line 207) | public static DeclaredType getTypeMirror(AnnotationValue value) {
    class AnnotationMirrorVisitor (line 211) | private static final class AnnotationMirrorVisitor extends DefaultVisi...
      method AnnotationMirrorVisitor (line 214) | AnnotationMirrorVisitor() {
      method visitAnnotation (line 218) | @Override
    method getAnnotationMirror (line 230) | public static AnnotationMirror getAnnotationMirror(AnnotationValue val...
    class EnumVisitor (line 234) | private static final class EnumVisitor extends DefaultVisitor<Variable...
      method EnumVisitor (line 237) | EnumVisitor() {
      method visitEnumConstant (line 241) | @Override
    method getEnum (line 252) | public static VariableElement getEnum(AnnotationValue value) {
    method valueOfType (line 256) | private static <T> T valueOfType(AnnotationValue annotationValue, Clas...
    method getString (line 270) | public static String getString(AnnotationValue value) {
    method getInt (line 279) | public static int getInt(AnnotationValue value) {
    method getLong (line 288) | public static long getLong(AnnotationValue value) {
    method getByte (line 297) | public static byte getByte(AnnotationValue value) {
    method getShort (line 306) | public static short getShort(AnnotationValue value) {
    method getFloat (line 315) | public static float getFloat(AnnotationValue value) {
    method getDouble (line 324) | public static double getDouble(AnnotationValue value) {
    method getBoolean (line 333) | public static boolean getBoolean(AnnotationValue value) {
    method getChar (line 342) | public static char getChar(AnnotationValue value) {
    class ArrayVisitor (line 346) | private static final class ArrayVisitor<T>
      method ArrayVisitor (line 350) | ArrayVisitor(Function<AnnotationValue, T> visitT) {
      method defaultAction (line 354) | @Override
      method visitArray (line 359) | @Override
    method getTypeMirrors (line 373) | public static ImmutableList<DeclaredType> getTypeMirrors(AnnotationVal...
    method getAnnotationMirrors (line 385) | public static ImmutableList<AnnotationMirror> getAnnotationMirrors(Ann...
    method getEnums (line 397) | public static ImmutableList<VariableElement> getEnums(AnnotationValue ...
    method getStrings (line 409) | public static ImmutableList<String> getStrings(AnnotationValue value) {
    method getInts (line 421) | public static ImmutableList<Integer> getInts(AnnotationValue value) {
    method getLongs (line 433) | public static ImmutableList<Long> getLongs(AnnotationValue value) {
    method getBytes (line 445) | public static ImmutableList<Byte> getBytes(AnnotationValue value) {
    method getShorts (line 457) | public static ImmutableList<Short> getShorts(AnnotationValue value) {
    method getFloats (line 469) | public static ImmutableList<Float> getFloats(AnnotationValue value) {
    method getDoubles (line 481) | public static ImmutableList<Double> getDoubles(AnnotationValue value) {
    method getBooleans (line 493) | public static ImmutableList<Boolean> getBooleans(AnnotationValue value) {
    method getChars (line 505) | public static ImmutableList<Character> getChars(AnnotationValue value) {
    method getAnnotationValues (line 517) | public static ImmutableList<AnnotationValue> getAnnotationValues(Annot...
    method toString (line 534) | public static String toString(AnnotationValue annotationValue) {
    method AnnotationValues (line 538) | private AnnotationValues() {}

FILE: common/src/main/java/com/google/auto/common/BasicAnnotationProcessor.java
  class BasicAnnotationProcessor (line 112) | public abstract class BasicAnnotationProcessor extends AbstractProcessor {
    method init (line 136) | @Override
    method initSteps (line 150) | @Deprecated
    method steps (line 162) | protected Iterable<? extends Step> steps() {
    method postProcess (line 171) | @Deprecated
    method postRound (line 175) | protected void postRound(RoundEnvironment roundEnv) {
    method getSupportedAnnotationTypeElements (line 181) | private ImmutableSet<TypeElement> getSupportedAnnotationTypeElements() {
    method getSupportedAnnotationTypeElements (line 188) | private ImmutableSet<TypeElement> getSupportedAnnotationTypeElements(S...
    method getSupportedAnnotationTypes (line 199) | @Override
    method process (line 205) | @Override
    method process (line 234) | private void process(ImmutableSetMultimap<TypeElement, Element> wellFo...
    method reportMissingElements (line 256) | private void reportMissingElements(Set<ElementFactory> missingElementF...
    method processingErrorMessage (line 270) | private String processingErrorMessage(String target) {
    method getWellFormedElementsByAnnotationType (line 286) | private ImmutableSetMultimap<TypeElement, Element> getWellFormedElemen...
    method indexByAnnotation (line 346) | private ImmutableSetMultimap<TypeElement, Element> indexByAnnotation(
    method findAnnotatedElements (line 381) | private static void findAnnotatedElements(
    method getEnclosingType (line 421) | private static TypeElement getEnclosingType(Element element) {
    method toClassNameKeyedMultimap (line 433) | private static ImmutableSetMultimap<String, Element> toClassNameKeyedM...
    method isExecutable (line 444) | private static boolean isExecutable(Element element) {
    method asStep (line 453) | protected static Step asStep(ProcessingStep processingStep) {
    type Step (line 462) | public interface Step {
      method annotations (line 469) | Set<String> annotations();
      method process (line 479) | Set<? extends Element> process(ImmutableSetMultimap<String, Element>...
    type ProcessingStep (line 489) | @Deprecated
      method annotations (line 493) | Set<? extends Class<? extends Annotation>> annotations();
      method process (line 503) | Set<? extends Element> process(
    class ProcessingStepAsStep (line 507) | private static class ProcessingStepAsStep implements Step {
      method ProcessingStepAsStep (line 512) | ProcessingStepAsStep(ProcessingStep processingStep) {
      method annotations (line 522) | @Override
      method process (line 527) | @Override
      method toClassKeyedMultimap (line 533) | private ImmutableSetMultimap<Class<? extends Annotation>, Element> t...
    class ElementFactory (line 559) | private abstract static class ElementFactory {
      method ElementFactory (line 562) | private ElementFactory(Element element) {
      method forAnnotatedElement (line 567) | static ElementFactory forAnnotatedElement(Element element, Messager ...
      method equals (line 601) | @Override
      method hashCode (line 613) | @Override
      method getElement (line 622) | abstract @Nullable Element getElement(Elements elementUtils);
    class UnsupportedElementFactory (line 629) | private static final class UnsupportedElementFactory extends ElementFa...
      method UnsupportedElementFactory (line 632) | private UnsupportedElementFactory(Element element) {
      method getElement (line 637) | @Override
    class PackageElementFactory (line 647) | private static final class PackageElementFactory extends ElementFactory {
      method PackageElementFactory (line 648) | private PackageElementFactory(Element element) {
      method getElement (line 652) | @Override
    class TypeElementFactory (line 658) | private static final class TypeElementFactory extends ElementFactory {
      method TypeElementFactory (line 659) | private TypeElementFactory(Element element) {
      method getElement (line 663) | @Override
    class TypeParameterElementFactory (line 669) | private static final class TypeParameterElementFactory extends Element...
      method TypeParameterElementFactory (line 672) | private TypeParameterElementFactory(Element element, Messager messag...
      method getElement (line 678) | @Override
      method equals (line 690) | @Override
      method hashCode (line 703) | @Override
    class FieldOrRecordComponentElementFactory (line 710) | private static class FieldOrRecordComponentElementFactory extends Elem...
      method FieldOrRecordComponentElementFactory (line 714) | private FieldOrRecordComponentElementFactory(Element element) {
      method getElement (line 720) | @Override
      method equals (line 733) | @Override
      method hashCode (line 743) | @Override
    class ExecutableElementFactory (line 774) | private static final class ExecutableElementFactory extends ElementFac...
      method ExecutableElementFactory (line 785) | private ExecutableElementFactory(Element element) {
      method getElement (line 796) | @Override
      method sameNameMethods (line 806) | private static ImmutableList<Element> sameNameMethods(
      method equals (line 813) | @Override
      method hashCode (line 827) | @Override
    class ParameterElementFactory (line 833) | private static final class ParameterElementFactory extends ElementFact...
      method ParameterElementFactory (line 836) | private ParameterElementFactory(Element element) {
      method getElement (line 842) | @Override
      method equals (line 855) | @Override
      method hashCode (line 868) | @Override

FILE: common/src/main/java/com/google/auto/common/GeneratedAnnotationSpecs.java
  class GeneratedAnnotationSpecs (line 25) | public final class GeneratedAnnotationSpecs {
    method GeneratedAnnotationSpecs (line 27) | private GeneratedAnnotationSpecs() {}
    method generatedAnnotationSpec (line 36) | @Deprecated
    method generatedAnnotationSpec (line 50) | @Deprecated
    method generatedAnnotationSpec (line 64) | public static Optional<AnnotationSpec> generatedAnnotationSpec(
    method generatedAnnotationSpec (line 78) | public static Optional<AnnotationSpec> generatedAnnotationSpec(
    method generatedAnnotationSpecBuilder (line 84) | private static Optional<AnnotationSpec.Builder> generatedAnnotationSpe...
    method generatedAnnotationSpecBuilder (line 93) | private static Optional<AnnotationSpec.Builder> generatedAnnotationSpe...

FILE: common/src/main/java/com/google/auto/common/GeneratedAnnotations.java
  class GeneratedAnnotations (line 24) | public final class GeneratedAnnotations {
    method GeneratedAnnotations (line 25) | private GeneratedAnnotations() {}
    method generatedAnnotation (line 37) | @Deprecated
    method generatedAnnotation (line 54) | public static Optional<TypeElement> generatedAnnotation(

FILE: common/src/main/java/com/google/auto/common/MoreElements.java
  class MoreElements (line 56) | @Beta
    method getPackage (line 64) | public static PackageElement getPackage(Element element) {
    class PackageElementVisitor (line 71) | private static final class PackageElementVisitor extends CastingElemen...
      method PackageElementVisitor (line 74) | PackageElementVisitor() {
      method visitPackage (line 78) | @Override
    method asPackage (line 93) | public static PackageElement asPackage(Element element) {
    class TypeElementVisitor (line 97) | private static final class TypeElementVisitor extends CastingElementVi...
      method TypeElementVisitor (line 100) | TypeElementVisitor() {
      method visitType (line 104) | @Override
    method isType (line 118) | public static boolean isType(Element element) {
    method asType (line 131) | public static TypeElement asType(Element element) {
    method asTypeParameter (line 144) | public static TypeParameterElement asTypeParameter(Element element) {
    class TypeParameterElementVisitor (line 148) | private static final class TypeParameterElementVisitor
      method TypeParameterElementVisitor (line 152) | TypeParameterElementVisitor() {
      method visitTypeParameter (line 156) | @Override
    class VariableElementVisitor (line 162) | private static final class VariableElementVisitor extends CastingEleme...
      method VariableElementVisitor (line 165) | VariableElementVisitor() {
      method visitVariable (line 169) | @Override
    method asVariable (line 184) | public static VariableElement asVariable(Element element) {
    class ExecutableElementVisitor (line 188) | private static final class ExecutableElementVisitor
      method ExecutableElementVisitor (line 192) | ExecutableElementVisitor() {
      method visitExecutable (line 196) | @Override
    method asExecutable (line 211) | public static ExecutableElement asExecutable(Element element) {
    method isAnnotationPresent (line 222) | public static boolean isAnnotationPresent(
    method isAnnotationPresent (line 234) | public static boolean isAnnotationPresent(Element element, TypeElement...
    method isAnnotationPresent (line 244) | public static boolean isAnnotationPresent(Element element, String anno...
    method getAnnotationMirror (line 254) | public static Optional<AnnotationMirror> getAnnotationMirror(
    method getAnnotationMirror (line 269) | public static Optional<AnnotationMirror> getAnnotationMirror(
    method getAnnotationMirror (line 285) | public static Optional<AnnotationMirror> getAnnotationMirror(
    method hasModifiers (line 308) | public static <T extends Element> Predicate<T> hasModifiers(Modifier.....
    method hasModifiers (line 325) | public static <T extends Element> Predicate<T> hasModifiers(final Set<...
    method getLocalAndInheritedMethods (line 359) | @Deprecated
    method getLocalAndInheritedMethods (line 392) | public static ImmutableSet<ExecutableElement> getLocalAndInheritedMeth...
    method getLocalAndInheritedMethods (line 397) | private static ImmutableSet<ExecutableElement> getLocalAndInheritedMet...
    method overrides (line 423) | public static boolean overrides(
    method getAllMethods (line 457) | public static ImmutableSet<ExecutableElement> getAllMethods(
    method getAllMethods (line 462) | private static ImmutableSet<ExecutableElement> getAllMethods(
    method getAllMethods (line 497) | private static void getAllMethods(
    method methodVisibleFromPackage (line 512) | static boolean methodVisibleFromPackage(ExecutableElement method, Pack...
    class CastingElementVisitor (line 527) | private abstract static class CastingElementVisitor<T> extends SimpleE...
      method CastingElementVisitor (line 530) | CastingElementVisitor(String label) {
      method defaultAction (line 534) | @Override
    method MoreElements (line 540) | private MoreElements() {}

FILE: common/src/main/java/com/google/auto/common/MoreStreams.java
  class MoreStreams (line 39) | public final class MoreStreams {
    method toImmutableList (line 42) | public static <T> Collector<T, ?, ImmutableList<T>> toImmutableList() {
    method toImmutableSet (line 47) | public static <T> Collector<T, ?, ImmutableSet<T>> toImmutableSet() {
    method toImmutableMap (line 52) | public static <T, K, V> Collector<T, ?, ImmutableMap<K, V>> toImmutabl...
    method toImmutableBiMap (line 64) | public static <T, K, V> Collector<T, ?, ImmutableBiMap<K, V>> toImmuta...
    method MoreStreams (line 75) | private MoreStreams() {}

FILE: common/src/main/java/com/google/auto/common/MoreTypes.java
  class MoreTypes (line 65) | public final class MoreTypes {
    class TypeEquivalence (line 66) | private static final class TypeEquivalence extends Equivalence<TypeMir...
      method doEquivalent (line 69) | @Override
      method doHash (line 74) | @Override
      method toString (line 79) | @Override
    method equivalence (line 100) | public static Equivalence<TypeMirror> equivalence() {
    class EqualVisitorParam (line 120) | private static final class EqualVisitorParam {
    class ComparedElements (line 125) | private static class ComparedElements {
      method ComparedElements (line 131) | ComparedElements(
      method equals (line 142) | @Override
      method hashCode (line 184) | @Override
    class EqualVisitor (line 190) | private static final class EqualVisitor extends SimpleTypeVisitor8<Boo...
      method defaultAction (line 193) | @Override
      method visitArray (line 198) | @Override
      method visitDeclared (line 207) | @Override
      method visitError (line 232) | @Override
      method visitExecutable (line 238) | @Override
      method visitIntersection (line 250) | @Override
      method visitTypeVariable (line 259) | @Override
      method visitWildcard (line 284) | @Override
      method visitUnknown (line 294) | @Override
      method visitingSetPlus (line 299) | private Set<ComparedElements> visitingSetPlus(
      method visitingSetPlus (line 305) | private Set<ComparedElements> visitingSetPlus(
    method equal (line 321) | @SuppressWarnings("TypeEquals")
    method enclosingType (line 355) | private static @Nullable TypeMirror enclosingType(DeclaredType t) {
    method equalLists (line 364) | private static boolean equalLists(
    class HashVisitor (line 387) | private static final class HashVisitor extends SimpleTypeVisitor8<Inte...
      method hashKind (line 390) | int hashKind(int seed, TypeMirror t) {
      method defaultAction (line 396) | @Override
      method visitArray (line 401) | @Override
      method visitDeclared (line 409) | @Override
      method visitExecutable (line 427) | @Override
      method visitTypeVariable (line 441) | @Override
      method visitWildcard (line 454) | @Override
      method visitUnknown (line 464) | @Override
    method hashList (line 470) | private static int hashList(List<? extends TypeMirror> mirrors, Set<El...
    method hash (line 479) | private static int hash(TypeMirror mirror, Set<Element> visiting) {
    method referencedTypes (line 487) | public static ImmutableSet<TypeElement> referencedTypes(TypeMirror typ...
    class ReferencedTypes (line 494) | private static final class ReferencedTypes
      method visitArray (line 498) | @Override
      method visitDeclared (line 504) | @Override
      method visitTypeVariable (line 513) | @Override
      method visitWildcard (line 520) | @Override
    method asElement (line 543) | public static Element asElement(TypeMirror typeMirror) {
    class AsElementVisitor (line 547) | private static final class AsElementVisitor extends SimpleTypeVisitor8...
      method defaultAction (line 550) | @Override
      method visitDeclared (line 555) | @Override
      method visitError (line 560) | @Override
      method visitTypeVariable (line 565) | @Override
    method asTypeElement (line 573) | public static TypeElement asTypeElement(TypeMirror mirror) {
    method asTypeElements (line 577) | public static ImmutableSet<TypeElement> asTypeElements(Iterable<? exte...
    method asArray (line 590) | public static ArrayType asArray(TypeMirror maybeArrayType) {
    class ArrayTypeVisitor (line 594) | private static final class ArrayTypeVisitor extends CastingTypeVisitor...
      method ArrayTypeVisitor (line 597) | ArrayTypeVisitor() {
      method visitArray (line 601) | @Override
    method asDeclared (line 611) | public static DeclaredType asDeclared(TypeMirror maybeDeclaredType) {
    class DeclaredTypeVisitor (line 615) | private static final class DeclaredTypeVisitor extends CastingTypeVisi...
      method DeclaredTypeVisitor (line 618) | DeclaredTypeVisitor() {
      method visitDeclared (line 622) | @Override
    method asError (line 632) | public static ErrorType asError(TypeMirror maybeErrorType) {
    class ErrorTypeVisitor (line 636) | private static final class ErrorTypeVisitor extends CastingTypeVisitor...
      method ErrorTypeVisitor (line 639) | ErrorTypeVisitor() {
      method visitError (line 643) | @Override
    method asExecutable (line 653) | public static ExecutableType asExecutable(TypeMirror maybeExecutableTy...
    class ExecutableTypeVisitor (line 657) | private static final class ExecutableTypeVisitor extends CastingTypeVi...
      method ExecutableTypeVisitor (line 660) | ExecutableTypeVisitor() {
      method visitExecutable (line 664) | @Override
    method asIntersection (line 674) | public static IntersectionType asIntersection(TypeMirror maybeIntersec...
    class IntersectionTypeVisitor (line 678) | private static final class IntersectionTypeVisitor extends CastingType...
      method IntersectionTypeVisitor (line 681) | IntersectionTypeVisitor() {
      method visitIntersection (line 685) | @Override
    method asNoType (line 695) | public static NoType asNoType(TypeMirror maybeNoType) {
    class NoTypeVisitor (line 699) | private static final class NoTypeVisitor extends CastingTypeVisitor<No...
      method NoTypeVisitor (line 702) | NoTypeVisitor() {
      method visitNoType (line 706) | @Override
    method asNullType (line 716) | public static NullType asNullType(TypeMirror maybeNullType) {
    class NullTypeVisitor (line 720) | private static final class NullTypeVisitor extends CastingTypeVisitor<...
      method NullTypeVisitor (line 723) | NullTypeVisitor() {
      method visitNull (line 727) | @Override
    method asPrimitiveType (line 737) | public static PrimitiveType asPrimitiveType(TypeMirror maybePrimitiveT...
    class PrimitiveTypeVisitor (line 741) | private static final class PrimitiveTypeVisitor extends CastingTypeVis...
      method PrimitiveTypeVisitor (line 744) | PrimitiveTypeVisitor() {
      method visitPrimitive (line 748) | @Override
    method asTypeVariable (line 762) | public static TypeVariable asTypeVariable(TypeMirror maybeTypeVariable) {
    class TypeVariableVisitor (line 766) | private static final class TypeVariableVisitor extends CastingTypeVisi...
      method TypeVariableVisitor (line 769) | TypeVariableVisitor() {
      method visitTypeVariable (line 773) | @Override
    method asWildcard (line 783) | public static WildcardType asWildcard(TypeMirror maybeWildcardType) {
    class WildcardTypeVisitor (line 787) | private static final class WildcardTypeVisitor extends CastingTypeVisi...
      method WildcardTypeVisitor (line 790) | WildcardTypeVisitor() {
      method visitWildcard (line 794) | @Override
    method isType (line 805) | public static boolean isType(TypeMirror type) {
    class IsTypeVisitor (line 809) | private static final class IsTypeVisitor extends SimpleTypeVisitor8<Bo...
      method defaultAction (line 812) | @Override
      method visitNoType (line 817) | @Override
      method visitPrimitive (line 822) | @Override
      method visitArray (line 827) | @Override
      method visitDeclared (line 832) | @Override
    method isTypeOf (line 843) | public static boolean isTypeOf(final Class<?> clazz, TypeMirror type) {
    class IsTypeOf (line 848) | private static final class IsTypeOf extends SimpleTypeVisitor8<Boolean...
      method IsTypeOf (line 851) | IsTypeOf(Class<?> clazz) {
      method defaultAction (line 855) | @Override
      method visitNoType (line 860) | @Override
      method visitError (line 868) | @Override
      method visitPrimitive (line 873) | @Override
      method visitArray (line 897) | @Override
      method visitDeclared (line 902) | @Override
    method nonObjectSuperclass (line 915) | public static Optional<DeclaredType> nonObjectSuperclass(
    method isObjectType (line 942) | private static boolean isObjectType(DeclaredType type) {
    method asMemberOf (line 953) | public static TypeMirror asMemberOf(
    class CastingTypeVisitor (line 977) | private abstract static class CastingTypeVisitor<T> extends SimpleType...
      method CastingTypeVisitor (line 980) | CastingTypeVisitor(String label) {
      method defaultAction (line 984) | @Override
    method isConversionFromObjectUnchecked (line 996) | public static boolean isConversionFromObjectUnchecked(TypeMirror type) {
    class CastingUncheckedVisitor (line 1005) | private static class CastingUncheckedVisitor extends SimpleTypeVisitor...
      method CastingUncheckedVisitor (line 1006) | CastingUncheckedVisitor() {
      method visitUnknown (line 1010) | @Override
      method visitArray (line 1017) | @Override
      method visitDeclared (line 1022) | @Override
      method visitTypeVariable (line 1027) | @Override
      method uncheckedTypeArgument (line 1035) | private static boolean uncheckedTypeArgument(TypeMirror arg) {
      method isJavaLangObject (line 1047) | private static boolean isJavaLangObject(TypeMirror type) {
    method MoreTypes (line 1056) | private MoreTypes() {}

FILE: common/src/main/java/com/google/auto/common/Overrides.java
  class Overrides (line 58) | abstract class Overrides {
    method overrides (line 59) | abstract boolean overrides(
    class NativeOverrides (line 62) | static class NativeOverrides extends Overrides {
      method NativeOverrides (line 65) | NativeOverrides(Elements elementUtils) {
      method overrides (line 69) | @Override
    class ExplicitOverrides (line 75) | static class ExplicitOverrides extends Overrides {
      method ExplicitOverrides (line 78) | ExplicitOverrides(Types typeUtils) {
      method overrides (line 82) | @Override
      method isSubsignature (line 196) | private boolean isSubsignature(
      method erasedParameterTypes (line 239) | @Nullable ImmutableList<TypeMirror> erasedParameterTypes(
      class TypeSubstVisitor (line 257) | private class TypeSubstVisitor extends SimpleTypeVisitor8<TypeMirror...
        method erasedParameterTypes (line 273) | @Nullable ImmutableList<TypeMirror> erasedParameterTypes(
        method defaultAction (line 310) | @Override
        method visitTypeVariable (line 315) | @Override
        method visitDeclared (line 329) | @Override
        method visitArray (line 348) | @Override
      method methodFromSuperclasses (line 359) | @Nullable ExecutableElement methodFromSuperclasses(TypeElement in, E...
      method methodFromSuperinterfaces (line 374) | @Nullable ExecutableElement methodFromSuperinterfaces(
      method methodInType (line 411) | private @Nullable ExecutableElement methodInType(TypeElement type, E...
      method superclass (line 433) | private @Nullable TypeElement superclass(TypeElement type) {
      method superinterfaces (line 443) | private ImmutableList<TypeElement> superinterfaces(TypeElement type) {
      method asTypeElement (line 455) | private TypeElement asTypeElement(TypeMirror typeMirror) {

FILE: common/src/main/java/com/google/auto/common/SimpleAnnotationMirror.java
  class SimpleAnnotationMirror (line 46) | public final class SimpleAnnotationMirror implements AnnotationMirror {
    method SimpleAnnotationMirror (line 51) | private SimpleAnnotationMirror(
    method of (line 94) | public static AnnotationMirror of(TypeElement annotationType) {
    method of (line 103) | public static AnnotationMirror of(
    method getAnnotationType (line 108) | @Override
    method getElementValues (line 113) | @Override
    method toString (line 118) | @Override
    method equals (line 130) | @Override
    method hashCode (line 136) | @Override

FILE: common/src/main/java/com/google/auto/common/SimpleTypeAnnotationValue.java
  class SimpleTypeAnnotationValue (line 31) | public final class SimpleTypeAnnotationValue implements AnnotationValue {
    method SimpleTypeAnnotationValue (line 34) | private SimpleTypeAnnotationValue(TypeMirror value) {
    method of (line 56) | public static AnnotationValue of(TypeMirror value) {
    method getValue (line 60) | @Override
    method toString (line 65) | @Override
    method accept (line 70) | @Override

FILE: common/src/main/java/com/google/auto/common/SuperficialValidation.java
  class SuperficialValidation (line 49) | public final class SuperficialValidation {
    method validateElements (line 53) | public static boolean validateElements(Iterable<? extends Element> ele...
    method visitPackage (line 60) | @Override
    method visitType (line 66) | @Override
    method visitVariable (line 74) | @Override
    method visitExecutable (line 79) | @Override
    method visitTypeParameter (line 90) | @Override
    method visitUnknown (line 95) | @Override
    method validateElement (line 108) | public static boolean validateElement(Element element) {
    method isValidBaseElement (line 112) | private static boolean isValidBaseElement(Element e) {
    method validateTypes (line 118) | private static boolean validateTypes(Iterable<? extends TypeMirror> ty...
    method defaultAction (line 134) | @Override
    method visitArray (line 139) | @Override
    method visitDeclared (line 144) | @Override
    method visitError (line 149) | @Override
    method visitUnknown (line 154) | @Override
    method visitWildcard (line 160) | @Override
    method visitExecutable (line 168) | @Override
    method validateType (line 183) | public static boolean validateType(TypeMirror type) {
    method validateAnnotations (line 187) | private static boolean validateAnnotations(
    method validateAnnotation (line 197) | private static boolean validateAnnotation(AnnotationMirror annotationM...
    method validateAnnotationValues (line 202) | private static boolean validateAnnotationValues(
    method defaultAction (line 214) | @Override
    method visitUnknown (line 219) | @Override
    method visitAnnotation (line 225) | @Override
    method visitArray (line 231) | @Override
    method visitEnumConstant (line 240) | @Override
    method visitType (line 246) | @Override
    method visitBoolean (line 255) | @Override
    method visitByte (line 260) | @Override
    method visitChar (line 265) | @Override
    method visitDouble (line 270) | @Override
    method visitFloat (line 275) | @Override
    method visitInt (line 280) | @Override
    method visitLong (line 285) | @Override
    method visitShort (line 290) | @Override
    method validateAnnotationValue (line 296) | private static boolean validateAnnotationValue(
    method SuperficialValidation (line 301) | private SuperficialValidation() {}

FILE: common/src/main/java/com/google/auto/common/Visibility.java
  type Visibility (line 37) | public enum Visibility {
    method ofElement (line 53) | public static Visibility ofElement(Element element) {
    method effectiveVisibilityOfElement (line 75) | public static Visibility effectiveVisibilityOfElement(Element element) {

FILE: common/src/test/java/com/google/auto/common/AnnotationMirrorsTest.java
  class AnnotationMirrorsTest (line 46) | @RunWith(JUnit4.class)
    method setUp (line 52) | @Before
    class SimplyAnnotated (line 59) | @SimpleAnnotation
    class AlsoSimplyAnnotated (line 62) | @SimpleAnnotation
    type SimpleEnum (line 65) | enum SimpleEnum {
    class TestClassBlah (line 74) | @Outer(BLAH)
    class TestClassBlah2 (line 77) | @Outer(BLAH)
    class TestClassFoo (line 80) | @Outer(FOO)
    class TestWithDefaultingOuterDefault (line 87) | @DefaultingOuter
    class TestWithDefaultingOuterBlah (line 90) | @DefaultingOuter(BLAH)
    class TestWithDefaultingOuterFoo (line 93) | @DefaultingOuter(FOO)
    class TestDefaultNestedAnnotated (line 100) | @AnnotatedOuter(@DefaultingOuter)
    class TestBlahNestedAnnotated (line 103) | @AnnotatedOuter(@DefaultingOuter(BLAH))
    class TestFooNestedAnnotated (line 106) | @AnnotatedOuter(@DefaultingOuter(FOO))
    class TestValueArrayWithDefault (line 113) | @OuterWithValueArray
    class TestValueArrayWithEmpty (line 116) | @OuterWithValueArray({})
    class TestValueArrayWithOneDefault (line 119) | @OuterWithValueArray({@DefaultingOuter})
    class TestValueArrayWithOneBlah (line 122) | @OuterWithValueArray(@DefaultingOuter(BLAH))
    class TestValueArrayWithOneFoo (line 125) | @OuterWithValueArray(@DefaultingOuter(FOO))
    class TestValueArrayWithFooAndDefaultBlah (line 128) | @OuterWithValueArray({@DefaultingOuter(FOO), @DefaultingOuter})
    class TestValueArrayWithFooBlah (line 131) | @OuterWithValueArray({@DefaultingOuter(FOO), @DefaultingOuter(BLAH)})
    class TestValueArrayWithFooBlah2 (line 134) | @OuterWithValueArray({@DefaultingOuter(FOO), @DefaultingOuter(BLAH)})
    class TestValueArrayWithBlahFoo (line 137) | @OuterWithValueArray({@DefaultingOuter(BLAH), @DefaultingOuter(FOO)})
    method testEquivalences (line 140) | @Test
    class StringyUnset (line 188) | @Stringy
    class StringySet (line 191) | @Stringy("foo")
    method testGetDefaultValuesUnset (line 194) | @Test
    method testGetDefaultValuesSet (line 213) | @Test
    method testGetValueEntry (line 230) | @Test
    method testGetValueEntryFailure (line 241) | @Test
    method annotationOn (line 255) | private AnnotationMirror annotationOn(Class<?> clazz) {
    class AnnotatedClass (line 273) | @AnnotatedAnnotation1
    method getAnnotatedAnnotations (line 278) | @Test
    method toSourceString (line 297) | @Test
    method getAnnotatedAnnotationsAsserts (line 364) | private void getAnnotatedAnnotationsAsserts(

FILE: common/src/test/java/com/google/auto/common/AnnotationValuesTest.java
  class AnnotationValuesTest (line 43) | @RunWith(JUnit4.class)
    class GenericClass (line 50) | private static class GenericClass<T> {}
    class InsideClassA (line 52) | private static class InsideClassA {}
    class InsideClassB (line 54) | private static class InsideClassB {}
    type Foo (line 108) | private enum Foo {
    class AnnotatedClass (line 114) | @MultiValueAnnotation(
    method setUp (line 148) | @Before
    method getTypeMirror (line 157) | @Test
    method getTypeMirrorGenericClass (line 164) | @Test
    method getTypeMirrors (line 172) | @Test
    method getAnnotationMirror (line 184) | @Test
    method getAnnotationMirrors (line 195) | @Test
    method getString (line 217) | @Test
    method getStrings (line 223) | @Test
    method getEnum (line 229) | @Test
    method getEnums (line 235) | @Test
    method getAnnotationValues (line 243) | @Test
    method getInt (line 253) | @Test
    method getInts (line 259) | @Test
    method getLong (line 265) | @Test
    method getLongs (line 271) | @Test
    method getByte (line 277) | @Test
    method getBytes (line 283) | @Test
    method getShort (line 289) | @Test
    method getShorts (line 295) | @Test
    method getFloat (line 301) | @Test
    method getFloats (line 307) | @Test
    method getDouble (line 313) | @Test
    method getDoubles (line 319) | @Test
    method getBoolean (line 325) | @Test
    method getBooleans (line 331) | @Test
    method getChar (line 337) | @Test
    method getChars (line 343) | @Test
    method toSourceString (line 349) | @Test
    method getTypeElement (line 409) | private TypeElement getTypeElement(Class<?> clazz) {
    method getEnumNames (line 413) | private static ImmutableList<String> getEnumNames(ImmutableList<Variab...

FILE: common/src/test/java/com/google/auto/common/BasicAnnotationProcessorTest.java
  class BasicAnnotationProcessorTest (line 59) | @RunWith(JUnit4.class)
    class BaseAnnotationProcessor (line 62) | private abstract static class BaseAnnotationProcessor extends BasicAnn...
      method getSupportedSourceVersion (line 67) | @Override
    class RequiresGeneratedCodeProcessor (line 83) | private static class RequiresGeneratedCodeProcessor extends BaseAnnota...
      method steps (line 89) | @Override
      method processArguments (line 116) | ImmutableList<ImmutableSetMultimap<String, Element>> processArgument...
    class OneMethodAtATimeProcessor (line 125) | private static class OneMethodAtATimeProcessor extends BaseAnnotationP...
      method steps (line 131) | @Override
      method processArguments (line 162) | ImmutableList<ImmutableSetMultimap<String, Element>> processArgument...
    class OneOverloadedMethodAtATimeProcessor (line 172) | private static class OneOverloadedMethodAtATimeProcessor extends BaseA...
      method steps (line 178) | @Override
      method processArguments (line 226) | ImmutableList<ImmutableSetMultimap<String, Element>> processArgument...
    class GeneratesCodeProcessor (line 235) | public static class GeneratesCodeProcessor extends BaseAnnotationProce...
      method steps (line 236) | @Override
    class AnAnnotationProcessor (line 258) | public static class AnAnnotationProcessor extends BaseAnnotationProces...
      method steps (line 260) | @Override
    class CauseErrorProcessor (line 285) | public static class CauseErrorProcessor extends BaseAnnotationProcessor {
      method steps (line 287) | @Override
    class MissingAnnotationProcessor (line 308) | public static class MissingAnnotationProcessor extends BaseAnnotationP...
      method steps (line 312) | @Override
      method getElementsByAnnotation (line 334) | ImmutableSetMultimap<String, Element> getElementsByAnnotation() {
    class MultiAnnotationProcessingStep (line 339) | @SuppressWarnings("deprecation") // Deprecated ProcessingStep is being...
      method annotations (line 344) | @Override
      method process (line 349) | @Override
      method getElementsByAnnotation (line 356) | SetMultimap<Class<? extends Annotation>, Element> getElementsByAnnot...
    method requiresGeneratedCodeDeferralTest (line 368) | private void requiresGeneratedCodeDeferralTest(
    method requiresGeneratedCodeDeferralTest (line 381) | private void requiresGeneratedCodeDeferralTest(JavaFileObject dependen...
    method properlyDefersProcessing_typeElement (line 392) | @Test
    method properlyDefersProcessing_packageElement (line 406) | @Test
    method properlyDefersProcessing_argumentElement (line 425) | @Test
    method properlyDefersProcessing_recordComponent (line 450) | @Test
    method properlyDefersProcessing_typeParameter (line 466) | @Test
    method properlyDefersProcessing_methodTypeParameter (line 480) | @Test
    method properlyDefersProcessing_nestedTypeValidBeforeOuterType (line 495) | @Test
    method properlyDefersProcessing_rejectsTypeElement (line 513) | @Test
    method properlyDefersProcessing_rejectsTypeParameterElement (line 538) | @Test
    method properlyDefersProcessing_rejectsArgumentElement (line 554) | @Test
    method properlyDefersProcessing_rejectsField (line 570) | @Test
    method properlyDefersProcessing_rejectsRecordComponent (line 585) | @Test
    method properlyDefersProcessing_rejectsTypeParameterElementInMethod (line 601) | @Test
    method requiresGeneratedCodeRejectionTest (line 617) | @CanIgnoreReturnValue
    method setMultimapValuesByString (line 639) | private static <K, V>
    method properlyDefersProcessing_stepRejectingExecutableElements (line 647) | @Test
    method properlyDefersProcessing_stepRejectingOverloadedExecutableElements (line 683) | @Test
    method properlyDefersProcessing_stepAndIllFormedRejectingExecutableElements (line 721) | @Test
    method properlyDefersProcessing_errorTypeReferencingOverloadedMethods (line 792) | @Test
    method properlySkipsMissingAnnotations_generatesClass (line 837) | @Test
    method properlySkipsMissingAnnotations_passesValidAnnotationsToProcess (line 856) | @Test
    method reportsMissingType (line 873) | @Test
    method reportsMissingTypeSuppressedWhenOtherErrors (line 892) | @Test
    method processingStepAsStepAnnotationsNamesMatchClasses (line 906) | @Test
    method processingStepAsStepProcessElementsMatchClasses (line 920) | @Test
    method generateClass (line 945) | private static void generateClass(Filer filer, String generatedClassNa...

FILE: common/src/test/java/com/google/auto/common/GeneratedAnnotationsTest.java
  class GeneratedAnnotationsTest (line 57) | @RunWith(JUnit4.class)
    class TestProcessor (line 70) | @SupportedAnnotationTypes("*")
      method getSupportedSourceVersion (line 73) | @Override
      method process (line 80) | @Override
    method runProcessor (line 105) | private String runProcessor(ImmutableList<String> options, @Nullable S...
    class FileManagerInvocationHandler (line 146) | private static class FileManagerInvocationHandler implements Invocatio...
      method FileManagerInvocationHandler (line 150) | FileManagerInvocationHandler(
      method invoke (line 156) | @Override
    method source8 (line 169) | @Test
    method source8_masked (line 183) | @Test
    method source9 (line 200) | @Test
    method source9_masked (line 208) | @Test
    method isJdk9OrLater (line 218) | private static boolean isJdk9OrLater() {

FILE: common/src/test/java/com/google/auto/common/MoreElementsTest.java
  class MoreElementsTest (line 57) | @RunWith(JUnit4.class)
    method initializeTestElements (line 67) | @Before
    method getPackage (line 75) | @Test
    method asPackage (line 83) | @Test
    method asPackage_illegalArgument (line 88) | @Test
    method asTypeElement (line 97) | @Test
    method asTypeElement_notATypeElement (line 104) | @Test
    method asTypeParameterElement (line 117) | @Test
    method asTypeParameterElement_illegalArgument (line 128) | @Test
    method asType (line 137) | @Test
    method asType_illegalArgument (line 142) | @Test
    method asVariable (line 152) | @Test
    method asVariable_illegalArgument (line 159) | @Test
    method asExecutable (line 168) | @Test
    method asExecutable_illegalArgument (line 179) | @Test
    method isAnnotationPresent (line 195) | @Test
    method isAnnotationPresentAsserts (line 225) | private void isAnnotationPresentAsserts(
    method getAnnotationMirror (line 234) | @Test
    method getAnnotationMirrorAsserts (line 263) | private void getAnnotationMirrorAsserts(
    class ParentClass (line 284) | private abstract static class ParentClass {
      method staticMethod (line 285) | static void staticMethod() {}
      method foo (line 287) | abstract String foo();
      method privateMethod (line 289) | @SuppressWarnings("unused")
    type ParentInterface (line 293) | private interface ParentInterface {
      method staticMethod (line 294) | static void staticMethod() {}
      method bar (line 296) | abstract int bar();
      method bar (line 298) | abstract int bar(long x);
    class Child (line 301) | private abstract static class Child extends ParentClass implements Par...
      method staticMethod (line 302) | static void staticMethod() {}
      method bar (line 304) | @Override
      method baz (line 309) | abstract void baz();
      method buh (line 311) | void buh(int x) {}
      method buh (line 313) | void buh(int x, int y) {}
    method getLocalAndInheritedMethods_Old (line 316) | @Test
    method getLocalAndInheritedMethods (line 340) | @Test
    method getLocalAndInheritedMethods_recursiveTypeVariableBound (line 363) | @Test
    class FakeProto (line 383) | static class FakeProto extends AbstractMessage {
      class Builder (line 384) | static class Builder extends AbstractMessage.Builder<Builder> {
        method internalMergeFrom (line 385) | @Override
    class AbstractMessage (line 393) | @SuppressWarnings("rawtypes")
      class Builder (line 395) | static class Builder<B extends Builder<B>> extends AbstractMessageLi...
        method internalMergeFrom (line 396) | @Override
    class AbstractMessageLite (line 404) | static class AbstractMessageLite<
      class Builder (line 406) | static class Builder<M extends AbstractMessageLite<M, B>, B extends ...
        method internalMergeFrom (line 407) | @SuppressWarnings("unchecked")
    method getAllMethods (line 414) | @Test
    method visibleMethodsFromObject (line 441) | private Set<ExecutableElement> visibleMethodsFromObject() {
    method allMethodsFromObject (line 462) | private Set<ExecutableElement> allMethodsFromObject() {
    method getMethod (line 478) | private ExecutableElement getMethod(Class<?> c, String methodName, Typ...
    class AbstractAbstractList (line 501) | private abstract static class AbstractAbstractList extends AbstractLis...
    class ConcreteAbstractList (line 503) | private static class ConcreteAbstractList<T> extends AbstractList<T> {
      method size (line 504) | @Override
      method get (line 509) | @Override
    method abstractMethodNamesFrom (line 515) | private Set<String> abstractMethodNamesFrom(Set<ExecutableElement> met...
    method getLocalAndInheritedMethods_AbstractList (line 531) | @Test

FILE: common/src/test/java/com/google/auto/common/MoreTypesIsTypeOfTest.java
  class MoreTypesIsTypeOfTest (line 40) | @RunWith(JUnit4.class)
    method setUp (line 48) | @Before
    method isTypeOf_primitiveAndBoxedPrimitiveTypes (line 54) | @Test
    method isTypeOf_voidAndPseudoVoidTypes (line 106) | @Test
    method isTypeOf_arrayType (line 126) | @Test
    type TestType (line 151) | private interface TestType {
      method method0 (line 152) | @SuppressWarnings("unused")
    method isTypeOf_declaredType (line 156) | @Test
    method isTypeOf_fail (line 170) | @Test
    method getTypeElementFor (line 183) | private TypeElement getTypeElementFor(Class<?> clazz) {

FILE: common/src/test/java/com/google/auto/common/MoreTypesTest.java
  class MoreTypesTest (line 59) | @RunWith(JUnit4.class)
    method equivalence (line 64) | @Test
    class ExecutableElementsGroupA (line 171) | @SuppressWarnings("unused")
      method ExecutableElementsGroupA (line 173) | ExecutableElementsGroupA() {}
      method a (line 175) | void a() {}
      method b (line 177) | public static void b() {}
    class ExecutableElementsGroupB (line 180) | @SuppressWarnings("unused")
      method ExecutableElementsGroupB (line 182) | ExecutableElementsGroupB(String s) {}
      method a (line 184) | void a(String s) {}
      method b (line 186) | public static void b(String s) {}
    class ExecutableElementsGroupC (line 189) | @SuppressWarnings("unused")
      method ExecutableElementsGroupC (line 191) | ExecutableElementsGroupC() throws Exception {}
      method a (line 193) | void a() throws Exception {}
      method b (line 195) | public static void b() throws Exception {}
    class ExecutableElementsGroupD (line 198) | @SuppressWarnings("unused")
      method ExecutableElementsGroupD (line 200) | ExecutableElementsGroupD() throws RuntimeException {}
      method a (line 202) | void a() throws RuntimeException {}
      method b (line 204) | public static void b() throws RuntimeException {}
    class ExecutableElementsGroupE (line 207) | @SuppressWarnings({"unused", "UnusedTypeParameter"})
      method ExecutableElementsGroupE (line 209) | <T> ExecutableElementsGroupE() {}
      method a (line 211) | <T> void a() {}
      method b (line 213) | public static <T> void b() {}
    class Container (line 216) | @SuppressWarnings({"unused", "UnusedTypeParameter"})
      class Contained (line 218) | private final class Contained {}
    class FunkyBounds (line 221) | @SuppressWarnings("unused")
    class FunkyBounds2 (line 224) | @SuppressWarnings("unused")
    class FunkierBounds (line 227) | @SuppressWarnings("unused")
    method testReferencedTypes (line 230) | @Test
    method referencedTypes (line 263) | private static ImmutableSet<TypeElement> referencedTypes(
    class ReferencedTypesTestData (line 270) | @SuppressWarnings("unused") // types used in compiler tests
    class Parent (line 286) | private static class Parent<T> {}
    class ChildA (line 288) | private static class ChildA extends Parent<Number> {}
    class ChildB (line 290) | private static class ChildB extends Parent<String> {}
    class GenericChild (line 292) | private static class GenericChild<T> extends Parent<T> {}
    type InterfaceType (line 294) | private interface InterfaceType {}
    method asElement_throws (line 296) | @Test
    method asElement (line 306) | @Test
    method testNonObjectSuperclass (line 318) | @Test
    method testAsMemberOf_variableElement (line 367) | @Test
    class Params (line 415) | private static class Params<T> {
      method add (line 419) | @SuppressWarnings("unused")
    class NumberParams (line 423) | private static class NumberParams extends Params<Number> {}
    class StringParams (line 425) | private static class StringParams extends Params<String> {}
    class GenericParams (line 427) | private static class GenericParams<T> extends Params<T> {}
    method getKind (line 431) | @Override
    method accept (line 436) | @Override
    method getTypeArguments (line 441) | @Override
    method getEnclosingType (line 446) | @Override
    method asElement (line 451) | @Override
    method getAnnotationsByType (line 456) | @Override
    method getAnnotation (line 461) | @Override
    method getAnnotationMirrors (line 466) | @Override
    method testIsConversionFromObjectUnchecked_yes (line 473) | @Test
    method testIsConversionFromObjectUnchecked_no (line 486) | @Test
    method testIsTypeOf (line 499) | @Test
    class Unchecked (line 515) | @SuppressWarnings("unused")
    class NotUnchecked (line 530) | @SuppressWarnings("unused")

FILE: common/src/test/java/com/google/auto/common/OverridesTest.java
  class OverridesTest (line 79) | @RunWith(Parameterized.class)
    method data (line 81) | @Parameterized.Parameters(name = "{0}")
    type CompilerType (line 90) | public enum CompilerType {
      method initUtils (line 92) | @Override
      method initUtils (line 99) | @Override
      method initUtils (line 106) | abstract void initUtils(OverridesTest test);
    method OverridesTest (line 117) | public OverridesTest(CompilerType compilerType) {
    method initializeTestElements (line 121) | @Before
    class TypesForInheritance (line 129) | static class TypesForInheritance {
      type One (line 130) | interface One {
        method m (line 131) | void m();
        method m (line 133) | void m(String x);
        method n (line 135) | void n();
        method number (line 137) | Number number();
      type Two (line 140) | interface Two {
        method m (line 141) | void m();
        method m (line 143) | void m(int x);
        method number (line 145) | Integer number();
      class Parent (line 148) | static class Parent {
        method m (line 149) | public void m() {}
      class ChildOfParent (line 152) | static class ChildOfParent extends Parent {}
      class ChildOfOne (line 154) | static class ChildOfOne implements One {
        method m (line 155) | @Override
        method m (line 158) | @Override
        method n (line 161) | @Override
        method number (line 164) | @Override
      class ChildOfOneAndTwo (line 170) | static class ChildOfOneAndTwo implements One, Two {
        method m (line 171) | @Override
        method m (line 174) | @Override
        method m (line 177) | @Override
        method n (line 180) | @Override
        method number (line 183) | @Override
      class ChildOfParentAndOne (line 189) | static class ChildOfParentAndOne extends Parent implements One {
        method m (line 190) | @Override
        method m (line 193) | @Override
        method n (line 196) | @Override
        method number (line 199) | @Override
      class ChildOfParentAndOneAndTwo (line 205) | static class ChildOfParentAndOneAndTwo extends Parent implements One...
        method m (line 206) | @Override
        method m (line 209) | @Override
        method n (line 212) | @Override
        method number (line 215) | @Override
      class AbstractChildOfOne (line 221) | abstract static class AbstractChildOfOne implements One {}
      class AbstractChildOfOneAndTwo (line 223) | abstract static class AbstractChildOfOneAndTwo implements One, Two {}
      class AbstractChildOfParentAndOneAndTwo (line 225) | abstract static class AbstractChildOfParentAndOneAndTwo extends Pare...
      type ExtendingOneAndTwo (line 227) | interface ExtendingOneAndTwo extends One, Two {}
    class MoreTypesForInheritance (line 230) | static class MoreTypesForInheritance {
      type Key (line 231) | interface Key {}
      type BindingType (line 233) | interface BindingType {}
      type ContributionType (line 235) | interface ContributionType {}
      type HasKey (line 237) | interface HasKey {
        method key (line 238) | Key key();
      type HasBindingType (line 241) | interface HasBindingType {
        method bindingType (line 242) | BindingType bindingType();
      type HasContributionType (line 245) | interface HasContributionType {
        method contributionType (line 246) | ContributionType contributionType();
      class BindingDeclaration (line 249) | abstract static class BindingDeclaration implements HasKey {
        method bindingElement (line 250) | abstract Optional<Element> bindingElement();
        method contributingModule (line 252) | abstract Optional<TypeElement> contributingModule();
      class MultibindingDeclaration (line 255) | abstract static class MultibindingDeclaration extends BindingDeclara...
        method key (line 257) | @Override
        method contributionType (line 260) | @Override
        method bindingType (line 263) | @Override
    class TypesForVisibility (line 268) | static class TypesForVisibility {
      class PublicGrandparent (line 269) | public abstract static class PublicGrandparent {
        method foo (line 270) | public abstract String foo();
      class PrivateParent (line 273) | private static class PrivateParent extends PublicGrandparent {
        method foo (line 274) | @Override
      class Child (line 280) | static class Child extends PrivateParent {}
    class TypesForGenerics (line 283) | static class TypesForGenerics {
      type GCollection (line 284) | interface GCollection<E> {
        method add (line 285) | boolean add(E x);
      type GList (line 288) | interface GList<E> extends GCollection<E> {
        method add (line 289) | @Override
      class StringList (line 293) | static class StringList implements GList<String> {
        method add (line 294) | @Override
      class RawList (line 300) | @SuppressWarnings("rawtypes")
        method add (line 302) | @Override
    class TypesForRaw (line 309) | @SuppressWarnings("rawtypes")
      class RawParent (line 311) | static class RawParent {
        method frob (line 312) | void frob(List x) {}
      class RawChildOfRaw (line 315) | static class RawChildOfRaw extends RawParent {
        method frob (line 316) | @Override
      class NonRawParent (line 320) | static class NonRawParent {
        method frob (line 321) | void frob(List<String> x) {}
      class RawChildOfNonRaw (line 324) | static class RawChildOfNonRaw extends NonRawParent {
        method frob (line 325) | @Override
    method overridesInheritance (line 330) | @Test
    method overridesMoreInheritance (line 335) | @Test
    method overridesVisibility (line 340) | @Test
    method overridesGenerics (line 345) | @Test
    method overridesRaw (line 350) | @Test
    method overridesDiamond (line 364) | @Test
    method checkOverridesInContainedClasses (line 371) | private void checkOverridesInContainedClasses(Class<?> container) {
    method checkOverridesInSet (line 375) | private void checkOverridesInSet(ImmutableSet<Class<?>> testClasses) {
    method getTypeElement (line 414) | private TypeElement getTypeElement(Class<?> c) {
    method getMethod (line 418) | private ExecutableElement getMethod(TypeElement in, String name, TypeK...
    type XCollection (line 441) | private interface XCollection<E> {
      method add (line 442) | @SuppressWarnings("unused")
    type XList (line 446) | private interface XList<E> extends XCollection<E> {}
    class XAbstractCollection (line 448) | private abstract static class XAbstractCollection<E> implements XColle...
      method add (line 449) | @Override
    class XAbstractList (line 455) | private abstract static class XAbstractList<E> extends XAbstractCollec...
      method add (line 457) | @Override
    class XStringList (line 463) | private abstract static class XStringList extends XAbstractList<String...
    class XAbstractStringList (line 465) | private abstract static class XAbstractStringList implements XList<Str...
    class XNumberList (line 467) | private abstract static class XNumberList<E extends Number> extends XA...
    method methodParameters_StringList (line 472) | @Test
    method methodParameters_AbstractStringList (line 486) | @Test
    method methodParams_NumberList (line 502) | @Test
    class StringToRangeConverter (line 516) | private abstract static class StringToRangeConverter<T extends Compara...
      method doBackward (line 518) | @Override
    method methodParams_RecursiveBound (line 524) | @Test
    method methodFromSuperclasses (line 537) | @Test
    method methodFromSuperinterfaces (line 554) | @Test
    method assertTypeListsEqual (line 577) | private void assertTypeListsEqual(@Nullable List<TypeMirror> actual, L...
    class EcjCompilationRule (line 589) | public class EcjCompilationRule implements TestRule {
      method apply (line 593) | @Override
    class EcjCompilationStatement (line 602) | private class EcjCompilationStatement extends Statement {
      method EcjCompilationStatement (line 605) | EcjCompilationStatement(Statement base) {
      method evaluate (line 609) | @Override
      method evaluate (line 624) | private void evaluate(File dummySourceFile) throws Throwable {
    class EcjTestProcessor (line 648) | @SupportedAnnotationTypes("*")
      method EcjTestProcessor (line 653) | EcjTestProcessor(Statement statement) {
      method getSupportedSourceVersion (line 657) | @Override
      method process (line 662) | @Override
      method maybeThrow (line 676) | void maybeThrow() throws Throwable {
    method javacType (line 683) | private TypeElement javacType(TypeElement type) {
    method javacMethod (line 687) | private ExecutableElement javacMethod(ExecutableElement method) {
    method erasedToString (line 716) | private static String erasedToString(TypeMirror type) {
    method defaultAction (line 722) | @Override
    method visitArray (line 727) | @Override
    method visitDeclared (line 732) | @Override
    method visitTypeVariable (line 737) | @Override

FILE: common/src/test/java/com/google/auto/common/SimpleAnnotationMirrorTest.java
  class SimpleAnnotationMirrorTest (line 37) | @RunWith(JUnit4.class)
    method emptyAnnotation (line 53) | @Test
    method multipleValues (line 61) | @Test
    method extraValues (line 70) | @Test
    method defaultValue (line 80) | @Test
    method overriddenDefaultValue (line 88) | @Test
    method missingValues (line 97) | @Test
    method notAnAnnotation (line 103) | @Test
    method getTypeElement (line 109) | private TypeElement getTypeElement(Class<?> clazz) {
    method expectThrows (line 113) | private static void expectThrows(Runnable throwingRunnable) {
    method intValue (line 121) | private static AnnotationValue intValue(int value) {

FILE: common/src/test/java/com/google/auto/common/SimpleTypeAnnotationValueTest.java
  class SimpleTypeAnnotationValueTest (line 39) | @RunWith(JUnit4.class)
    method setUp (line 47) | @Before
    method primitiveClass (line 55) | @Test
    method arrays (line 61) | @Test
    method declaredType (line 67) | @Test
    method visitorMethod (line 72) | @Test
    method parameterizedType (line 91) | @Test

FILE: common/src/test/java/com/google/auto/common/SuperficialValidationTest.java
  class SuperficialValidationTest (line 37) | @RunWith(JUnit4.class)
    method missingReturnType (line 39) | @Test
    method missingGenericReturnType (line 61) | @Test
    method missingReturnTypeTypeParameter (line 83) | @Test
    method missingTypeParameter (line 108) | @Test
    method missingParameterType (line 128) | @Test
    method missingAnnotation (line 150) | @Test
    method handlesRecursiveTypeParams (line 175) | @Test
    method handlesRecursiveType (line 195) | @Test
    method missingWildcardBound (line 217) | @Test
    method missingIntersection (line 247) | @Test
    method invalidAnnotationValue (line 267) | @Test
    class AssertingProcessor (line 296) | private static class AssertingProcessor extends AbstractProcessor {
      method getSupportedSourceVersion (line 298) | @Override
      method AssertingProcessor (line 305) | AssertingProcessor(Consumer<ProcessingEnvironment> assertions) {
      method getSupportedAnnotationTypes (line 309) | @Override
      method process (line 314) | @Override

FILE: common/src/test/java/com/google/auto/common/VisibilityTest.java
  class VisibilityTest (line 34) | @RunWith(JUnit4.class)
    method packageVisibility (line 38) | @Test
    method moduleVisibility (line 48) | @Test
    class PublicClass (line 62) | @SuppressWarnings("unused")
      class NestedPublicClass (line 64) | public static class NestedPublicClass {}
      class NestedProtectedClass (line 66) | protected static class NestedProtectedClass {}
      class NestedDefaultClass (line 68) | static class NestedDefaultClass {}
      class NestedPrivateClass (line 70) | private static class NestedPrivateClass {}
    class ProtectedClass (line 73) | @SuppressWarnings("unused")
      class NestedPublicClass (line 75) | public static class NestedPublicClass {}
      class NestedProtectedClass (line 77) | protected static class NestedProtectedClass {}
      class NestedDefaultClass (line 79) | static class NestedDefaultClass {}
      class NestedPrivateClass (line 81) | private static class NestedPrivateClass {}
    class DefaultClass (line 84) | @SuppressWarnings("unused")
      class NestedPublicClass (line 86) | public static class NestedPublicClass {}
      class NestedProtectedClass (line 88) | protected static class NestedProtectedClass {}
      class NestedDefaultClass (line 90) | static class NestedDefaultClass {}
      class NestedPrivateClass (line 92) | private static class NestedPrivateClass {}
    class PrivateClass (line 95) | @SuppressWarnings("unused")
      class NestedPublicClass (line 97) | public static class NestedPublicClass {}
      class NestedProtectedClass (line 99) | protected static class NestedProtectedClass {}
      class NestedDefaultClass (line 101) | static class NestedDefaultClass {}
      class NestedPrivateClass (line 103) | private static class NestedPrivateClass {}
    method classVisibility (line 106) | @Test
    method effectiveClassVisibility (line 131) | @Test
    method effectiveVisiblityOfClass (line 166) | private Visibility effectiveVisiblityOfClass(Class<?> clazz) {

FILE: factory/src/it/functional/src/main/java/com/google/auto/factory/DaggerModule.java
  class DaggerModule (line 23) | @Module
    method DaggerModule (line 25) | private DaggerModule() {}
    method provideDependency (line 27) | @Binds
    method provideQualifiedDependency (line 30) | @Binds
    method providePrimitive (line 34) | @Provides
    method provideQualifiedPrimitive (line 39) | @Provides
    method provideNumber (line 45) | @Provides
    method provideReferencePackage (line 50) | @Provides
    method provideOtherPackage (line 55) | @Provides

FILE: factory/src/it/functional/src/main/java/com/google/auto/factory/Dependency.java
  type Dependency (line 18) | public interface Dependency {}

FILE: factory/src/it/functional/src/main/java/com/google/auto/factory/DependencyImpl.java
  class DependencyImpl (line 20) | public class DependencyImpl implements Dependency {
    method DependencyImpl (line 21) | @Inject

FILE: factory/src/it/functional/src/main/java/com/google/auto/factory/FactoryComponent.java
  type FactoryComponent (line 22) | @Component(modules = DaggerModule.class)
    method factory (line 24) | FooFactory factory();
    method generatedFactory (line 26) | GenericFooFactory<Number> generatedFactory();
    method referencePackageFactory (line 28) | ReferencePackageFactory referencePackageFactory();
    method otherPackageFactory (line 30) | OtherPackageFactory otherPackageFactory();

FILE: factory/src/it/functional/src/main/java/com/google/auto/factory/FactoryInterface.java
  type FactoryInterface (line 18) | public interface FactoryInterface {
    method generate (line 19) | Foo generate(String name);

FILE: factory/src/it/functional/src/main/java/com/google/auto/factory/Foo.java
  class Foo (line 20) | @AutoFactory(implementing = FactoryInterface.class)
    method Foo (line 28) | Foo(
    method Foo (line 43) | Foo(
    method name (line 52) | String name() {
    method dependency (line 56) | Dependency dependency() {
    method dependencyProvider (line 60) | Provider<Dependency> dependencyProvider() {
    method primitive (line 64) | int primitive() {
    method qualifiedPrimitive (line 68) | int qualifiedPrimitive() {

FILE: factory/src/it/functional/src/main/java/com/google/auto/factory/GenericFoo.java
  class GenericFoo (line 21) | @AutoFactory
    method GenericFoo (line 30) | <D extends IntAccessor & StringAccessor> GenericFoo(
    method getDepA (line 39) | public A getDepA() {
    method getDepB (line 43) | public B getDepB() {
    method passThrough (line 47) | public C passThrough(C value) {
    method getDepDIntAccessor (line 51) | public IntAccessor getDepDIntAccessor() {
    method getDepDStringAccessor (line 55) | public StringAccessor getDepDStringAccessor() {
    method getDepE (line 59) | public E getDepE() {
    type IntAccessor (line 63) | public interface IntAccessor {}
    type StringAccessor (line 65) | public interface StringAccessor {}
    type IntAndStringAccessor (line 67) | public interface IntAndStringAccessor extends IntAccessor, StringAcces...
    type DepE (line 69) | public enum DepE {

FILE: factory/src/it/functional/src/main/java/com/google/auto/factory/GuiceModule.java
  class GuiceModule (line 20) | public class GuiceModule extends AbstractModule {
    method configure (line 21) | @Override

FILE: factory/src/it/functional/src/main/java/com/google/auto/factory/QualifiedDependencyImpl.java
  class QualifiedDependencyImpl (line 20) | public class QualifiedDependencyImpl implements Dependency {
    method QualifiedDependencyImpl (line 21) | @Inject

FILE: factory/src/it/functional/src/main/java/com/google/auto/factory/ReferencePackage.java
  class ReferencePackage (line 22) | @AutoFactory
    method ReferencePackage (line 27) | @Inject
    method otherPackage (line 33) | public OtherPackage otherPackage() {

FILE: factory/src/it/functional/src/main/java/com/google/auto/factory/otherpackage/OtherPackage.java
  class OtherPackage (line 22) | @AutoFactory
    method OtherPackage (line 27) | public OtherPackage(@Provided ReferencePackageFactory referencePackage...
    method referencePackageFactory (line 32) | public ReferencePackageFactory referencePackageFactory() {
    method random (line 36) | public int random() {

FILE: factory/src/it/functional/src/test/java/com/google/auto/factory/DependencyInjectionIntegrationTest.java
  class DependencyInjectionIntegrationTest (line 17) | @RunWith(JUnit4.class)
    method daggerInjectedFactory (line 22) | @Test
    method daggerInjectedGenericFactory (line 42) | @Test
    method daggerInjectedPackageSpanningFactory (line 70) | @Test
    method guiceInjectedFactory (line 80) | @Test
    method guiceInjectedGenericFactory (line 100) | @Test
    method guiceInjectedPackageSpanningFactory (line 128) | @Test

FILE: factory/src/main/java/com/google/auto/factory/processor/AnnotationValues.java
  class AnnotationValues (line 29) | final class AnnotationValues {
    method AnnotationValues (line 30) | private AnnotationValues() {}
    method asBoolean (line 32) | static boolean asBoolean(AnnotationValue value) {
    method asType (line 48) | static TypeElement asType(AnnotationValue value) {
    method asList (line 77) | static ImmutableList<? extends AnnotationValue> asList(AnnotationValue...

FILE: factory/src/main/java/com/google/auto/factory/processor/AutoFactoryDeclaration.java
  class AutoFactoryDeclaration (line 58) | @AutoValue
    method targetType (line 60) | abstract TypeElement targetType();
    method target (line 62) | abstract Element target();
    method className (line 64) | abstract Optional<String> className();
    method annotations (line 66) | abstract ImmutableSet<AnnotationMirror> annotations();
    method extendingType (line 68) | abstract TypeElement extendingType();
    method implementingTypes (line 70) | abstract ImmutableSet<TypeElement> implementingTypes();
    method allowSubclasses (line 72) | abstract boolean allowSubclasses();
    method mirror (line 74) | abstract AnnotationMirror mirror();
    method valuesMap (line 76) | abstract ImmutableMap<String, AnnotationValue> valuesMap();
    method getFactoryName (line 78) | PackageAndClass getFactoryName() {
    method targetEnclosingSimpleNames (line 91) | private ImmutableList<String> targetEnclosingSimpleNames() {
    class Factory (line 101) | static final class Factory {
      method Factory (line 105) | Factory(Elements elements, Messager messager) {
      method createIfValid (line 110) | Optional<AutoFactoryDeclaration> createIfValid(Element element) {
      method getAnnotatedType (line 204) | private static TypeElement getAnnotatedType(Element element) {
      method isValidIdentifier (line 213) | static boolean isValidIdentifier(String identifier) {
      method annotationsToAdd (line 217) | private ImmutableSet<AnnotationMirror> annotationsToAdd(Element elem...

FILE: factory/src/main/java/com/google/auto/factory/processor/AutoFactoryProcessor.java
  class AutoFactoryProcessor (line 72) | @IncrementalAnnotationProcessor(IncrementalAnnotationProcessorType.ISOLA...
    method init (line 94) | @Override
    method process (line 127) | @Override
    method doProcess (line 145) | private void doProcess(RoundEnvironment roundEnv) {
    method implementationMethods (line 250) | private ImmutableSet<ImplementationMethodDescriptor> implementationMet...
    method getAnnotatedType (line 279) | private TypeMirror getAnnotatedType(Element element) {
    method simpleNamesToNames (line 288) | private static ImmutableSetMultimap<String, PackageAndClass> simpleNam...
    method newTypeSetBuilder (line 299) | private static ImmutableSortedSet.Builder<TypeMirror> newTypeSetBuilde...
    method checkAnnotationsToApply (line 305) | private void checkAnnotationsToApply(Element annotation) {
    method getSupportedAnnotationTypes (line 341) | @Override
    method getSupportedSourceVersion (line 349) | @Override

FILE: factory/src/main/java/com/google/auto/factory/processor/Elements2.java
  class Elements2 (line 35) | final class Elements2 {
    method Elements2 (line 36) | private Elements2() {}
    method getConstructors (line 38) | static ImmutableSet<ExecutableElement> getConstructors(TypeElement typ...
    method isValidSupertypeForClass (line 44) | static boolean isValidSupertypeForClass(TypeElement type) {
    method getExecutableElementAsMemberOf (line 65) | static ExecutableType getExecutableElementAsMemberOf(

FILE: factory/src/main/java/com/google/auto/factory/processor/FactoryDescriptor.java
  class FactoryDescriptor (line 38) | @AutoValue
    method matches (line 42) | @Override
    method name (line 48) | abstract PackageAndClass name();
    method annotations (line 50) | abstract ImmutableSet<AnnotationMirror> annotations();
    method extendingType (line 52) | abstract TypeMirror extendingType();
    method implementingTypes (line 54) | abstract ImmutableSet<TypeMirror> implementingTypes();
    method publicType (line 56) | abstract boolean publicType();
    method methodDescriptors (line 58) | abstract ImmutableSet<FactoryMethodDescriptor> methodDescriptors();
    method implementationMethodDescriptors (line 60) | abstract ImmutableSet<ImplementationMethodDescriptor> implementationMe...
    method allowSubclasses (line 62) | abstract boolean allowSubclasses();
    method providers (line 64) | abstract ImmutableMap<Key, ProviderField> providers();
    method declaration (line 66) | final AutoFactoryDeclaration declaration() {
    class UniqueNameSet (line 71) | private static class UniqueNameSet {
      method getUniqueName (line 78) | String getUniqueName(CharSequence base) {
    method create (line 87) | static FactoryDescriptor create(
    method createDuplicateMethodDescriptorsBiMap (line 165) | private static ImmutableBiMap<FactoryMethodDescriptor, ImplementationM...
    method getDeduplicatedMethodDescriptors (line 196) | private static ImmutableSet<FactoryMethodDescriptor> getDeduplicatedMe...
    method areDuplicateMethodDescriptors (line 230) | private static boolean areDuplicateMethodDescriptors(

FILE: factory/src/main/java/com/google/auto/factory/processor/FactoryDescriptorGenerator.java
  class FactoryDescriptorGenerator (line 51) | final class FactoryDescriptorGenerator {
    method FactoryDescriptorGenerator (line 57) | FactoryDescriptorGenerator(
    method generateDescriptor (line 68) | ImmutableSet<FactoryMethodDescriptor> generateDescriptor(Element eleme...
    method generateDescriptorForConstructor (line 129) | FactoryMethodDescriptor generateDescriptorForConstructor(
    method generateDescriptorForDefaultConstructor (line 157) | private ImmutableSet<FactoryMethodDescriptor> generateDescriptorForDef...

FILE: factory/src/main/java/com/google/auto/factory/processor/FactoryMethodDescriptor.java
  class FactoryMethodDescriptor (line 31) | @AutoValue
    method declaration (line 33) | abstract AutoFactoryDeclaration declaration();
    method name (line 35) | abstract String name();
    method returnType (line 37) | abstract TypeMirror returnType();
    method publicMethod (line 39) | abstract boolean publicMethod();
    method overridingMethod (line 41) | abstract boolean overridingMethod();
    method passedParameters (line 44) | abstract ImmutableSet<Parameter> passedParameters();
    method providedParameters (line 53) | abstract ImmutableSet<Parameter> providedParameters();
    method creationParameters (line 59) | abstract ImmutableSet<Parameter> creationParameters();
    method isVarArgs (line 61) | abstract boolean isVarArgs();
    method exceptions (line 63) | abstract ImmutableSet<TypeMirror> exceptions();
    method toBuilder (line 65) | abstract Builder toBuilder();
    method factoryName (line 67) | final PackageAndClass factoryName() {
    method builder (line 71) | static Builder builder(AutoFactoryDeclaration declaration) {
    class Builder (line 75) | @AutoValue.Builder
      method declaration (line 77) | abstract Builder declaration(AutoFactoryDeclaration declaration);
      method name (line 79) | abstract Builder name(String name);
      method returnType (line 81) | abstract Builder returnType(TypeMirror returnType);
      method publicMethod (line 83) | abstract Builder publicMethod(boolean publicMethod);
      method overridingMethod (line 85) | abstract Builder overridingMethod(boolean overridingMethod);
      method passedParameters (line 87) | abstract Builder passedParameters(Iterable<Parameter> passedParamete...
      method providedParameters (line 89) | abstract Builder providedParameters(Iterable<Parameter> providedPara...
      method creationParameters (line 91) | abstract Builder creationParameters(Iterable<Parameter> creationPara...
      method isVarArgs (line 93) | abstract Builder isVarArgs(boolean isVarargs);
      method exceptions (line 95) | abstract Builder exceptions(Iterable<? extends TypeMirror> exceptions);
      method buildImpl (line 97) | abstract FactoryMethodDescriptor buildImpl();
      method build (line 99) | FactoryMethodDescriptor build() {

FILE: factory/src/main/java/com/google/auto/factory/processor/FactoryWriter.java
  class FactoryWriter (line 59) | final class FactoryWriter {
    method FactoryWriter (line 67) | FactoryWriter(
    method writeFactory (line 78) | void writeFactory(FactoryDescriptor descriptor) throws IOException {
    method addFactoryTypeParameters (line 115) | private static void addFactoryTypeParameters(
    method addConstructorAndProviderFields (line 120) | private void addConstructorAndProviderFields(
    method addFactoryMethods (line 150) | private void addFactoryMethods(
    method addImplementationMethods (line 205) | private void addImplementationMethods(TypeSpec.Builder factory, Factor...
    method parameters (line 230) | private ImmutableList<ParameterSpec> parameters(Iterable<Parameter> pa...
    method addCheckNotNullMethod (line 243) | private static void addCheckNotNullMethod(
    method shouldGenerateCheckNotNull (line 267) | private static boolean shouldGenerateCheckNotNull(FactoryDescriptor de...
    method resolveTypeName (line 300) | private TypeName resolveTypeName(TypeMirror type) {
    method getFactoryTypeVariables (line 313) | private static ImmutableSet<TypeVariableName> getFactoryTypeVariables(
    method typeVariablesFrom (line 330) | private static List<TypeVariableName> typeVariablesFrom(TypeMirror typ...
    method getMethodTypeVariables (line 341) | private static ImmutableSet<TypeVariableName> getMethodTypeVariables(
    method getReferencedTypeParameterNames (line 352) | private static ImmutableSet<TypeVariableName> getReferencedTypeParamet...

FILE: factory/src/main/java/com/google/auto/factory/processor/ImplementationMethodDescriptor.java
  class ImplementationMethodDescriptor (line 22) | @AutoValue
    method name (line 24) | abstract String name();
    method returnType (line 26) | abstract TypeMirror returnType();
    method publicMethod (line 28) | abstract boolean publicMethod();
    method passedParameters (line 30) | abstract ImmutableSet<Parameter> passedParameters();
    method isVarArgs (line 32) | abstract boolean isVarArgs();
    method exceptions (line 34) | abstract ImmutableSet<TypeMirror> exceptions();
    method builder (line 36) | static Builder builder() {
    class Builder (line 40) | @AutoValue.Builder
      method name (line 42) | abstract Builder name(String name);
      method returnType (line 44) | abstract Builder returnType(TypeMirror returnTypeElement);
      method publicMethod (line 46) | abstract Builder publicMethod(boolean publicMethod);
      method publicMethod (line 48) | final Builder publicMethod() {
      method passedParameters (line 52) | abstract Builder passedParameters(Iterable<Parameter> passedParamete...
      method isVarArgs (line 54) | abstract Builder isVarArgs(boolean isVarargs);
      method exceptions (line 56) | abstract Builder exceptions(Iterable<? extends TypeMirror> exceptions);
      method build (line 58) | abstract ImplementationMethodDescriptor build();

FILE: factory/src/main/java/com/google/auto/factory/processor/InjectApi.java
  class InjectApi (line 34) | @AutoValue
    method inject (line 36) | abstract TypeElement inject();
    method provider (line 38) | abstract TypeElement provider();
    method qualifier (line 40) | abstract TypeElement qualifier();
    method from (line 45) | static InjectApi from(Elements elementUtils, @Nullable String apiPrefi...
    method isProvider (line 63) | boolean isProvider(TypeMirror type) {
    method apiMap (line 68) | private static ImmutableMap<String, TypeElement> apiMap(

FILE: factory/src/main/java/com/google/auto/factory/processor/Key.java
  class Key (line 37) | @AutoValue
    method type (line 40) | abstract Equivalence.Wrapper<TypeMirror> type();
    method qualifierWrapper (line 42) | abstract Optional<Equivalence.Wrapper<AnnotationMirror>> qualifierWrap...
    method qualifier (line 44) | Optional<AnnotationMirror> qualifier() {
    method create (line 65) | static Key create(
    method boxedType (line 89) | private static TypeMirror boxedType(TypeMirror type, Types types) {
    method toString (line 95) | @Override

FILE: factory/src/main/java/com/google/auto/factory/processor/Mirrors.java
  class Mirrors (line 33) | final class Mirrors {
    method Mirrors (line 34) | private Mirrors() {}
    method getQualifiedName (line 36) | static Name getQualifiedName(DeclaredType type) {
    method simplifyAnnotationValueMap (line 57) | static ImmutableMap<String, AnnotationValue> simplifyAnnotationValueMap(
    method getAnnotationMirror (line 71) | static Optional<AnnotationMirror> getAnnotationMirror(
    method wrapOptionalInEquivalence (line 85) | static <T> Optional<Equivalence.Wrapper<T>> wrapOptionalInEquivalence(
    method unwrapOptionalEquivalence (line 94) | static <T> Optional<T> unwrapOptionalEquivalence(

FILE: factory/src/main/java/com/google/auto/factory/processor/PackageAndClass.java
  class PackageAndClass (line 21) | @AutoValue
    method packageName (line 27) | abstract String packageName();
    method className (line 33) | abstract String className();
    method of (line 35) | static PackageAndClass of(String packageName, String className) {

FILE: factory/src/main/java/com/google/auto/factory/processor/Parameter.java
  class Parameter (line 47) | @AutoValue
    method type (line 54) | abstract Equivalence.Wrapper<TypeMirror> type();
    method isPrimitive (line 56) | boolean isPrimitive() {
    method name (line 61) | abstract String name();
    method key (line 63) | abstract Key key();
    method annotationWrappers (line 66) | abstract ImmutableList<Equivalence.Wrapper<AnnotationMirror>> annotati...
    method annotations (line 68) | ImmutableList<AnnotationMirror> annotations() {
    method nullableWrapper (line 72) | abstract Optional<Equivalence.Wrapper<AnnotationMirror>> nullableWrapp...
    method nullable (line 74) | Optional<AnnotationMirror> nullable() {
    method forVariableElement (line 78) | private static Parameter forVariableElement(
    method isNullable (line 106) | private static boolean isNullable(AnnotationMirror annotation) {
    method forParameterList (line 116) | static ImmutableSet<Parameter> forParameterList(
    method forParameterList (line 135) | static ImmutableSet<Parameter> forParameterList(

FILE: factory/src/main/java/com/google/auto/factory/processor/ProvidedChecker.java
  class ProvidedChecker (line 31) | final class ProvidedChecker {
    method ProvidedChecker (line 34) | ProvidedChecker(Messager messager) {
    method checkProvidedParameter (line 38) | void checkProvidedParameter(Element element) {
    method raiseError (line 81) | private void raiseError(VariableElement providedParameter, String mess...
    method annotatedWithAutoFactory (line 89) | private static boolean annotatedWithAutoFactory(Element e) {

FILE: factory/src/main/java/com/google/auto/factory/processor/ProviderField.java
  class ProviderField (line 27) | @AutoValue
    method name (line 29) | abstract String name();
    method key (line 31) | abstract Key key();
    method nullableWrapper (line 33) | abstract Optional<Equivalence.Wrapper<AnnotationMirror>> nullableWrapp...
    method nullable (line 35) | Optional<AnnotationMirror> nullable() {
    method create (line 39) | static ProviderField create(String name, Key key, Optional<AnnotationM...

FILE: factory/src/main/java/com/google/auto/factory/processor/TypeVariables.java
  class TypeVariables (line 33) | final class TypeVariables {
    method TypeVariables (line 34) | private TypeVariables() {}
    method getReferencedTypeVariables (line 36) | static ImmutableSet<TypeVariable> getReferencedTypeVariables(TypeMirro...
    class ReferencedTypeVariables (line 41) | private static final class ReferencedTypeVariables
      method ReferencedTypeVariables (line 46) | ReferencedTypeVariables() {
      method visitArray (line 50) | @Override
      method visitDeclared (line 55) | @Override
      method visitTypeVariable (line 67) | @Override
      method visitUnion (line 79) | @Override
      method visitIntersection (line 88) | @Override
      method visitWildcard (line 97) | @Override

FILE: factory/src/test/java/com/google/auto/factory/processor/AutoFactoryDeclarationTest.java
  class AutoFactoryDeclarationTest (line 25) | @RunWith(JUnit4.class)
    method identifiers (line 27) | @Test

FILE: factory/src/test/java/com/google/auto/factory/processor/AutoFactoryProcessorNegativeTest.java
  class AutoFactoryProcessorNegativeTest (line 34) | @RunWith(JUnit4.class)
    method failsWithMixedFinals (line 38) | @Test
    method providedButNoAutoFactory (line 55) | @Test
    method providedOnMethodParameter (line 67) | @Test
    method invalidCustomName (line 78) | @Test
    method factoryExtendingAbstractClass_withConstructorParams (line 89) | @Test
    method factoryExtendingInterface (line 104) | @Test
    method factoryExtendingEnum (line 117) | @Test
    method factoryExtendingFinalClass (line 130) | @Test
    method annotationsToApplyMultiple (line 147) | @Test
    method annotationsToApplyRepeated (line 160) | @Test
    method annotationsToApplyNotAnnotations (line 168) | @Test
    method noInjectApi (line 187) | @Test
    method noInjectApiButNoAutoFactoryEither (line 216) | @Test

FILE: factory/src/test/java/com/google/auto/factory/processor/AutoFactoryProcessorTest.java
  class AutoFactoryProcessorTest (line 56) | @RunWith(TestParameterInjector.class)
    method AutoFactoryProcessorTest (line 60) | public AutoFactoryProcessorTest(@TestParameter Config config) {
    type InjectPackage (line 64) | private enum InjectPackage {
    type Config (line 73) | private enum Config {
      method Config (line 98) | Config(ImmutableList<InjectPackage> packagesOnClasspath, InjectPacka...
      method Config (line 102) | Config(
      method fileForClass (line 120) | static File fileForClass(String className) {
      method classpath (line 132) | ImmutableList<File> classpath() {
      method javac (line 144) | Compiler javac() {
    method explainGoldenFileFailures (line 159) | @AfterClass
    method goldenTest (line 179) | private void goldenTest(
    method goldenFile (line 207) | private JavaFileObject goldenFile(String resourceName) {
    method updateGoldenFile (line 221) | private void updateGoldenFile(Compilation compilation, String classNam...
    method indexOfClassStartIn (line 251) | private int indexOfClassStartIn(String content, String where) {
    method simpleClass (line 258) | @Test
    method simpleClassWithConstructorThrowsClause (line 265) | @Test
    method nestedClasses (line 273) | @Test
    method simpleClassNonFinal (line 284) | @Test
    method publicClass (line 292) | @Test
    method simpleClassCustomName (line 299) | @Test
    method simpleClassMixedDeps (line 306) | @Test
    method simpleClassPassedDeps (line 314) | @Test
    method simpleClassProvidedDeps (line 322) | @Test
    method simpleClassProvidedProviderDeps (line 334) | @Test
    method constructorAnnotated (line 346) | @Test
    method constructorWithThrowsClauseAnnotated (line 354) | @Test
    method constructorAnnotatedNonFinal (line 363) | @Test
    method simpleClassImplementingMarker (line 372) | @Test
    method simpleClassImplementingSimpleInterface (line 381) | @Test
    method mixedDepsImplementingInterfaces (line 390) | @Test
    method factoryExtendingAbstractClass (line 399) | @Test
    method factoryWithConstructorThrowsClauseExtendingAbstractClass (line 408) | @Test
    method factoryExtendingAbstractClass_multipleConstructors (line 417) | @Test
    method factoryImplementingGenericInterfaceExtension (line 424) | @Test
    method multipleFactoriesImpementingInterface (line 433) | @Test
    method classUsingQualifierWithArgs (line 444) | @Test
    method factoryImplementingInterfaceWhichRedeclaresCreateMethods (line 453) | @Test
    method nullableParams (line 462) | @Test
    method customNullableType (line 474) | @Test
    method checkerFrameworkNullableType (line 481) | @Test
    method multipleProvidedParamsWithSameKey (line 495) | @Test
    method providerArgumentToCreateMethod (line 504) | @Test
    method multipleFactoriesConflictingParameterNames (line 513) | @Test
    method factoryVarargs (line 523) | @Test
    method onlyPrimitives (line 531) | @Test
    method defaultPackage (line 538) | @Test
    method generics (line 545) | @Test
    method parameterAnnotations (line 558) | @Test
    method customAnnotations (line 566) | @Test
    method loadExpectedFile (line 574) | private JavaFileObject loadExpectedFile(String resourceName) {
    method isJavaxAnnotationProcessingGeneratedAvailable (line 585) | private static boolean isJavaxAnnotationProcessingGeneratedAvailable() {
    method rewriteImports (line 589) | private void rewriteImports(List<String> sourceLines) {

FILE: factory/src/test/resources/bad/AnnotationsToApplyMultiple.java
  class AnnotationsToApplyMultiple (line 30) | @This

FILE: factory/src/test/resources/bad/AnnotationsToApplyNotAnnotations.java
  class AnnotationsToApplyNotAnnotations (line 32) | @ImmutableAndSuppressWarnings(suppressWarnings = @SuppressWarnings({"unc...

FILE: factory/src/test/resources/bad/AnnotationsToApplyRepeated.java
  class AnnotationsToApplyMultiple (line 27) | @ReallySuppressWarnings

FILE: factory/src/test/resources/bad/EnumSupertype.java
  class InterfaceSupertype (line 21) | @AutoFactory(extending = TimeUnit.class)

FILE: factory/src/test/resources/bad/FactoryExtendingAbstractClassWithConstructorParams.java
  class FactoryExtendingAbstractClassWithConstructorParams (line 21) | @AutoFactory(extending = AbstractFactory.class)
    class AbstractFactory (line 23) | abstract static class AbstractFactory {
      method AbstractFactory (line 24) | protected AbstractFactory(Object obj) {}
      method newInstance (line 26) | abstract FactoryExtendingAbstractClassWithConstructorParams newInsta...

FILE: factory/src/test/resources/bad/FinalSupertype.java
  class InterfaceSupertype (line 20) | @AutoFactory(extending = Boolean.class)

FILE: factory/src/test/resources/bad/InterfaceSupertype.java
  class InterfaceSupertype (line 20) | @AutoFactory(extending = Runnable.class)

FILE: factory/src/test/resources/bad/InvalidCustomName.java
  class InvalidCustomName (line 20) | @AutoFactory(className = "SillyFactory!")

FILE: factory/src/test/resources/bad/MixedFinals.java
  class MixedFinals (line 20) | final class MixedFinals {
    method MixedFinals (line 21) | @AutoFactory(allowSubclasses = false)
    method MixedFinals (line 24) | @AutoFactory(allowSubclasses = true)
    method MixedFinals (line 27) | @AutoFactory(allowSubclasses = true)

FILE: factory/src/test/resources/bad/ProvidedButNoAutoFactory.java
  class ProvidedButNoAutoFactory (line 20) | final class ProvidedButNoAutoFactory {
    method ProvidedButNoAutoFactory (line 21) | ProvidedButNoAutoFactory(Object a, @Provided Object b) {}

FILE: factory/src/test/resources/bad/ProvidedOnMethodParameter.java
  class ProvidedOnMethodParameter (line 20) | final class ProvidedOnMethodParameter {
    method blah (line 21) | void blah(Object a, @Provided Object b) {}

FILE: factory/src/test/resources/expected/CheckerFrameworkNullableFactory.java
  class CheckerFrameworkNullableFactory (line 25) | @Generated(
    method CheckerFrameworkNullableFactory (line 35) | @Inject
    method create (line 44) | CheckerFrameworkNullable create(
    method checkNotNull (line 57) | private static <T> T checkNotNull(T reference, int argumentNumber, int...

FILE: factory/src/test/resources/expected/ClassUsingQualifierWithArgsFactory.java
  class ClassUsingQualifierWithArgsFactory (line 22) | @Generated(
    method ClassUsingQualifierWithArgsFactory (line 29) | @Inject
    method create (line 35) | ClassUsingQualifierWithArgs create() {
    method checkNotNull (line 39) | private static <T> T checkNotNull(T reference, int argumentNumber, int...

FILE: factory/src/test/resources/expected/ConstructorAnnotatedFactory.java
  class ConstructorAnnotatedFactory (line 22) | @Generated(
    method ConstructorAnnotatedFactory (line 29) | @Inject
    method create (line 34) | ConstructorAnnotated create() {
    method create (line 38) | ConstructorAnnotated create(String s) {
    method create (line 42) | ConstructorAnnotated create(int i) {
    method create (line 46) | ConstructorAnnotated create(char c) {
    method checkNotNull (line 50) | private static <T> T checkNotNull(T reference, int argumentNumber, int...

FILE: factory/src/test/resources/expected/ConstructorAnnotatedNonFinalFactory.java
  class ConstructorAnnotatedNonFinalFactory (line 22) | @Generated(
    method ConstructorAnnotatedNonFinalFactory (line 29) | @Inject
    method create (line 34) | ConstructorAnnotatedNonFinal create() {
    method create (line 38) | ConstructorAnnotatedNonFinal create(String s) {
    method create (line 42) | ConstructorAnnotatedNonFinal create(int i) {
    method create (line 46) | ConstructorAnnotatedNonFinal create(char c) {
    method checkNotNull (line 50) | private static <T> T checkNotNull(T reference, int argumentNumber, int...

FILE: factory/src/test/resources/expected/ConstructorAnnotatedThrowsFactory.java
  class ConstructorAnnotatedThrowsFactory (line 23) | @Generated(
    method ConstructorAnnotatedThrowsFactory (line 30) | @Inject
    method create (line 35) | ConstructorAnnotatedThrows create() throws IOException, InterruptedExc...
    method create (line 39) | ConstructorAnnotatedThrows create(String s) {
    method create (line 43) | ConstructorAnnotatedThrows create(int i) throws IOException {
    method create (line 47) | ConstructorAnnotatedThrows create(char c) throws InterruptedException {
    method checkNotNull (line 51) | private static <T> T checkNotNull(T reference, int argumentNumber, int...

FILE: factory/src/test/resources/expected/CustomAnnotationsFactory.java
  class CustomAnnotationsFactory (line 22) | @Generated(
    method CustomAnnotationsFactory (line 29) | @Inject
    method create (line 32) | CustomAnnotations create() {

FILE: factory/src/test/resources/expected/CustomNamedFactory.java
  class CustomNamedFactory (line 21) | @Generated(
    method CustomNamedFactory (line 26) | @Inject
    method create (line 29) | SimpleClassCustomName create() {

FILE: factory/src/test/resources/expected/CustomNullableFactory.java
  class CustomNullableFactory (line 22) | @Generated(
    method CustomNullableFactory (line 30) | @Inject
    method create (line 35) | CustomNullable create(@CustomNullable.Nullable String string) {
    method checkNotNull (line 39) | private static <T> T checkNotNull(T reference, int argumentNumber, int...

FILE: factory/src/test/resources/expected/DefaultPackageFactory.java
  class DefaultPackageFactory (line 20) | @Generated(
    method DefaultPackageFactory (line 25) | @Inject
    method create (line 28) | public DefaultPackage create() {

FILE: factory/src/test/resources/expected/FactoryExtendingAbstractClassFactory.java
  class FactoryExtendingAbstractClassFactory (line 21) | @Generated(
    method FactoryExtendingAbstractClassFactory (line 27) | @Inject
    method create (line 30) | FactoryExtendingAbstractClass create() {
    method newInstance (line 34) | @Override

FILE: factory/src/test/resources/expected/FactoryExtendingAbstractClassThrowsFactory.java
  class FactoryExtendingAbstractClassThrowsFactory (line 22) | @Generated(
    method FactoryExtendingAbstractClassThrowsFactory (line 28) | @Inject
    method create (line 31) | FactoryExtendingAbstractClassThrows create() throws IOException, Inter...
    method newInstance (line 35) | @Override

FILE: factory/src/test/resources/expected/FactoryImplementingCreateMethod_ConcreteClassFactory.java
  class FactoryImplementingCreateMethod_ConcreteClassFactory (line 22) | @Generated(
    method FactoryImplementingCreateMethod_ConcreteClassFactory (line 29) | @Inject
    method create (line 32) | @Override
    method create (line 37) | @Override
    method create (line 42) | @Override
    method create (line 49) | FactoryImplementingCreateMethod.ConcreteClass create(int a, boolean b) {
    method checkNotNull (line 53) | private static <T> T checkNotNull(T reference, int argumentNumber, int...

FILE: factory/src/test/resources/expected/FactoryImplementingGenericInterfaceExtensionFactory.java
  class FactoryImplementingGenericInterfaceExtensionFactory (line 22) | @Generated(
    method FactoryImplementingGenericInterfaceExtensionFactory (line 30) | @Inject
    method create (line 35) | FactoryImplementingGenericInterfaceExtension create(Integer i) {
    method make (line 40) | @Override
    method checkNotNull (line 45) | private static <T> T checkNotNull(T reference, int argumentNumber, int...

FILE: factory/src/test/resources/expected/Generics_ExplicitFooImplFactory.java
  class Generics_ExplicitFooImplFactory (line 22) | @Generated(
    method Generics_ExplicitFooImplFactory (line 30) | @Inject
    method create (line 35) | @Override
    method checkNotNull (line 40) | private static <T> T checkNotNull(T reference, int argumentNumber, int...

FILE: factory/src/test/resources/expected/Generics_FooImplFactory.java
  class Generics_FooImplFactory (line 21) | @Generated(
    method Generics_FooImplFactory (line 26) | @Inject
    method create (line 29) | @Override

FILE: factory/src/test/resources/expected/Generics_FooImplWithClassFactory.java
  class Generics_FooImplWithClassFactory (line 21) | @Generated(
    method Generics_FooImplWithClassFactory (line 27) | @Inject
    method create (line 30) | @Override

FILE: factory/src/test/resources/expected/MixedDepsImplementingInterfacesFactory.java
  class MixedDepsImplementingInterfacesFactory (line 25) | @Generated(
    method MixedDepsImplementingInterfacesFactory (line 36) | @Inject
    method create (line 41) | MixedDepsImplementingInterfaces create(int i) {
    method create (line 45) | MixedDepsImplementingInterfaces create(Object o) {
    method fromInt (line 49) | @Override
    method fromObject (line 54) | @Override
    method checkNotNull (line 59) | private static <T> T checkNotNull(T reference, int argumentNumber, int...

FILE: factory/src/test/resources/expected/MultipleFactoriesConflictingParameterNamesFactory.java
  class MultipleFactoriesConflictingParameterNamesFactory (line 22) | @Generated(
    method MultipleFactoriesConflictingParameterNamesFactory (line 33) | @Inject
    method create (line 46) | MultipleFactoriesConflictingParameterNames create(Object unused) {
    method create (line 54) | MultipleFactoriesConflictingParameterNames create() {
    method checkNotNull (line 61) | private static <T> T checkNotNull(T reference, int argumentNumber, int...

FILE: factory/src/test/resources/expected/MultipleFactoriesImplementingInterface_ClassAFactory.java
  class MultipleFactoriesImplementingInterface_ClassAFactory (line 21) | @Generated(
    method MultipleFactoriesImplementingInterface_ClassAFactory (line 27) | @Inject
    method create (line 30) | MultipleFactoriesImplementingInterface.ClassA create() {
    method abstractNonDefaultCreate (line 34) | @Override

FILE: factory/src/test/resources/expected/MultipleFactoriesImplementingInterface_ClassBFactory.java
  class MultipleFactoriesImplementingInterface_ClassBFactory (line 21) | @Generated(
    method MultipleFactoriesImplementingInterface_ClassBFactory (line 27) | @Inject
    method create (line 30) | MultipleFactoriesImplementingInterface.ClassB create() {
    method abstractNonDefaultCreate (line 34) | @Override

FILE: factory/src/test/resources/expected/MultipleProvidedParamsSameKeyFactory.java
  class MultipleProvidedParamsSameKeyFactory (line 22) | @Generated(
    method MultipleProvidedParamsSameKeyFactory (line 29) | @Inject
    method create (line 34) | MultipleProvidedParamsSameKey create() {
    method checkNotNull (line 43) | private static <T> T checkNotNull(T reference, int argumentNumber, int...

FILE: factory/src/test/resources/expected/NestedClassCustomNamedFactory.java
  class NestedClassCustomNamedFactory (line 21) | @Generated(
    method NestedClassCustomNamedFactory (line 26) | @Inject
    method create (line 29) | NestedClasses.SimpleNestedClassWithCustomFactory create() {

FILE: factory/src/test/resources/expected/NestedClasses_SimpleNestedClassFactory.java
  class NestedClasses_SimpleNestedClassFactory (line 21) | @Generated(
    method NestedClasses_SimpleNestedClassFactory (line 26) | @Inject
    method create (line 29) | NestedClasses.SimpleNestedClass create() {

FILE: factory/src/test/resources/expected/OnlyPrimitivesFactory.java
  class OnlyPrimitivesFactory (line 21) | @Generated(
    method OnlyPrimitivesFactory (line 26) | @Inject
    method create (line 29) | OnlyPrimitives create(int i, long l) {

FILE: factory/src/test/resources/expected/ParameterAnnotationsFactory.java
  class ParameterAnnotationsFactory (line 22) | @Generated(
    method ParameterAnnotationsFactory (line 29) | @Inject
    method create (line 34) | ParameterAnnotations create(
    method checkNotNull (line 47) | private static <T> T checkNotNull(T reference, int argumentNumber, int...

FILE: factory/src/test/resources/expected/ProviderArgumentToCreateMethodFactory.java
  class ProviderArgumentToCreateMethodFactory (line 22) | @Generated(
    method ProviderArgumentToCreateMethodFactory (line 28) | @Inject
    method create (line 31) | ProviderArgumentToCreateMethod create(Provider<String> stringProvider) {
    method newInstance (line 35) | @Override
    method checkNotNull (line 40) | private static <T> T checkNotNull(T reference, int argumentNumber, int...

FILE: factory/src/test/resources/expected/PublicClassFactory.java
  class PublicClassFactory (line 21) | @Generated(
    method PublicClassFactory (line 26) | @Inject
    method create (line 29) | public PublicClass create() {

FILE: factory/src/test/resources/expected/SimpleClassFactory.java
  class SimpleClassFactory (line 21) | @Generated(
    method SimpleClassFactory (line 26) | @Inject
    method create (line 29) | SimpleClass create() {

FILE: factory/src/test/resources/expected/SimpleClassImplementingMarkerFactory.java
  class SimpleClassImplementingMarkerFactory (line 22) | @Generated(
    method SimpleClassImplementingMarkerFactory (line 27) | @Inject
    method create (line 30) | SimpleClassImplementingMarker create() {

FILE: factory/src/test/resources/expected/SimpleClassImplementingSimpleInterfaceFactory.java
  class SimpleClassImplementingSimpleInterfaceFactory (line 21) | @Generated(
    method SimpleClassImplementingSimpleInterfaceFactory (line 27) | @Inject
    method create (line 30) | SimpleClassImplementingSimpleInterface create() {
    method newInstance (line 34) | @Override

FILE: factory/src/test/resources/expected/SimpleClassMixedDepsFactory.java
  class SimpleClassMixedDepsFactory (line 22) | @Generated(
    method SimpleClassMixedDepsFactory (line 29) | @Inject
    method create (line 34) | SimpleClassMixedDeps create(String depB) {
    method checkNotNull (line 39) | private static <T> T checkNotNull(T reference, int argumentNumber, int...

FILE: factory/src/test/resources/expected/SimpleClassNonFinalFactory.java
  class SimpleClassNonFinalFactory (line 21) | @Generated(
    method SimpleClassNonFinalFactory (line 26) | @Inject
    method create (line 29) | SimpleClassNonFinal create() {

FILE: factory/src/test/resources/expected/SimpleClassNullableParametersFactory.java
  class SimpleClassNullableParametersFactory (line 23) | @Generated(
    method SimpleClassNullableParametersFactory (line 32) | @Inject
    method create (line 40) | SimpleClassNullableParameters create(
    method checkNotNull (line 49) | private static <T> T checkNotNull(T reference, int argumentNumber, int...

FILE: factory/src/test/resources/expected/SimpleClassPassedDepsFactory.java
  class SimpleClassPassedDepsFactory (line 21) | @Generated(
    method SimpleClassPassedDepsFactory (line 26) | @Inject
    method create (line 29) | SimpleClassPassedDeps create(String depA, String depB) {
    method checkNotNull (line 33) | private static <T> T checkNotNull(T reference, int argumentNumber, int...

FILE: factory/src/test/resources/expected/SimpleClassProvidedDepsFactory.java
  class SimpleClassProvidedDepsFactory (line 22) | @Generated(
    method SimpleClassProvidedDepsFactory (line 32) | @Inject
    method create (line 44) | SimpleClassProvidedDeps create() {
    method checkNotNull (line 52) | private static <T> T checkNotNull(T reference, int argumentNumber, int...

FILE: factory/src/test/resources/expected/SimpleClassProvidedProviderDepsFactory.java
  class SimpleClassProvidedProviderDepsFactory (line 22) | @Generated(
    method SimpleClassProvidedProviderDepsFactory (line 30) | @Inject
    method create (line 38) | SimpleClassProvidedProviderDeps create() {
    method checkNotNull (line 42) | private static <T> T checkNotNull(T reference, int argumentNumber, int...

FILE: factory/src/test/resources/expected/SimpleClassThrowsFactory.java
  class SimpleClassThrowsFactory (line 22) | @Generated(
    method SimpleClassThrowsFactory (line 27) | @Inject
    method create (line 30) | SimpleClassThrows create() throws IOException, InterruptedException {

FILE: factory/src/test/resources/expected/SimpleClassVarargsFactory.java
  class SimpleClassVarargsFactory (line 21) | @Generated(
    method SimpleClassVarargsFactory (line 26) | @Inject
    method create (line 29) | SimpleClassVarargs create(String... args) {
    method build (line 33) | @Override
    method checkNotNull (line 38) | private static <T> T checkNotNull(T reference, int argumentNumber, int...

FILE: factory/src/test/resources/good/CheckerFrameworkNullable.java
  class CheckerFrameworkNullable (line 24) | @AutoFactory
    method CheckerFrameworkNullable (line 27) | CheckerFrameworkNullable(

FILE: factory/src/test/resources/good/ClassUsingQualifierWithArgs.java
  class ClassUsingQualifierWithArgs (line 22) | @AutoFactory
    method ClassUsingQualifierWithArgs (line 27) | ClassUsingQualifierWithArgs(

FILE: factory/src/test/resources/good/ConstructorAnnotated.java
  class ConstructorAnnotated (line 21) | final class ConstructorAnnotated {
    method ConstructorAnnotated (line 22) | @AutoFactory
    method ConstructorAnnotated (line 25) | ConstructorAnnotated(Object obj) {}
    method ConstructorAnnotated (line 27) | @AutoFactory
    method ConstructorAnnotated (line 30) | @AutoFactory
    method ConstructorAnnotated (line 33) | @AutoFactory

FILE: factory/src/test/resources/good/ConstructorAnnotatedNonFinal.java
  class ConstructorAnnotatedNonFinal (line 21) | final class ConstructorAnnotatedNonFinal {
    method ConstructorAnnotatedNonFinal (line 22) | @AutoFactory(allowSubclasses = true)
    method ConstructorAnnotatedNonFinal (line 25) | ConstructorAnnotatedNonFinal(Object obj) {}
    method ConstructorAnnotatedNonFinal (line 27) | @AutoFactory(allowSubclasses = true)
    method ConstructorAnnotatedNonFinal (line 30) | @AutoFactory(allowSubclasses = true)
    method ConstructorAnnotatedNonFinal (line 33) | @AutoFactory(allowSubclasses = true)

FILE: factory/src/test/resources/good/ConstructorAnnotatedThrows.java
  class ConstructorAnnotatedThrows (line 22) | final class ConstructorAnnotatedThrows {
    method ConstructorAnnotatedThrows (line 23) | @AutoFactory
    method ConstructorAnnotatedThrows (line 26) | ConstructorAnnotatedThrows(Object obj) {}
    method ConstructorAnnotatedThrows (line 28) | @AutoFactory
    method ConstructorAnnotatedThrows (line 31) | @AutoFactory
    method ConstructorAnnotatedThrows (line 34) | @AutoFactory

FILE: factory/src/test/resources/good/CustomAnnotations.java
  class CustomAnnotations (line 28) | @ImmutableAndSuppressWarnings(suppressWarnings = @SuppressWarnings({"unc...

FILE: factory/src/test/resources/good/CustomNullable.java
  class CustomNullable (line 21) | @AutoFactory
    method CustomNullable (line 27) | CustomNullable(

FILE: factory/src/test/resources/good/DefaultPackage.java
  class DefaultPackage (line 19) | @AutoFactory

FILE: factory/src/test/resources/good/FactoryExtendingAbstractClass.java
  class FactoryExtendingAbstractClass (line 21) | @AutoFactory(extending = AbstractFactory.class)
    class AbstractFactory (line 23) | abstract static class AbstractFactory {
      method newInstance (line 24) | abstract FactoryExtendingAbstractClass newInstance();

FILE: factory/src/test/resources/good/FactoryExtendingAbstractClassThrows.java
  class FactoryExtendingAbstractClassThrows (line 22) | @AutoFactory(extending = AbstractFactory.class)
    method FactoryExtendingAbstractClassThrows (line 24) | FactoryExtendingAbstractClassThrows() throws IOException, InterruptedE...
    class AbstractFactory (line 26) | abstract static class AbstractFactory {
      method newInstance (line 27) | abstract FactoryExtendingAbstractClassThrows newInstance() throws Ex...

FILE: factory/src/test/resources/good/FactoryExtendingAbstractClassWithMultipleConstructors.java
  class FactoryExtendingAbstractClassWithMultipleConstructors (line 21) | @AutoFactory(extending = AbstractFactory.class)
    class AbstractFactory (line 23) | abstract static class AbstractFactory {
      method AbstractFactory (line 24) | protected AbstractFactory(Object obj) {}
      method AbstractFactory (line 26) | protected AbstractFactory() {}
      method newInstance (line 28) | abstract FactoryExtendingAbstractClassWithMultipleConstructors newIn...

FILE: factory/src/test/resources/good/FactoryImplementingCreateMethod.java
  class FactoryImplementingCreateMethod (line 21) | final class FactoryImplementingCreateMethod {
    type Interface (line 23) | interface Interface {}
    type FactoryInterfaceWithCreateMethod (line 25) | interface FactoryInterfaceWithCreateMethod {
      method create (line 26) | Interface create();
      method create (line 28) | Interface create(int a);
      method create (line 30) | Interface create(List<Integer> generic);
    class ConcreteClass (line 33) | @AutoFactory(implementing = FactoryInterfaceWithCreateMethod.class)
      method ConcreteClass (line 36) | ConcreteClass() {}
      method ConcreteClass (line 39) | ConcreteClass(int aDifferentArgumentName) {}
      method ConcreteClass (line 42) | ConcreteClass(List<Integer> genericWithDifferentArgumentName) {}
      method ConcreteClass (line 44) | ConcreteClass(int a, boolean b) {}

FILE: factory/src/test/resources/good/FactoryImplementingGenericInterfaceExtension.java
  class FactoryImplementingGenericInterfaceExtension (line 21) | class FactoryImplementingGenericInterfaceExtension {
    method FactoryImplementingGenericInterfaceExtension (line 23) | @AutoFactory(implementing = MyFactory.class)
    type MyFactory (line 26) | interface MyFactory
    type GenericFactory (line 29) | interface GenericFactory<T, S> {
      method make (line 30) | T make(S arg);

FILE: factory/src/test/resources/good/Generics.java
  class Generics (line 21) | class Generics {
    type Bar (line 22) | interface Bar {}
    type Foo (line 24) | interface Foo<M extends Bar> {}
    type FooFactory (line 26) | interface FooFactory<M extends Bar> {
      method create (line 27) | Foo<M> create();
    class FooImpl (line 32) | @AutoFactory(implementing = FooFactory.class)
      method FooImpl (line 34) | FooImpl() {}
    class ExplicitFooImpl (line 39) | @AutoFactory(implementing = FooFactory.class)
      method ExplicitFooImpl (line 41) | ExplicitFooImpl(@Provided M unused) {}
    class FooFactoryClass (line 44) | abstract static class FooFactoryClass<M extends Bar> {
      method create (line 45) | abstract Foo<M> create();
    class FooImplWithClass (line 48) | @AutoFactory(extending = FooFactoryClass.class)

FILE: factory/src/test/resources/good/MixedDepsImplementingInterfaces.java
  class MixedDepsImplementingInterfaces (line 24) | final class MixedDepsImplementingInterfaces {
    method MixedDepsImplementingInterfaces (line 25) | @AutoFactory(implementing = {FromInt.class, MarkerA.class})
    method MixedDepsImplementingInterfaces (line 28) | @AutoFactory(implementing = {FromObject.class, MarkerB.class})
    type FromInt (line 31) | interface FromInt {
      method fromInt (line 32) | MixedDepsImplementingInterfaces fromInt(int i);
    type FromObject (line 35) | interface FromObject {
      method fromObject (line 36) | MixedDepsImplementingInterfaces fromObject(Object o);
    type MarkerA (line 39) | interface MarkerA {}
    type MarkerB (line 41) | interface MarkerB {}

FILE: factory/src/test/resources/good/MultipleFactoriesConflictingParameterNames.java
  class MultipleFactoriesConflictingParameterNames (line 22) | class MultipleFactoriesConflictingParameterNames {
    method MultipleFactoriesConflictingParameterNames (line 24) | @AutoFactory
    method MultipleFactoriesConflictingParameterNames (line 33) | @AutoFactory

FILE: factory/src/test/resources/good/MultipleFactoriesImplementingInterface.java
  class MultipleFactoriesImplementingInterface (line 20) | class MultipleFactoriesImplementingInterface {
    type Base (line 21) | static interface Base {
      type Factory (line 22) | static interface Factory {
        method abstractNonDefaultCreate (line 23) | public abstract Base abstractNonDefaultCreate();
    class ClassA (line 27) | @AutoFactory(implementing = Base.Factory.class)
    class ClassB (line 30) | @AutoFactory(implementing = Base.Factory.class)

FILE: factory/src/test/resources/good/MultipleProvidedParamsSameKey.java
  class MultipleProvidedParamsSameKey (line 23) | @AutoFactory
    method MultipleProvidedParamsSameKey (line 31) | public MultipleProvidedParamsSameKey(

FILE: factory/src/test/resources/good/NestedClasses.java
  class NestedClasses (line 20) | final class NestedClasses {
    class SimpleNestedClass (line 22) | @AutoFactory
    class SimpleNestedClassWithCustomFactory (line 25) | @AutoFactory(className = "NestedClassCustomNamedFactory")

FILE: factory/src/test/resources/good/OnlyPrimitives.java
  class OnlyPrimitives (line 23) | @AutoFactory
    method OnlyPrimitives (line 25) | OnlyPrimitives(int i, long l) {}

FILE: factory/src/test/resources/good/ParameterAnnotations.java
  class ParameterAnnotations (line 27) | @AutoFactory
    method ParameterAnnotations (line 46) | ParameterAnnotations(

FILE: factory/src/test/resources/good/ProviderArgumentToCreateMethod.java
  class ProviderArgumentToCreateMethod (line 21) | @AutoFactory(implementing = ProviderArgumentToCreateMethod.CustomCreator...
    method ProviderArgumentToCreateMethod (line 25) | ProviderArgumentToCreateMethod(Provider<String> stringProvider) {
    type CustomCreator (line 29) | interface CustomCreator {
      method newInstance (line 30) | ProviderArgumentToCreateMethod newInstance(Provider<String> stringPr...

FILE: factory/src/test/resources/good/PublicClass.java
  class PublicClass (line 20) | @AutoFactory

FILE: factory/src/test/resources/good/SimpleClass.java
  class SimpleClass (line 20) | @AutoFactory

FILE: factory/src/test/resources/good/SimpleClassCustomName.java
  class SimpleClassCustomName (line 20) | @AutoFactory(className = "CustomNamedFactory")

FILE: factory/src/test/resources/good/SimpleClassImplementingMarker.java
  class SimpleClassImplementingMarker (line 19) | @AutoFactory(implementing = RandomAccess.class)

FILE: factory/src/test/resources/good/SimpleClassImplementingSimpleInterface.java
  class SimpleClassImplementingSimpleInterface (line 21) | @AutoFactory(implementing = SimpleInterface.class)
    type SimpleInterface (line 23) | interface SimpleInterface {
      method newInstance (line 24) | SimpleClassImplementingSimpleInterface newInstance();

FILE: factory/src/test/resources/good/SimpleClassMixedDeps.java
  class SimpleClassMixedDeps (line 24) | @AutoFactory
    method SimpleClassMixedDeps (line 30) | SimpleClassMixedDeps(@Provided @AQualifier String providedDepA, String...

FILE: factory/src/test/resources/good/SimpleClassNonFinal.java
  class SimpleClassNonFinal (line 20) | @AutoFactory(allowSubclasses = true)

FILE: factory/src/test/resources/good/SimpleClassNullableParameters.java
  class SimpleClassNullableParameters (line 22) | @AutoFactory
    method SimpleClassNullableParameters (line 31) | SimpleClassNullableParameters(

FILE: factory/src/test/resources/good/SimpleClassPassedDeps.java
  class SimpleClassPassedDeps (line 23) | @AutoFactory
    method SimpleClassPassedDeps (line 29) | SimpleClassPassedDeps(String depA, String depB) {

FILE: factory/src/test/resources/good/SimpleClassProvidedDeps.java
  class SimpleClassProvidedDeps (line 22) | @AutoFactory
    method SimpleClassProvidedDeps (line 30) | SimpleClassProvidedDeps(

FILE: factory/src/test/resources/good/SimpleClassProvidedProviderDeps.java
  class SimpleClassProvidedProviderDeps (line 23) | @AutoFactory
    method SimpleClassProvidedProviderDeps (line 29) | SimpleClassProvidedProviderDeps(

FILE: factory/src/test/resources/good/SimpleClassThrows.java
  class SimpleClassThrows (line 21) | @AutoFactory
    method SimpleClassThrows (line 23) | SimpleClassThrows() throws IOException, InterruptedException {}

FILE: factory/src/test/resources/good/SimpleClassVarargs.java
  class SimpleClassVarargs (line 20) | @AutoFactory(implementing = SimpleClassVarargs.InterfaceWithVarargs.class)
    method SimpleClassVarargs (line 24) | SimpleClassVarargs(String... args) {
    type InterfaceWithVarargs (line 28) | interface InterfaceWithVarargs {
      method build (line 29) | SimpleClassVarargs build(String... args);

FILE: service/processor/src/main/java/com/google/auto/service/processor/AutoServiceProcessor.java
  class AutoServiceProcessor (line 69) | @SupportedOptions({"debug", "verify"})
    method getSupportedAnnotationTypes (line 86) | @Override
    method getSupportedSourceVersion (line 91) | @Override
    method process (line 115) | @Override
    method exceptionStacks (line 128) | ImmutableList<String> exceptionStacks() {
    method processImpl (line 132) | private void processImpl(Set<? extends TypeElement> annotations, Round...
    method processAnnotations (line 140) | private void processAnnotations(
    method generateConfigFiles (line 177) | private void generateConfigFiles() {
    method checkImplementer (line 205) | private boolean checkImplementer(
    method checkNotAbstract (line 255) | private boolean checkNotAbstract(
    method suppresses (line 267) | private static boolean suppresses(Element element, String warning) {
    method getBinaryName (line 281) | private String getBinaryName(TypeElement element) {
    method getBinaryNameImpl (line 285) | private String getBinaryNameImpl(TypeElement element, String className) {
    method getValueFieldOfClasses (line 304) | private ImmutableSet<DeclaredType> getValueFieldOfClasses(AnnotationMi...
    method log (line 326) | private void log(String msg) {
    method warning (line 332) | private void warning(String msg, Element element, AnnotationMirror ann...
    method error (line 336) | private void error(String msg, Element element, AnnotationMirror annot...
    method fatalError (line 340) | private void fatalError(String msg) {

FILE: service/processor/src/main/java/com/google/auto/service/processor/ServicesFiles.java
  class ServicesFiles (line 32) | final class ServicesFiles {
    method ServicesFiles (line 35) | private ServicesFiles() {}
    method getPath (line 43) | static String getPath(String serviceName) {
    method readServiceFile (line 54) | static Set<String> readServiceFile(InputStream input) throws IOExcepti...
    method writeServiceFile (line 79) | static void writeServiceFile(Collection<String> services, OutputStream...

FILE: service/processor/src/test/java/com/google/auto/service/processor/AutoServiceProcessorTest.java
  class AutoServiceProcessorTest (line 33) | @RunWith(JUnit4.class)
    method autoService (line 37) | @Test
    method multiService (line 58) | @Test
    method badMultiService (line 79) | @Test
    method doesNotImplement_failsByDefault (line 86) | @Test
    method doesNotImplement_succeedsWithVerifyFalse (line 95) | @Test
    method doesNotImplement_suppressed (line 110) | @Test
    method generic (line 123) | @Test
    method genericWithNoVerifyOption (line 138) | @Test
    method genericWithExplicitVerify (line 151) | @Test
    method genericWithVerifyOptionAndSuppressWarings (line 166) | @Test
    method nestedGenericWithVerifyOptionAndSuppressWarnings (line 177) | @Test
    method missing (line 192) | @Test
    method autoServiceOnInterface (line 205) | @Test
    method autoServiceOnAbstractClass (line 222) | @Test

FILE: service/processor/src/test/resources/test/AnotherService.java
  type AnotherService (line 18) | interface AnotherService {}

FILE: service/processor/src/test/resources/test/AnotherServiceProvider.java
  class AnotherServiceProvider (line 20) | @AutoService(AnotherService.class)

FILE: service/processor/src/test/resources/test/AutoServiceOnAbstractClass.java
  class AutoServiceOnAbstractClass (line 20) | @AutoService(SomeService.class)

FILE: service/processor/src/test/resources/test/AutoServiceOnInterface.java
  type AutoServiceOnInterface (line 20) | @AutoService(SomeService.class)

FILE: service/processor/src/test/resources/test/DoesNotImplement.java
  class DoesNotImplement (line 20) | @AutoService(SomeService.class)

FILE: service/processor/src/test/resources/test/DoesNotImplementSuppressed.java
  class DoesNotImplementSuppressed (line 20) | @AutoService(SomeService.class)

FILE: service/processor/src/test/resources/test/Enclosing.java
  class Enclosing (line 20) | public class Enclosing {
    class NestedSomeServiceProvider (line 21) | @AutoService(SomeService.class)

FILE: service/processor/src/test/resources/test/EnclosingGeneric.java
  class EnclosingGeneric (line 21) | @SuppressWarnings("rawtypes")
    class GenericServiceProvider (line 27) | @AutoService(GenericService.class)
    method EnclosingGeneric (line 30) | private EnclosingGeneric() {}

FILE: service/processor/src/test/resources/test/GenericService.java
  type GenericService (line 22) | public interface GenericService<T> {}

FILE: service/processor/src/test/resources/test/GenericServiceProvider.java
  class GenericServiceProvider (line 24) | @AutoService(GenericService.class)

FILE: service/processor/src/test/resources/test/GenericServiceProviderSuppressWarnings.java
  class GenericServiceProviderSuppressWarnings (line 24) | @AutoService(GenericService.class)

FILE: service/processor/src/test/resources/test/GenericServiceProviderWithMissingServiceClass.java
  class GenericServiceProviderWithMissingServiceClass (line 24) | @AutoService(MissingServiceClass.class)

FILE: service/processor/src/test/resources/test/MultiServiceProvider.java
  class MultiServiceProvider (line 20) | @AutoService({SomeService.class, AnotherService.class})

FILE: service/processor/src/test/resources/test/NoServices.java
  class NoServices (line 20) | @AutoService({})

FILE: service/processor/src/test/resources/test/SomeService.java
  type SomeService (line 18) | interface SomeService {}

FILE: service/processor/src/test/resources/test/SomeServiceProvider1.java
  class SomeServiceProvider1 (line 20) | @AutoService(SomeService.class)

FILE: service/processor/src/test/resources/test/SomeServiceProvider2.java
  class SomeServiceProvider2 (line 20) | @AutoService(SomeService.class)

FILE: value/src/it/functional/src/main/java/PackagelessNestedValueType.java
  class PackagelessNestedValueType (line 23) | @SuppressWarnings("DefaultPackage")
    class Nested (line 25) | @AutoValue
      method numberNames (line 27) | abstract Map<Integer, String> numberNames();
      method create (line 29) | public static Nested create(Map<Integer, String> numberNames) {

FILE: value/src/it/functional/src/main/java/PackagelessValueType.java
  class PackagelessValueType (line 26) | @SuppressWarnings("DefaultPackage")
    method string (line 35) | @Nullable
    method integer (line 41) | public abstract int integer();
    method map (line 46) | public abstract Map<String, Long> map();
    method create (line 48) | public static PackagelessValueType create(

FILE: value/src/it/functional/src/main/java/com/google/auto/value/NestedValueType.java
  class NestedValueType (line 23) | public class NestedValueType {
    class Nested (line 24) | @AutoValue
      method numberNames (line 26) | abstract Map<Integer, String> numberNames();
      method create (line 28) | public static Nested create(Map<Integer, String> numberNames) {

FILE: value/src/it/functional/src/main/java/com/google/auto/value/SimpleValueType.java
  class SimpleValueType (line 26) | @AutoValue
    method string (line 32) | @Nullable
    method integer (line 36) | public abstract int integer();
    method map (line 39) | public abstract Map<String, Long> map();
    method create (line 41) | public static SimpleValueType create(

FILE: value/src/it/functional/src/test/java/PackagelessValueTypeTest.java
  class PackagelessValueTypeTest (line 30) | @RunWith(JUnit4.class)
    method testPackagelessValueType (line 32) | @Test
    method testNestedValueType (line 50) | @Test
    method testNull (line 58) | @Test

FILE: value/src/it/functional/src/test/java/com/google/auto/value/AutoAnnotationDefaultsTest.java
  class AutoAnnotationDefaultsTest (line 33) | @RunWith(JUnit4.class)
    method newEverythingWithDefaults (line 84) | @AutoAnnotation
    method testDefaults (line 89) | @Test
    method equal (line 121) | private static boolean equal(Object x, Object y) {
    method string (line 125) | private static String string(Object x) {

FILE: value/src/it/functional/src/test/java/com/google/auto/value/AutoAnnotationTest.java
  class AutoAnnotationTest (line 53) | @RunWith(JUnit4.class)
    method newStringValues (line 55) | @AutoAnnotation
    class AnnotatedClass (line 60) | @Empty
    method testSimple (line 64) | @Test
    method testEqualsParameterAnnotation (line 75) | @Test
    method testArraysAreCloned (line 96) | @Test
    method testGwtArraysAreCloned (line 106) | @Test
    method newGwtArrays (line 119) | @AutoAnnotation
    method newStringValuesVarArgs (line 124) | @AutoAnnotation
    method testSimpleVarArgs (line 129) | @Test
    method newEmpty (line 140) | @AutoAnnotation
    method testEmpty (line 145) | @Test
    method newEverything (line 203) | @AutoAnnotation
    method newEverythingCollections (line 256) | @AutoAnnotation
    class AnnotatedWithEverything (line 309) | @Everything(
    method testEqualsAndHashCode (line 452) | @Test
    method testSerialization (line 461) | @Test
    method testSerialVersionUid (line 469) | @Test
    class IntList (line 491) | public static class IntList extends ArrayList<Integer> {
      method IntList (line 494) | IntList(Collection<Integer> c) {
    class AnnotatedWithIntArray (line 504) | @IntArray(ints = {1, 2, 3})
    method newIntArray (line 507) | @AutoAnnotation
    method testDerivedPrimitiveCollection (line 522) | @Test
    method testToString (line 530) | @Test
    method testStringQuoting (line 554) | @Test
    class AnnotatedWithAnnotationsAnnotation (line 572) | @AnnotationsAnnotation(AnnotationsAnnotation.class)
    method newAnnotationsAnnotation (line 575) | @AutoAnnotation
    method testGenericArray (line 580) | @Test
    class AnnotatedWithClassesAnnotation (line 595) | @ClassesAnnotation(AnnotationsAnnotation.class)
    method newClassesAnnotation (line 598) | @AutoAnnotation
    method testWildcardArray (line 603) | @Test
    class AnnotatedWithIntegersAnnotation (line 621) | @IntegersAnnotation(three = 23)
    method newIntegersAnnotation (line 624) | @AutoAnnotation
    method testConstantOverflowInHashCode (line 629) | @Test
    class AnnotatedWithEverythingWithDefaults (line 686) | @EverythingWithDefaults
    method newEverythingWithDefaults (line 689) | @AutoAnnotation
    method testDefaultedValues (line 694) | @Test

FILE: value/src/it/functional/src/test/java/com/google/auto/value/AutoBuilderKotlinTest.java
  class AutoBuilderKotlinTest (line 29) | @RunWith(JUnit4.class)
    class KotlinDataBuilder (line 31) | @AutoBuilder(ofClass = KotlinData.class)
      method builder (line 33) | static KotlinDataBuilder builder() {
      method builder (line 37) | static KotlinDataBuilder builder(KotlinData kotlinData) {
      method setInt (line 41) | abstract KotlinDataBuilder setInt(int x);
      method setString (line 43) | abstract KotlinDataBuilder setString(String x);
      method build (line 45) | abstract KotlinData build();
    method simpleKotlin (line 48) | @Test
    class KotlinDataWithNullableBuilder (line 61) | @AutoBuilder(ofClass = KotlinDataWithNullable.class)
      method builder (line 63) | static KotlinDataWithNullableBuilder builder() {
      method setAnInt (line 67) | abstract KotlinDataWithNullableBuilder setAnInt(int x);
      method setAString (line 69) | abstract KotlinDataWithNullableBuilder setAString(String x);
      method build (line 71) | abstract KotlinDataWithNullable build();
    method kotlinWithNullable (line 74) | @Test
    class KotlinDataWithDefaultsBuilder (line 86) | @AutoBuilder(ofClass = KotlinDataWithDefaults.class)
      method builder (line 88) | static KotlinDataWithDefaultsBuilder builder() {
      method setAnInt (line 92) | abstract KotlinDataWithDefaultsBuilder setAnInt(int x);
      method getAnInt (line 94) | abstract int getAnInt();
      method anImmutableListBuilder (line 96) | abstract ImmutableList.Builder<String> anImmutableListBuilder();
      method setNotDefaulted (line 98) | abstract KotlinDataWithDefaultsBuilder setNotDefaulted(long x);
      method getNotDefaulted (line 100) | abstract long getNotDefaulted();
      method setAString (line 102) | abstract KotlinDataWithDefaultsBuilder setAString(String x);
      method getAString (line 104) | abstract String getAString();
      method build (line 106) | abstract KotlinDataWithDefaults build();
    method kotlinWithDefaults_explicit (line 109) | @Test
    method kotlinWithDefaults_defaulted (line 124) | @Test
    method kotlinWithDefaults_getter (line 141) | @Test
    type KotlinDataEightDefaultsBuilder (line 155) | @AutoBuilder(ofClass = KotlinDataEightDefaults.class)
      method builder (line 157) | static KotlinDataEightDefaultsBuilder builder() {
      method a1 (line 161) | KotlinDataEightDefaultsBuilder a1(int x);
      method a2 (line 163) | KotlinDataEightDefaultsBuilder a2(int x);
      method a3 (line 165) | KotlinDataEightDefaultsBuilder a3(int x);
      method a4 (line 167) | KotlinDataEightDefaultsBuilder a4(int x);
      method a5 (line 169) | KotlinDataEightDefaultsBuilder a5(int x);
      method a6 (line 171) | KotlinDataEightDefaultsBuilder a6(int x);
      method a7 (line 173) | KotlinDataEightDefaultsBuilder a7(int x);
      method a8 (line 175) | KotlinDataEightDefaultsBuilder a8(int x);
      method build (line 177) | KotlinDataEightDefaults build();
    method kotlinEightDefaults (line 183) | @Test
    type KotlinDataSomeDefaultsBuilder (line 203) | @AutoBuilder(ofClass = KotlinDataSomeDefaults.class)
      method builder (line 205) | static KotlinDataSomeDefaultsBuilder builder() {
      method fromInstance (line 209) | static KotlinDataSomeDefaultsBuilder fromInstance(KotlinDataSomeDefa...
      method requiredInt (line 213) | KotlinDataSomeDefaultsBuilder requiredInt(int x);
      method requiredString (line 215) | KotlinDataSomeDefaultsBuilder requiredString(String x);
      method optionalInt (line 217) | KotlinDataSomeDefaultsBuilder optionalInt(int x);
      method optionalString (line 219) | KotlinDataSomeDefaultsBuilder optionalString(String x);
      method build (line 221) | KotlinDataSomeDefaults build();
    method kotlinSomeDefaults_someDefaulted (line 224) | @Test
    method kotlinSomeDefaults_noneDefaulted (line 234) | @Test
    method kotlinSomeDefaults_missingRequired (line 247) | @Test
    type KotlinDataSomeDefaultsBigBuilder (line 256) | @AutoBuilder(ofClass = KotlinDataSomeDefaultsBig.class)
      method builder (line 258) | static KotlinDataSomeDefaultsBigBuilder builder() {
      method requiredInt (line 262) | KotlinDataSomeDefaultsBigBuilder requiredInt(int x);
      method requiredString (line 264) | KotlinDataSomeDefaultsBigBuilder requiredString(String x);
      method a1 (line 266) | KotlinDataSomeDefaultsBigBuilder a1(int x);
      method a2 (line 268) | KotlinDataSomeDefaultsBigBuilder a2(int x);
      method a3 (line 270) | KotlinDataSomeDefaultsBigBuilder a3(int x);
      method a4 (line 272) | KotlinDataSomeDefaultsBigBuilder a4(int x);
      method a5 (line 274) | KotlinDataSomeDefaultsBigBuilder a5(int x);
      method a6 (line 276) | KotlinDataSomeDefaultsBigBuilder a6(int x);
      method a7 (line 278) | KotlinDataSomeDefaultsBigBuilder a7(int x);
      method a8 (line 280) | KotlinDataSomeDefaultsBigBuilder a8(int x);
      method a9 (line 282) | KotlinDataSomeDefaultsBigBuilder a9(int x);
      method a10 (line 284) | KotlinDataSomeDefaultsBigBuilder a10(int x);
      method a11 (line 286) | KotlinDataSomeDefaultsBigBuilder a11(int x);
      method a12 (line 288) | KotlinDataSomeDefaultsBigBuilder a12(int x);
      method a13 (line 290) | KotlinDataSomeDefaultsBigBuilder a13(int x);
      method a14 (line 292) | KotlinDataSomeDefaultsBigBuilder a14(int x);
      method a15 (line 294) | KotlinDataSomeDefaultsBigBuilder a15(int x);
      method a16 (line 296) | KotlinDataSomeDefaultsBigBuilder a16(int x);
      method a17 (line 298) | KotlinDataSomeDefaultsBigBuilder a17(int x);
      method a18 (line 300) | KotlinDataSomeDefaultsBigBuilder a18(int x);
      method a19 (line 302) | KotlinDataSomeDefaultsBigBuilder a19(int x);
      method a20 (line 304) | KotlinDataSomeDefaultsBigBuilder a20(int x);
      method a21 (line 306) | KotlinDataSomeDefaultsBigBuilder a21(int x);
      method a22 (line 308) | KotlinDataSomeDefaultsBigBuilder a22(int x);
      method a23 (line 310) | KotlinDataSomeDefaultsBigBuilder a23(int x);
      method a24 (line 312) | KotlinDataSomeDefaultsBigBuilder a24(int x);
      method a25 (line 314) | KotlinDataSomeDefaultsBigBuilder a25(int x);
      method a26 (line 316) | KotlinDataSomeDefaultsBigBuilder a26(int x);
      method a27 (line 318) | KotlinDataSomeDefaultsBigBuilder a27(int x);
      method a28 (line 320) | KotlinDataSomeDefaultsBigBuilder a28(int x);
      method a29 (line 322) | KotlinDataSomeDefaultsBigBuilder a29(int x);
      method a30 (line 324) | KotlinDataSomeDefaultsBigBuilder a30(int x);
      method a31 (line 326) | KotlinDataSomeDefaultsBigBuilder a31(int x);
      method build (line 328) | KotlinDataSomeDefaultsBig build();
    method kotlinSomeDefaultsBig (line 331) | @Test
    type KotlinDataWithListBuilder (line 341) | @AutoBuilder(ofClass = KotlinDataWithList.class)
      method builder (line 343) | static KotlinDataWithListBuilder builder() {
      method builder (line 347) | static KotlinDataWithListBuilder builder(KotlinDataWithList kotlinDa...
      method list (line 351) | KotlinDataWithListBuilder list(List<? extends CharSequence> list);
      method number (line 353) | KotlinDataWithListBuilder number(int number);
      method build (line 355) | KotlinDataWithList build();
    method kotlinWildcards (line 360) | @Test
    type KotlinDataWithTypeParametersBuilder (line 371) | @AutoBuilder(ofClass = KotlinDataWithTypeParameters.class)
      method builder (line 374) | static <T, U extends Number, V extends Number, W extends Number, M e...
      method t (line 380) | KotlinDataWithTypeParametersBuilder<T, U, V, W, M> t(T t);
      method u (line 382) | KotlinDataWithTypeParametersBuilder<T, U, V, W, M> u(U u);
      method v (line 384) | KotlinDataWithTypeParametersBuilder<T, U, V, W, M> v(V v);
      method m (line 386) | KotlinDataWithTypeParametersBuilder<T, U, V, W, M> m(M m);
      method getT (line 388) | T getT();
      method getU (line 390) | U getU();
      method getV (line 392) | V getV();
      method getM (line 394) | M getM();
      method build (line 396) | KotlinDataWithTypeParameters<T, U, V, W, M> build();
    method kotlinWithTypeParameters (line 399) | @Test

FILE: value/src/it/functional/src/test/java/com/google/auto/value/AutoBuilderTest.java
  class AutoBuilderTest (line 50) | @RunWith(JUnit4.class)
    class Simple (line 52) | static class Simple {
      method Simple (line 56) | Simple(int anInt, String aString) {
      method of (line 61) | static Simple of(int anInt, String aString) {
      method equals (line 65) | @Override
      method hashCode (line 74) | @Override
      method toString (line 79) | @Override
      method builder (line 87) | static Builder builder() {
      class Builder (line 91) | @AutoBuilder
        method setAnInt (line 93) | abstract Builder setAnInt(int x);
        method setAString (line 95) | abstract Builder setAString(String x);
        method build (line 97) | abstract Simple build();
    method simple (line 101) | @Test
    class SimpleAuto (line 107) | @AutoValue
      method getFoo (line 109) | abstract int getFoo();
      method getBar (line 111) | abstract String getBar();
      method builder (line 113) | static Builder builder() {
      class Builder (line 119) | @AutoBuilder(ofClass = AutoValue_AutoBuilderTest_SimpleAuto.class)
        method setFoo (line 121) | abstract Builder setFoo(int x);
        method setBar (line 123) | abstract Builder setBar(String x);
        method build (line 125) | abstract AutoValue_AutoBuilderTest_SimpleAuto build();
    method simpleAuto (line 129) | @Test
    type Truthiness (line 136) | enum Truthiness {
    method myAnnotation (line 156) | @AutoAnnotation
    method myAnnotationAll (line 162) | @AutoAnnotation
    type MyAnnotationBuilder (line 167) | @AutoBuilder(callMethod = "myAnnotation")
      method value (line 169) | MyAnnotationBuilder value(String x);
      method truthiness (line 171) | MyAnnotationBuilder truthiness(Truthiness x);
      method build (line 173) | MyAnnotation build();
    method myAnnotationBuilder (line 176) | static MyAnnotationBuilder myAnnotationBuilder() {
    type MyAnnotationAllBuilder (line 180) | @AutoBuilder(callMethod = "myAnnotationAll")
      method value (line 182) | MyAnnotationAllBuilder value(String x);
      method id (line 184) | MyAnnotationAllBuilder id(int x);
      method truthiness (line 186) | MyAnnotationAllBuilder truthiness(Truthiness x);
      method build (line 188) | MyAnnotation build();
    method myAnnotationAllBuilder (line 191) | static MyAnnotationAllBuilder myAnnotationAllBuilder() {
    method simpleAutoAnnotation (line 195) | @Test
    type MyAnnotationSimpleBuilder (line 219) | @AutoBuilder(ofClass = MyAnnotation.class)
      method value (line 221) | MyAnnotationSimpleBuilder value(String x);
      method id (line 223) | MyAnnotationSimpleBuilder id(int x);
      method truthiness (line 225) | MyAnnotationSimpleBuilder truthiness(Truthiness x);
      method build (line 227) | MyAnnotation build();
    method myAnnotationSimpleBuilder (line 230) | public static MyAnnotationSimpleBuilder myAnnotationSimpleBuilder() {
    method buildWithoutAutoAnnotation (line 234) | @Test
    type MyAnnotationSimplerBuilder (line 260) | @AutoBuilder(ofClass = MyAnnotation.class)
      method value (line 262) | MyAnnotationSimplerBuilder value(String x);
      method id (line 264) | MyAnnotationSimplerBuilder id(int x);
      method build (line 266) | MyAnnotation build();
    method myAnnotationSimplerBuilder (line 269) | public static MyAnnotationSimplerBuilder myAnnotationSimplerBuilder() {
    method buildWithoutAutoAnnotation_noSetterForElement (line 273) | @Test
    class Overload (line 281) | static class Overload {
      method Overload (line 286) | Overload(int anInt, String aString) {
      method Overload (line 290) | Overload(int anInt, String aString, BigInteger aBigInteger) {
      method equals (line 296) | @Override
      method hashCode (line 307) | @Override
      method toString (line 312) | @Override
      method builder1 (line 321) | static Builder1 builder1() {
      method builder2 (line 325) | static Builder2 builder2() {
      type Builder1 (line 329) | @AutoBuilder
        method setAnInt (line 331) | Builder1 setAnInt(int x);
        method setAString (line 333) | Builder1 setAString(String x);
        method build (line 335) | Overload build();
      type Builder2 (line 338) | @AutoBuilder
        method setAnInt (line 340) | Builder2 setAnInt(int x);
        method setAString (line 342) | Builder2 setAString(String x);
        method setABigInteger (line 344) | Builder2 setABigInteger(BigInteger x);
        method build (line 346) | Overload build();
    method overloadedConstructor (line 350) | @Test
    type SimpleStaticBuilder (line 363) | @AutoBuilder(callMethod = "of", ofClass = Simple.class)
      method anInt (line 365) | SimpleStaticBuilder anInt(int x);
      method aString (line 367) | SimpleStaticBuilder aString(String x);
      method build (line 369) | Simple build();
    method simpleStaticBuilder (line 372) | static SimpleStaticBuilder simpleStaticBuilder() {
    method staticMethod (line 376) | @Test
    method localTimeOf (line 386) | static LocalTime localTimeOf(int hour, int minute, int second, int nan...
    method localTimeBuilder (line 390) | static LocalTimeBuilder localTimeBuilder() {
    type LocalTimeBuilder (line 394) | @AutoBuilder(callMethod = "localTimeOf")
      method hour (line 396) | LocalTimeBuilder hour(int hour);
      method minute (line 398) | LocalTimeBuilder minute(int minute);
      method second (line 400) | LocalTimeBuilder second(int second);
      method nanoOfSecond (line 402) | LocalTimeBuilder nanoOfSecond(int nanoOfSecond);
      method build (line 404) | LocalTime build();
    method staticMethodOfContainingClass (line 407) | @Test
    method missingRequiredProperty (line 414) | @Test
    method throwException (line 422) | static void throwException() throws IOException {
    method throwExceptionBuilder (line 426) | static ThrowExceptionBuilder throwExceptionBuilder() {
    type ThrowExceptionBuilder (line 430) | @AutoBuilder(callMethod = "throwException")
      method build (line 432) | void build() throws IOException;
    method emptyBuilderThrowsException (line 435) | @Test
    class ListContainer (line 445) | static class ListContainer {
      method ListContainer (line 448) | ListContainer(ImmutableList<String> list) {
      method equals (line 452) | @Override
      method hashCode (line 457) | @Override
      method toString (line 462) | @Override
      method builder (line 467) | static Builder builder() {
      type Builder (line 471) | @AutoBuilder
        method setList (line 473) | Builder setList(Iterable<String> list);
        method listBuilder (line 475) | ImmutableList.Builder<String> listBuilder();
        method build (line 477) | ListContainer build();
    method propertyBuilder (line 481) | @Test
    method concatList (line 506) | static <T> String concatList(ImmutableList<T> list) {
    type ConcatListCaller (line 510) | @AutoBuilder(callMethod = "concatList")
      method listBuilder (line 512) | ImmutableList.Builder<T> listBuilder();
      method call (line 514) | String call();
    method propertyBuilderWithoutSetter (line 517) | @Test
    method singletonMap (line 525) | static <K, V extends Number> Map<K, V> singletonMap(K key, V value) {
    method singletonMapBuilder (line 529) | static <K, V extends Number> SingletonMapBuilder<K, V> singletonMapBui...
    type SingletonMapBuilder (line 533) | @AutoBuilder(callMethod = "singletonMap")
      method key (line 535) | SingletonMapBuilder<K, V> key(K key);
      method value (line 537) | SingletonMapBuilder<K, V> value(V value);
      method build (line 539) | Map<K, V> build();
    method genericStaticMethod (line 542) | @Test
    class SingletonSet (line 550) | static class SingletonSet<E> extends AbstractSet<E> {
      method SingletonSet (line 553) | SingletonSet(E element) {
      method size (line 557) | @Override
      method iterator (line 562) | @Override
    type SingletonSetBuilder (line 584) | @AutoBuilder(ofClass = SingletonSet.class)
      method setElement (line 586) | SingletonSetBuilder<E> setElement(E element);
      method build (line 588) | SingletonSet<E> build();
    method singletonSetBuilder (line 591) | static <E> SingletonSetBuilder<E> singletonSetBuilder() {
    method genericClass (line 595) | @Test
    class TypedSingletonSet (line 603) | static class TypedSingletonSet<E> extends SingletonSet<E> {
      method TypedSingletonSet (line 606) | <T extends E> TypedSingletonSet(T element, Class<T> type) {
      method toString (line 611) | @Override
    type TypedSingletonSetBuilder (line 617) | @AutoBuilder(ofClass = TypedSingletonSet.class)
      method setElement (line 619) | TypedSingletonSetBuilder<E, T> setElement(T element);
      method setType (line 621) | TypedSingletonSetBuilder<E, T> setType(Class<T> type);
      method build (line 623) | TypedSingletonSet<E> build();
    method typedSingletonSetBuilder (line 626) | static <E, T extends E> TypedSingletonSetBuilder<E, T> typedSingletonS...
    method genericClassWithGenericConstructor (line 630) | @Test
    method pair (line 637) | static <T> ImmutableList<T> pair(T first, T second) {
    type PairBuilder (line 641) | @AutoBuilder(callMethod = "pair")
      method setFirst (line 643) | PairBuilder<T> setFirst(T x);
      method getFirst (line 645) | T getFirst();
      method setSecond (line 647) | PairBuilder<T> setSecond(T x);
      method getSecond (line 649) | Optional<T> getSecond();
      method build (line 651) | ImmutableList<T> build();
    method pairBuilder (line 654) | static <T> PairBuilder<T> pairBuilder() {
    method genericGetters (line 658) | @Test
    class NumberHolder (line 674) | static class NumberHolder<T extends Number> {
      method NumberHolder (line 677) | NumberHolder(T number) {
      method getNumber (line 681) | T getNumber() {
    method buildNumberHolder (line 686) | static <T extends Number> NumberHolder<T> buildNumberHolder(T number) {
    type NumberHolderBuilder (line 690) | @AutoBuilder(callMethod = "buildNumberHolder")
      method setNumber (line 692) | NumberHolderBuilder<T> setNumber(T number);
      method build (line 694) | NumberHolder<T> build();
    method numberHolderBuilder (line 697) | static <T extends Number> NumberHolderBuilder<T> numberHolderBuilder() {
    method numberHolderBuilder (line 701) | static <T extends Number> NumberHolderBuilder<T> numberHolderBuilder(
    method builderFromInstance (line 706) | @Test
    type AnnotatedSimpleStaticBuilder1 (line 717) | @AutoBuilder(callMethod = "of", ofClass = Simple.class)
      method anInt (line 720) | AnnotatedSimpleStaticBuilder1 anInt(int x);
      method aString (line 722) | AnnotatedSimpleStaticBuilder1 aString(String x);
      method build (line 724) | Simple build();
    method builderAnnotationsNotCopiedByDefault (line 727) | @Test
    type AnnotatedSimpleStaticBuilder2 (line 734) | @AutoBuilder(callMethod = "of", ofClass = Simple.class)
      method anInt (line 738) | AnnotatedSimpleStaticBuilder2 anInt(int x);
      method aString (line 740) | AnnotatedSimpleStaticBuilder2 aString(String x);
      method build (line 742) | Simple build();
    method builderAnnotationsCopiedIfRequested (line 745) | @Test
    method frob (line 755) | public static <T extends @Nullable Object, U> T frob(T arg, U notNull) {
    type FrobCaller (line 759) | @AutoBuilder(callMethod = "frob")
      method arg (line 761) | FrobCaller<T, U> arg(T arg);
      method notNull (line 763) | FrobCaller<T, U> notNull(U notNull);
      method call (line 765) | T call();
      method caller (line 767) | static <T extends @Nullable Object, U> FrobCaller<T, U> caller() {
    method builderTypeVariableWithNullableBound (line 772) | @Test

FILE: value/src/it/functional/src/test/java/com/google/auto/value/AutoOneOfJava8Test.java
  class AutoOneOfJava8Test (line 35) | @RunWith(JUnit4.class)
    class EqualsNullable (line 37) | @AutoOneOf(EqualsNullable.Kind.class)
      type Kind (line 44) | public enum Kind {
      method kind (line 48) | public abstract Kind kind();
      method thing (line 50) | public abstract String thing();
      method ofThing (line 52) | public static EqualsNullable ofThing(String thing) {
      method equals (line 56) | @Override
      method hashCode (line 59) | @Override
    method equalsNullable (line 67) | @Test

FILE: value/src/it/functional/src/test/java/com/google/auto/value/AutoOneOfTest.java
  class AutoOneOfTest (line 37) | @RunWith(JUnit4.class)
    class Dog (line 39) | @AutoValue
      method name (line 41) | public abstract String name();
      method create (line 43) | public static Dog create(String name) {
      method bark (line 47) | public void bark() {}
    class Cat (line 50) | @AutoValue
      method create (line 52) | public static Cat create() {
      method meow (line 56) | public void meow() {}
    class TigerShark (line 59) | @AutoValue
      method create (line 61) | public static TigerShark create() {
      method chomp (line 65) | public void chomp() {}
    class Pet (line 68) | @AutoOneOf(Pet.Kind.class)
      method create (line 71) | public static Pet create(Dog dog) {
      method create (line 75) | public static Pet create(Cat cat) {
      method create (line 79) | public static Pet create(TigerShark shark) {
      method dog (line 83) | public abstract Dog dog();
      method cat (line 85) | public abstract Cat cat();
      method tigerShark (line 87) | public abstract TigerShark tigerShark();
      type Kind (line 89) | public enum Kind {
      method getKind (line 95) | public abstract Kind getKind();
    method equality (line 98) | @Test
    method getCorrectType (line 116) | @Test
    method getWrongType (line 123) | @Test
    method string (line 135) | @Test
    method getKind (line 142) | @Test
    method cannotBeNull (line 155) | @Test
    class IntegerOrString (line 166) | @AutoOneOf(IntegerOrString.Kind.class)
      type Kind (line 168) | enum Kind {
      method getKind (line 173) | abstract Kind getKind();
      method integer (line 175) | abstract int integer();
      method string (line 177) | abstract String string();
      method of (line 179) | static IntegerOrString of(int x) {
      method of (line 183) | static IntegerOrString of(String x) {
    method packagePrivate (line 188) | @Test
    class PetWithGet (line 205) | @AutoOneOf(Pet.Kind.class)
      method getDog (line 207) | public abstract Dog getDog();
      method getCat (line 209) | public abstract Cat getCat();
      method getTigerShark (line 211) | public abstract TigerShark getTigerShark();
      method create (line 213) | public static PetWithGet create(Dog dog) {
      method create (line 217) | public static PetWithGet create(Cat cat) {
      method create (line 221) | public static PetWithGet create(TigerShark shark) {
      method getKind (line 225) | public abstract Pet.Kind getKind();
    method getPrefix (line 228) | @Test
    class Primitive (line 235) | @AutoOneOf(Primitive.Kind.class)
      type Kind (line 237) | public enum Kind {
      method getKind (line 248) | public abstract Kind getKind();
      method aByte (line 250) | public abstract byte aByte();
      method aShort (line 252) | public abstract short aShort();
      method anInt (line 254) | public abstract int anInt();
      method aLong (line 256) | public abstract long aLong();
      method aFloat (line 258) | public abstract float aFloat();
      method aDouble (line 260) | public abstract double aDouble();
      method aChar (line 262) | public abstract char aChar();
      method aBoolean (line 264) | public abstract boolean aBoolean();
      method of (line 266) | public static Primitive of(byte x) {
      method of (line 270) | public static Primitive of(short x) {
      method of (line 274) | public static Primitive of(int x) {
      method of (line 278) | public static Primitive of(long x) {
      method of (line 282) | public static Primitive of(float x) {
      method of (line 286) | public static Primitive of(double x) {
      method of (line 290) | public static Primitive of(char x) {
      method of (line 294) | public static Primitive of(boolean x) {
    method primitive (line 299) | @Test
    class OneOfOne (line 306) | @AutoOneOf(OneOfOne.Kind.class)
      type Kind (line 308) | public enum Kind {
      method getDog (line 312) | public abstract Dog getDog();
      method create (line 314) | public static OneOfOne create(Dog dog) {
      method getKind (line 318) | public abstract Kind getKind();
    method oneOfOne (line 321) | @Test
    class OneOfNone (line 332) | @AutoOneOf(OneOfNone.Kind.class)
      type Kind (line 334) | public enum Kind {}
      method getKind (line 336) | public abstract Kind getKind();
    class TaskResult (line 342) | @AutoOneOf(TaskResult.Kind.class)
      type Kind (line 344) | public enum Kind {
      method getKind (line 349) | public abstract Kind getKind();
      method value (line 351) | public abstract V value();
      method exception (line 353) | public abstract Throwable exception();
      method get (line 355) | public V get() throws ExecutionException {
      method value (line 365) | static <V extends Serializable> TaskResult<V> value(V value) {
      method exception (line 369) | static TaskResult<?> exception(Throwable exception) {
    method taskResultValue (line 374) | @Test
    method taskResultException (line 380) | @Test
    class CustomToString (line 392) | @AutoOneOf(CustomToString.Kind.class)
      type Kind (line 394) | public enum Kind {
      method getKind (line 398) | public abstract Kind getKind();
      method ace (line 400) | public abstract String ace();
      method ace (line 402) | public static CustomToString ace(String ace) {
      method toString (line 406) | @Override
    method customToString (line 413) | @Test
    class AbstractToString (line 419) | @AutoOneOf(AbstractToString.Kind.class)
      type Kind (line 421) | public enum Kind {
      method getKind (line 425) | public abstract Kind getKind();
      method ace (line 427) | public abstract String ace();
      method ace (line 429) | public static AbstractToString ace(String ace) {
      method toString (line 433) | @Override
    method abstractToString (line 438) | @Test
    class LetterOrPackage (line 448) | @AutoOneOf(LetterOrPackage.Kind.class)
      type Kind (line 450) | public enum Kind {
      method getKind (line 455) | public abstract Kind getKind();
      method getLetter (line 457) | public abstract String getLetter();
      method getPackage (line 459) | public abstract String getPackage();
      method ofLetter (line 461) | public static LetterOrPackage ofLetter(String letter) {
      method ofPackage (line 465) | public static LetterOrPackage ofPackage(String pkg) {
    method reservedWordProperty (line 470) | @Test
    class ArrayValue (line 476) | @AutoOneOf(ArrayValue.Kind.class)
      type Kind (line 478) | public enum Kind {
      method getKind (line 483) | public abstract Kind getKind();
      method string (line 485) | public abstract String string();
      method ints (line 487) | @SuppressWarnings("mutable")
      method ofString (line 490) | public static ArrayValue ofString(String string) {
      method ofInts (line 494) | public static ArrayValue ofInts(int[] ints) {
    method arrayValues (line 499) | @Test
    class AnnotationNotCopied (line 512) | @AutoOneOf(AnnotationNotCopied.Kind.class)
      type Kind (line 515) | public enum Kind {
      method getKind (line 519) | public abstract Kind getKind();
      method ace (line 521) | public abstract String ace();
      method ace (line 523) | public static AnnotationNotCopied ace(String ace) {
    method classAnnotationsNotCopiedByDefault (line 528) | @Test
    class AnnotationCopied (line 535) | @AutoOneOf(AnnotationCopied.Kind.class)
      type Kind (line 539) | public enum Kind {
      method getKind (line 543) | public abstract Kind getKind();
      method ace (line 545) | public abstract String ace();
      method ace (line 547) | public static AnnotationCopied ace(String ace) {
    method classAnnotationsCopiedIfCopyAnnotations (line 552) | @Test
    class MaybeEmpty (line 560) | @AutoOneOf(MaybeEmpty.Kind.class)
      type Kind (line 564) | public enum Kind {
      method getKind (line 569) | public abstract Kind getKind();
      method empty (line 571) | public abstract void empty();
      method string (line 573) | public abstract String string();
      method ofEmpty (line 575) | public static MaybeEmpty ofEmpty() {
      method ofString (line 579) | public static MaybeEmpty ofString(String s) {
    method voidPropertyIsSingleton (line 584) | @Test
    method voidPropertyRemainsSingletonWhenDeserialized (line 591) | @Test
    method voidPropertyToString (line 605) | @Test
    method voidPropertyHashCodeIsIdentity (line 611) | @Test
    method voidPropertyGetterDoesNothing (line 617) | @Test
    method voidPropertyNotEqualToNonVoid (line 623) | @Test
    method voidPropertyWrongType (line 631) | @Test
    class OneOfArray (line 642) | @AutoOneOf(OneOfArray.Kind.class)
      type Kind (line 644) | public enum Kind {
      method getKind (line 648) | public abstract Kind getKind();
      method ints (line 650) | @SuppressWarnings("mutable")
      method ofInts (line 653) | public static OneOfArray ofInts(int[] s) {
    method arrayToString (line 658) | @Test
    class OneOfFunkyString (line 664) | @AutoOneOf(OneOfFunkyString.Kind.class)
      type Kind (line 666) | public enum Kind {
      class String (line 670) | public static class String {}
      method getKind (line 672) | public abstract Kind getKind();
      method funkyString (line 674) | public abstract String funkyString();
      method ofFunkyString (line 676) | public static OneOfFunkyString ofFunkyString(String s) {
    method funkyString (line 681) | @Test

FILE: value/src/it/functional/src/test/java/com/google/auto/value/AutoValueJava8Test.java
  class AutoValueJava8Test (line 78) | @RunWith(JUnit4.class)
    method setUpClass (line 92) | @BeforeClass
    class BugTestProcessor (line 120) | @SupportedAnnotationTypes("*")
      method getSupportedSourceVersion (line 123) | @Override
      method process (line 128) | @Override
      method test (line 136) | private void test() {
    class NullableProperties (line 155) | @AutoValue
      method nullableString (line 157) | abstract @Nullable String nullableString();
      method randomInt (line 159) | abstract int randomInt();
      method create (line 161) | static NullableProperties create(@Nullable String nullableString, in...
    method testNullablePropertiesCanBeNull (line 166) | @Test
    method testEqualsParameterIsAnnotated (line 175) | @Test
    method nullable (line 194) | @AutoAnnotation
    method nullables (line 203) | static ImmutableSet<Annotation> nullables(Class<?> autoValueImplClass) {
    method testNullablePropertyImplementationIsNullable (line 219) | @Test
    method testNullablePropertyConstructorParameterIsNullable (line 226) | @Test
    class NullablePropertiesNotCopied (line 242) | @AutoValue
      method nullableString (line 244) | @AutoValue.CopyAnnotations(exclude = Nullable.class)
      method randomInt (line 247) | abstract int randomInt();
      method create (line 249) | NullablePropertiesNotCopied create(String notNullableAfterAll, int r...
    method testExcludedNullablePropertyImplementation (line 255) | @Test
    method testExcludedNullablePropertyConstructorParameter (line 265) | @Test
    class NullableNonNullable (line 281) | @AutoValue
      method nullableString (line 283) | abstract @Nullable String nullableString();
      method otherNullableString (line 285) | abstract @Nullable String otherNullableString();
      method nonNullableString (line 287) | abstract String nonNullableString();
      method create (line 289) | static NullableNonNullable create(
    method testEqualsWithNullable (line 296) | @Test
    type GenericGrandparent (line 313) | interface GenericGrandparent<T> {
      method thing (line 314) | T thing();
    type GenericParent (line 317) | interface GenericParent<T> extends GenericGrandparent<T> {
      method thing (line 318) | @Override
    class StringThing (line 323) | @AutoValue
    class StringThingWithBuilder (line 326) | @AutoValue
      method builder (line 328) | static Builder builder() {
      type Builder (line 332) | @AutoValue.Builder
        method setThing (line 334) | Builder setThing(String thing);
        method thing (line 336) | @Nullable
        method build (line 339) | StringThingWithBuilder build();
    method testInheritedGetterRemainsNullable (line 343) | @Test
    method testInheritedBuilderGetterRemainsNullable (line 351) | @Test
    type GenericListParent (line 358) | interface GenericListParent<T> {
      method things (line 359) | List<@Nullable T> things();
    class StringList (line 362) | @AutoValue
    method testInheritedListGetterRemainsNullable (line 369) | @Test
    class Nested (line 381) | public static class Nested {}
    method otherTypeAnnotation (line 387) | @AutoAnnotation
    class NestedNullableProperties (line 392) | @AutoValue
      method nullableThing (line 394) | abstract @Nullable @OtherTypeAnnotation Nested nullableThing();
      method randomInt (line 396) | abstract int randomInt();
      method builder (line 398) | static Builder builder() {
      class Builder (line 402) | @AutoValue.Builder
        method setNullableThing (line 404) | abstract Builder setNullableThing(@Nullable @OtherTypeAnnotation N...
        method setRandomInt (line 406) | abstract Builder setRandomInt(int x);
        method build (line 408) | abstract NestedNullableProperties build();
    method testNestedNullablePropertiesCanBeNull (line 412) | @Test
    method testNestedNullablePropertiesAreCopied (line 421) | @Test
    class PrimitiveArrays (line 443) | @AutoValue
      method booleans (line 446) | @SuppressWarnings("mutable")
      method ints (line 449) | @SuppressWarnings("mutable")
      method create (line 452) | static PrimitiveArrays create(boolean[] booleans, int[] ints) {
    method testPrimitiveArrays (line 459) | @Test
    method testNullablePrimitiveArrays (line 482) | @Test
    method testNotNullablePrimitiveArrays (line 501) | @Test
    class NullablePropertyWithBuilder (line 508) | @AutoValue
      method notNullable (line 510) | public abstract String notNullable();
      method nullable (line 512) | public abstract @Nullable String nullable();
      method builder (line 514) | public static Builder builder() {
      type Builder (line 518) | @AutoValue.Builder
        method notNullable (line 520) | Builder notNullable(String s);
        method nullable (line 522) | Builder nullable(@Nullable String s);
        method nullable (line 524) | Optional<String> nullable();
        method build (line 526) | NullablePropertyWithBuilder build();
    method testOmitNullableWithBuilder (line 530) | @Test
    class OptionalPropertyWithNullableBuilder (line 557) | @AutoValue
      method notOptional (line 559) | public abstract String notOptional();
      method optional (line 561) | public abstract Optional<String> optional();
      method builder (line 563) | public static Builder builder() {
      type Builder (line 567) | @AutoValue.Builder
        method notOptional (line 569) | Builder notOptional(String s);
        method optional (line 571) | Builder optional(@Nullable String s);
        method build (line 573) | OptionalPropertyWithNullableBuilder build();
    method testOmitOptionalWithNullableBuilder (line 577) | @Test
    class NullableOptionalPropertyWithNullableBuilder (line 602) | @AutoValue
      method optional (line 604) | public abstract @Nullable Optional<String> optional();
      method builder (line 606) | public static Builder builder() {
      type Builder (line 610) | @AutoValue.Builder
        method optional (line 612) | Builder optional(@Nullable String s);
        method optional (line 614) | Optional<String> optional();
        method build (line 616) | NullableOptionalPropertyWithNullableBuilder build();
    method testNullableOptional (line 620) | @Test
    class BuilderWithUnprefixedGetters (line 639) | @AutoValue
      method list (line 642) | public abstract ImmutableList<T> list();
      method t (line 644) | public abstract @Nullable T t();
      method ints (line 646) | @SuppressWarnings("mutable")
      method noGetter (line 649) | public abstract int noGetter();
      method builder (line 651) | public static <T extends Comparable<T>> Builder<T> builder() {
      type Builder (line 655) | @AutoValue.Builder
        method setList (line 657) | Builder<T> setList(ImmutableList<T> list);
        method setT (line 659) | Builder<T> setT(T t);
        method setInts (line 661) | Builder<T> setInts(int[] ints);
        method setNoGetter (line 663) | Builder<T> setNoGetter(int x);
        method list (line 665) | ImmutableList<T> list();
        method t (line 667) | T t();
        method ints (line 669) | int[] ints();
        method build (line 671) | BuilderWithUnprefixedGetters<T> build();
    class NoNullableRef (line 675) | @AutoValue
      method foo (line 677) | abstract String foo();
      method of (line 679) | static NoNullableRef of(String foo) {
    method testDefaultToJSpecifyNullable (line 688) | @Test
    method testBuilderWithUnprefixedGetter (line 705) | @Test
    class BuilderWithPrefixedGetters (line 735) | @AutoValue
      method getList (line 738) | public abstract ImmutableList<T> getList();
      method getT (line 740) | public abstract @Nullable T getT();
      method getInts (line 742) | @SuppressWarnings("mutable")
      method getNoGetter (line 745) | public abstract int getNoGetter();
      method builder (line 747) | public static <T extends Comparable<T>> Builder<T> builder() {
      class Builder (line 751) | @AutoValue.Builder
        method setList (line 753) | public abstract Builder<T> setList(ImmutableList<T> list);
        method setT (line 755) | public abstract Builder<T> setT(@Nullable T t);
        method setInts (line 757) | public abstract Builder<T> setInts(int[] ints);
        method setNoGetter (line 759) | public abstract Builder<T> setNoGetter(int x);
        method getList (line 761) | abstract ImmutableList<T> getList();
        method getT (line 763) | abstract T getT();
        method getInts (line 765) | abstract int[] getInts();
        method build (line 767) | public abstract BuilderWithPrefixedGetters<T> build();
    method testBuilderWithPrefixedGetter (line 771) | @Test
    class FunkyNullable (line 797) | @AutoValue
      method foo (line 802) | abstract @Nullable String foo();
      method bar (line 804) | abstract Optional<String> bar();
      method builder (line 806) | static Builder builder() {
      type Builder (line 810) | @AutoValue.Builder
        method setFoo (line 812) | Builder setFoo(@Nullable String foo);
        method setBar (line 814) | Builder setBar(@Nullable String bar);
        method build (line 816) | FunkyNullable build();
    method testFunkyNullable (line 820) | @Test
    class EqualsNullable (line 827) | @AutoValue
      method foo (line 833) | abstract String foo();
      method create (line 835) | static EqualsNullable create(String foo) {
      method equals (line 839) | @Override
      method hashCode (line 842) | @Override
    method testEqualsNullable (line 850) | @Test
    class AnnotatedTypeParameter (line 859) | @AutoValue
      method thing (line 861) | abstract @Nullable T thing();
      method create (line 863) | static <@Nullable T> AnnotatedTypeParameter<T> create(T thing) {
    method testTypeAnnotationCopiedToImplementation (line 872) | @Test
    class AnnotatedTypeParameterWithBuilder (line 885) | @AutoValue
      method thing (line 887) | abstract @Nullable T thing();
      method builder (line 889) | static <@Nullable T> Builder<T> builder() {
      class Builder (line 893) | @AutoValue.Builder
        method setThing (line 895) | abstract Builder<T> setThing(T thing);
        method build (line 897) | abstract AnnotatedTypeParameterWithBuilder<T> build();
    method testTypeAnnotationOnBuilderCopiedToImplementation (line 905) | @Test
    class OptionalOptional (line 919) | @AutoValue
      method maybeJustMaybe (line 921) | abstract Optional<Optional<String>> maybeJustMaybe();
      method builder (line 923) | static Builder builder() {
      class Builder (line 927) | @AutoValue.Builder
        method maybeJustMaybe (line 929) | abstract Builder maybeJustMaybe(Optional<String> maybe);
        method build (line 931) | abstract OptionalOptional build();
    method testOptionalOptional_empty (line 935) | @Test
    method testOptionalOptional_ofEmpty (line 941) | @Test
    method testOptionalOptional_ofSomething (line 947) | @Test
    class OptionalExtends (line 954) | @AutoValue
      method predicate (line 956) | abstract Optional<? extends Predicate<? super Integer>> predicate();
      method builder (line 958) | static Builder builder() {
      class Builder (line 962) | @AutoValue.Builder
        method setPredicate (line 964) | abstract Builder setPredicate(Predicate<? super Integer> predicate);
        method build (line 966) | abstract OptionalExtends build();
    method testOptionalExtends (line 970) | @Test
    class Foo (line 977) | @AutoValue
      method bar (line 979) | public abstract Bar bar();
      method baz (line 981) | public abstract double baz();
      method builder (line 983) | public static Foo.Builder builder() {
      class Builder (line 987) | @AutoValue.Builder
        method bar (line 990) | abstract Optional<Bar> bar();
        method bar (line 992) | public abstract Builder bar(Bar bar);
        method barBuilder (line 995) | public abstract Bar.Builder barBuilder();
        method baz (line 997) | abstract OptionalDouble baz();
        method baz (line 999) | public abstract Builder baz(double baz);
        method autoBuild (line 1001) | abstract Foo autoBuild();
        method build (line 1003) | public Foo build() {
    class Bar (line 1015) | @AutoValue
      method toBuilder (line 1017) | public abstract Bar.Builder toBuilder();
      method builder (line 1019) | public static Bar.Builder builder() {
      class Builder (line 1023) | @AutoValue.Builder
        method build (line 1025) | public abstract Bar build();
    method nestedOptionalGetter (line 1029) | @Test
    class PropertyBuilderWildcard (line 1042) | @AutoValue
      method list (line 1044) | public abstract List<? extends T> list();
      method builder (line 1046) | public static <T> PropertyBuilderWildcard.Builder<T> builder() {
      type Builder (line 1050) | @AutoValue.Builder
        method listBuilder (line 1052) | ListBuilder<T> listBuilder();
        method build (line 1054) | PropertyBuilderWildcard<T> build();
      class ListBuilder (line 1057) | public static class ListBuilder<T> {
        method add (line 1060) | public void add(T value) {
        method build (line 1064) | public List<T> build() {
    method propertyBuilderWildcard (line 1070) | @Test
    class NullableBound (line 1077) | @AutoValue
      method maybeNullable (line 1079) | public abstract T maybeNullable();
      method create (line 1081) | public static <T extends @Nullable Object> NullableBound<T> create(T...
    method propertyCanBeNullIfNullableBound (line 1086) | @Test
    class NullableIntersectionBound (line 1096) | @AutoValue
      method maybeNullable (line 1099) | public abstract T maybeNullable();
      method create (line 1101) | public static <T extends @Nullable Object & @Nullable Serializable>
    method propertyCanBeNullIfNullableIntersectionBound (line 1107) | @Test
    class PartlyNullableIntersectionBound (line 1117) | @AutoValue
      method notNullable (line 1120) | public abstract T notNullable();
      method create (line 1122) | public static <T extends @Nullable Object & Serializable>
    method propertyCannotBeNullWithPartlyNullableIntersectionBound (line 1128) | @Test
    class NullableVariableBound (line 1134) | @AutoValue
      method nullOne (line 1136) | public abstract T nullOne();
      method nullTwo (line 1138) | public abstract U nullTwo();
      method create (line 1140) | public static <T extends @Nullable Object, U extends T> NullableVari...
    method nullableVariableBound (line 1146) | @Test
    class NotNullableVariableBound (line 1155) | @AutoValue
      method t (line 1157) | public abstract T t();
      method nullableT (line 1159) | public abstract @Nullable T nullableT();
      method string (line 1161) | public abstract String string();
      method builder (line 1163) | public static <T> Builder<T> builder() {
      class Builder (line 1167) | @AutoValue.Builder
        method setT (line 1169) | public abstract Builder<T> setT(T t);
        method setNullableT (line 1171) | public abstract Builder<T> setNullableT(@Nullable T nullableT);
        method setString (line 1173) | public abstract Builder<T> setString(String string);
        method build (line 1175) | public abstract NotNullableVariableBound<T> build();
    method typeParameterBuilderFieldsAreNullable (line 1179) | @Test

FILE: value/src/it/functional/src/test/java/com/google/auto/value/AutoValueNotEclipseTest.java
  class AutoValueNotEclipseTest (line 31) | @RunWith(JUnit4.class)
    type AbstractOptional (line 38) | interface AbstractOptional<T> {
      method optional (line 39) | Optional<T> optional();
      type Builder (line 41) | interface Builder<T, B extends Builder<T, B>> {
        method setOptional (line 42) | B setOptional(@Nullable T t);
    class ConcreteOptional (line 46) | @AutoValue
      method builder (line 48) | static Builder builder() {
      type Builder (line 52) | @AutoValue.Builder
        method build (line 54) | ConcreteOptional build();
    method genericOptionalOfNullable (line 58) | @Test

FILE: value/src/it/functional/src/test/java/com/google/auto/value/AutoValueTest.java
  class AutoValueTest (line 77) | @RunWith(JUnit4.class)
    method initOmitIdentifiers (line 87) | @BeforeClass
    class Simple (line 92) | @AutoValue
      method publicString (line 94) | public abstract String publicString();
      method protectedInt (line 96) | protected abstract int protectedInt();
      method packageMap (line 98) | abstract Map<String, Long> packageMap();
      method create (line 100) | public static Simple create(String s, int i, Map<String, Long> m) {
    method testSimple (line 105) | @Test
    class Empty (line 126) | @AutoValue
      method create (line 128) | public static Empty create() {
    method testEmpty (line 133) | @Test
    class SimpleWithGetters (line 142) | @AutoValue
      method getFoo (line 144) | abstract int getFoo();
      method isBar (line 146) | abstract boolean isBar();
      method getOtherBar (line 148) | abstract boolean getOtherBar();
      method getPackage (line 150) | abstract String getPackage();
      method getPackage0 (line 152) | abstract String getPackage0();
      method getHTMLPage (line 154) | abstract String getHTMLPage();
      method create (line 156) | static SimpleWithGetters create(
    method testGetters (line 162) | @Test
    class NotAllGetters (line 173) | @AutoValue
      method getFoo (line 175) | abstract int getFoo();
      method bar (line 177) | abstract boolean bar();
      method create (line 179) | static NotAllGetters create(int foo, boolean bar) {
    method testNotGetters (line 184) | @Test
    class StrangeGetters (line 191) | @AutoValue
      method get1st (line 193) | abstract int get1st();
      method get_1st (line 195) | abstract int get_1st();
      class Builder (line 197) | @AutoValue.Builder
        method set1st (line 199) | abstract Builder set1st(int x);
        method set_1st (line 201) | abstract Builder set_1st(int x);
        method build (line 203) | abstract StrangeGetters build();
      method builder (line 206) | static Builder builder() {
    method testStrangeGetters (line 211) | @Test
    class GettersAndConcreteNonGetters (line 218) | @AutoValue
      method getFoo (line 220) | abstract int getFoo();
      method getBytes (line 222) | @SuppressWarnings("mutable")
      method hasNoBytes (line 225) | boolean hasNoBytes() {
      method create (line 229) | static GettersAndConcreteNonGetters create(int foo, byte[] bytes) {
    method testGettersAndConcreteNonGetters (line 234) | @Test
    class ClassProperty (line 243) | @AutoValue
      method theClass (line 245) | abstract Class<?> theClass();
      method create (line 247) | static ClassProperty create(Class<?> theClass) {
    method testClassProperty (line 252) | @Test
    class ClassPropertyWithBuilder (line 264) | @AutoValue
      method numberClass (line 266) | abstract Class<? extends Number> numberClass();
      method builder (line 268) | static Builder builder() {
      class Builder (line 272) | @AutoValue.Builder
        method setNumberClass (line 274) | abstract Builder setNumberClass(Class<? extends Number> x);
        method build (line 276) | abstract ClassPropertyWithBuilder build();
    method testClassPropertyWithBuilder (line 280) | @Test
    class Serialize (line 299) | @AutoValue
      method integer (line 303) | public abstract int integer();
      method string (line 305) | public abstract String string();
      method bigInteger (line 307) | public abstract BigInteger bigInteger();
      method create (line 309) | public static Serialize create(int integer, String string, BigIntege...
    method testSerialize (line 314) | @Test
    class SerializeWithVersionUID (line 320) | @AutoValue
      method integer (line 324) | public abstract int integer();
      method string (line 326) | public abstract String string();
      method create (line 328) | public static SerializeWithVersionUID create(int integer, String str...
    method testSerializeWithVersionUID (line 333) | @Test
    class LongProperty (line 344) | @AutoValue
      method longProperty (line 346) | public abstract long longProperty();
      method create (line 348) | public static LongProperty create(long longProperty) {
    method testLongHashCode (line 353) | @Test
    class IntProperty (line 360) | @AutoValue
      method intProperty (line 362) | public abstract int intProperty();
      method create (line 364) | public static IntProperty create(int intProperty) {
    method testIntHashCode (line 369) | @Test
    class ShortProperty (line 376) | @AutoValue
      method shortProperty (line 378) | public abstract short shortProperty();
      method create (line 380) | public static ShortProperty create(short shortProperty) {
    method testShortHashCode (line 385) | @Test
    class ByteProperty (line 392) | @AutoValue
      method byteProperty (line 394) | public abstract byte byteProperty();
      method create (line 396) | public static ByteProperty create(byte byteProperty) {
    method testByteHashCode (line 401) | @Test
    class CharProperty (line 408) | @AutoValue
      method charProperty (line 410) | public abstract char charProperty();
      method create (line 412) | public static CharProperty create(char charProperty) {
    method testCharHashCode (line 417) | @Test
    class BooleanProperty (line 424) | @AutoValue
      method booleanProperty (line 426) | public abstract boolean booleanProperty();
      method create (line 428) | public static BooleanProperty create(boolean booleanProperty) {
    method testBooleanHashCode (line 433) | @Test
    class FloatProperty (line 441) | @AutoValue
      method floatProperty (line 443) | public abstract float floatProperty();
      method create (line 445) | public static FloatProperty create(float floatProperty) {
    method testFloatHashCode (line 450) | @Test
    class DoubleProperty (line 457) | @AutoValue
      method doubleProperty (line 459) | public abstract double doubleProperty();
      method create (line 461) | public static DoubleProperty create(double doubleProperty) {
    method testDoubleHashCode (line 466) | @Test
    method testFloatingEquality (line 473) | @Test
    method singlePropertyHash (line 491) | private static int singlePropertyHash(Object property) {
    class Super (line 495) | abstract static class Super {
      method superObject (line 496) | public abstract Object superObject();
      method superBoolean (line 498) | public abstract boolean superBoolean();
    class Sub (line 502) | @AutoValue
      method subInt (line 504) | public abstract int subInt();
      method create (line 506) | public static Sub create(Object superObject, boolean superBoolean, i...
    method testSuperclass (line 512) | @Test
    class NonPublicSuper (line 522) | abstract static class NonPublicSuper {
      method superObject (line 523) | abstract Object superObject();
    class NonPublicSub (line 529) | @AutoValue
      method subString (line 531) | abstract String subString();
      method subInt (line 533) | abstract int subInt();
      method create (line 535) | static NonPublicSub create(Object superObject, String subString, int...
    method testNonPublicInheritedGetters (line 540) | @Test
    method assertEqualsNullIsFalse (line 550) | @SuppressWarnings("ObjectEqualsNull")
    class NullableProperties (line 555) | @AutoValue
      method nullableString (line 557) | @Nullable
      method randomInt (line 560) | abstract int randomInt();
      method create (line 562) | static NullableProperties create(@Nullable String nullableString, in...
    method testNullablePropertiesCanBeNull (line 567) | @Test
    method nullable (line 577) | @AutoAnnotation
    method testNullablePropertyConstructorParameterIsNullable (line 582) | @Test
    class AlternativeNullableProperties (line 590) | @AutoValue
      method nullableString (line 594) | @AlternativeNullableProperties.Nullable
      method randomInt (line 597) | abstract int randomInt();
      method create (line 599) | static AlternativeNullableProperties create(@Nullable String nullabl...
    method testNullableCanBeFromElsewhere (line 604) | @Test
    class NonNullableProperties (line 616) | @AutoValue
      method nonNullableString (line 618) | abstract String nonNullableString();
      method randomInt (line 620) | abstract int randomInt();
      method create (line 622) | static NonNullableProperties create(String nonNullableString, int ra...
    method testNonNullablePropertiesCannotBeNull (line 627) | @Test
    class NullableListProperties (line 639) | @AutoValue
      method nullableStringList (line 641) | @Nullable
      method create (line 644) | static NullableListProperties create(@Nullable ImmutableList<String>...
    method testNullableListPropertiesCanBeNonNull (line 649) | @Test
    method testNullableListPropertiesCanBeNull (line 655) | @Test
    class NullableListPropertiesWithBuilder (line 661) | @AutoValue
      method nullableStringList (line 663) | @Nullable
      method builder (line 666) | static Builder builder() {
      type Builder (line 670) | @AutoValue.Builder
        method nullableStringList (line 672) | Builder nullableStringList(List<String> nullableStringList);
        method build (line 674) | NullableListPropertiesWithBuilder build();
    method testNullableListPropertiesWithBuilderCanBeNonNull (line 678) | @Test
    method testNullableListPropertiesWithBuilderCanBeUnset (line 687) | @Test
    method testNullableListPropertiesWithBuilderCanBeNull (line 694) | @Test
    class Nested (line 701) | static class Nested {
      class Doubly (line 702) | @AutoValue
        method nullableString (line 704) | @Nullable
        method randomInt (line 707) | abstract int randomInt();
        method create (line 709) | static Doubly create(String nullableString, int randomInt) {
    method testDoublyNestedClass (line 715) | @Test
    type NestedInInterface (line 725) | static interface NestedInInterface {
      class Doubly (line 726) | @AutoValue
        method string (line 728) | abstract String string();
        method map (line 730) | abstract Map<String, Integer> map();
        method create (line 732) | static Doubly create(String string, Map<String, Integer> map) {
    method testClassNestedInInterface (line 738) | @Test
    class NullableNonNullable (line 746) | @AutoValue
      method nullableString (line 748) | @Nullable
      method otherNullableString (line 751) | @Nullable
      method nonNullableString (line 754) | abstract String nonNullableString();
      method create (line 756) | static NullableNonNullable create(
    method testEqualsWithNullable (line 763) | @Test
    class GenericProperties (line 780) | @AutoValue
      method simpleMap (line 782) | abstract Map<String, Integer> simpleMap();
      method hairyMap (line 784) | abstract Map<String, Map<String, Integer>> hairyMap();
      method create (line 786) | static GenericProperties create(
    method testGenericProperties (line 792) | @Test
    class GenericClass (line 808) | @AutoValue
      method key (line 810) | abstract K key();
      method map (line 812) | abstract Map<K, V> map();
      method create (line 814) | static <K, V> GenericClass<K, V> create(K key, Map<K, V> map) {
    method testGenericClass (line 819) | @Test
    class GenericClassSimpleBounds (line 828) | @AutoValue
      method key (line 830) | abstract K key();
      method map (line 832) | abstract Map<K, V> map();
      method create (line 834) | static <K extends Number, V extends K> GenericClassSimpleBounds<K, V...
    method testGenericClassWithSimpleBounds (line 840) | @Test
    class GenericClassHairyBounds (line 849) | @AutoValue
      method key (line 851) | abstract K key();
      method map (line 853) | abstract Map<K, V> map();
      method create (line 855) | static <K extends List<V> & Comparable<K>, V> GenericClassHairyBound...
    method testGenericClassWithHairyBounds (line 861) | @Test
    type Mergeable (line 879) | interface Mergeable<M extends Mergeable<M>> {
      method merge (line 880) | M merge(M other);
    class Delta (line 883) | @AutoValue
      method meta (line 885) | abstract M meta();
      method create (line 887) | static <M extends Mergeable<M>> Delta<M> create(M meta) {
    method testRecursiveGeneric (line 892) | @Test
    class NodeType (line 905) | static class NodeType<O> {}
    class NodeExpressionClass (line 907) | abstract static class NodeExpressionClass<O> {
      method getType (line 908) | abstract NodeType<O> getType();
    class NotNodeExpression (line 911) | @AutoValue
      method create (line 913) | static NotNodeExpression create() {
    type NodeExpressionInterface (line 918) | interface NodeExpressionInterface<O> {
      method getType (line 919) | NodeType<O> getType();
    class NotNodeExpression2 (line 922) | @AutoValue
      method create (line 924) | static NotNodeExpression2 create() {
    method testConcreteWithGenericParent (line 929) | @Test
    class ExplicitToString (line 937) | @AutoValue
      method string (line 939) | abstract String string();
      method create (line 941) | static ExplicitToString create(String string) {
      method toString (line 945) | @Override
    method testExplicitToString (line 952) | @Test
    class NonAutoExplicitToString (line 958) | abstract static class NonAutoExplicitToString {
      method string (line 959) | abstract String string();
      method toString (line 961) | @Override
    class InheritedExplicitToString (line 967) | @AutoValue
      method create (line 969) | static InheritedExplicitToString create(String string) {
    method testInheritedExplicitToString (line 975) | @Test
    class AbstractToString (line 981) | @AutoValue
      method string (line 983) | abstract String string();
      method create (line 985) | static AbstractToString create(String string) {
      method toString (line 989) | @Override
    method testAbstractToString (line 995) | @Test
    class NonAutoAbstractToString (line 1002) | abstract static class NonAutoAbstractToString {
      method string (line 1003) | abstract String string();
      method toString (line 1005) | @Override
    class SubAbstractToString (line 1009) | @AutoValue
      method create (line 1011) | static SubAbstractToString create(String string) {
    method testInheritedAbstractToString (line 1017) | @Test
    class ExplicitHashCode (line 1024) | @AutoValue
      method string (line 1026) | abstract String string();
      method create (line 1028) | static ExplicitHashCode create(String string) {
      method hashCode (line 1032) | @Override
    method testExplicitHashCode (line 1038) | @Test
    class ExplicitEquals (line 1044) | @AutoValue
      method create (line 1049) | static ExplicitEquals create() {
      method equals (line 1053) | @Override
    method testExplicitEquals (line 1060) | @SuppressWarnings("SelfEquals")
    method myAnnotation (line 1077) | @AutoAnnotation
    class PrimitiveArrays (line 1082) | @AutoValue
      method booleans (line 1084) | @SuppressWarnings("mutable")
      method ints (line 1087) | @SuppressWarnings("mutable")
      method create (line 1091) | static PrimitiveArrays create(boolean[] booleans, int[] ints) {
    method testPrimitiveArrays (line 1098) | @Test
    method testNullablePrimitiveArrays (line 1122) | @Test
    method testNotNullablePrimitiveArrays (line 1142) | @Test
    class AmbiguousArrays (line 1159) | @AutoValue
      class Arrays (line 1161) | static class Arrays {}
      method arrays (line 1163) | abstract Arrays arrays();
      method ints (line 1165) | @SuppressWarnings("mutable")
      method create (line 1168) | static AmbiguousArrays create(Arrays arrays, int[] ints) {
    method testAmbiguousArrays (line 1173) | @Test
    class HashCodeObserver (line 1181) | static final class HashCodeObserver {
      method equals (line 1184) | @Override
      method hashCode (line 1189) | @Override
    class MaybeCachedHashCode (line 1196) | @AutoValue
      method hashCodeObserver (line 1198) | abstract HashCodeObserver hashCodeObserver();
      method randomInt (line 1200) | abstract int randomInt();
      method create (line 1202) | static MaybeCachedHashCode create(HashCodeObserver hashCodeObserver,...
    method testHashCodeNotCached (line 1207) | @Test
    class Version (line 1217) | @AutoValue
      method major (line 1219) | abstract int major();
      method minor (line 1221) | abstract int minor();
      method create (line 1223) | static Version create(int major, int minor) {
      method compareTo (line 1227) | @Override
    method testComparisonChain (line 1236) | @Test
    class LukesBase (line 1249) | abstract static class LukesBase {
      type LukesVisitor (line 1250) | interface LukesVisitor<T> {
        method visit (line 1251) | T visit(LukesSub s);
      method accept (line 1254) | abstract <T> T accept(LukesVisitor<T> visitor);
      class LukesSub (line 1256) | @AutoValue
        method create (line 1258) | static LukesSub create() {
        method accept (line 1262) | @Override
    method testVisitor (line 1269) | @Test
    class ComplexInheritance (line 1282) | @AutoValue
      method create (line 1284) | public static ComplexInheritance create(String name) {
      method name (line 1288) | abstract String name();
    class AbstractBase (line 1291) | static class AbstractBase implements Base {
      method answer (line 1292) | @Override
    type IntfA (line 1298) | interface IntfA extends Base {}
    type IntfB (line 1300) | interface IntfB extends Base {}
    type Base (line 1302) | interface Base {
      method answer (line 1303) | int answer();
    method testComplexInheritance (line 1306) | @Test
    class MoreComplexInheritance (line 1319) | @AutoValue
      method get (line 1321) | @Override
      method size (line 1326) | @Override
      method create (line 1331) | public static MoreComplexInheritance create() {
    method testMoreComplexInheritance (line 1336) | @Test
    class PublicGrandparent (line 1346) | public abstract static class PublicGrandparent {
      method foo (line 1347) | public abstract String foo();
    class PrivateParent (line 1350) | private static class PrivateParent extends PublicGrandparent {
      method foo (line 1351) | @Override
    class EffectiveVisibility (line 1357) | @AutoValue
      method create (line 1359) | static EffectiveVisibility create() {
    method testEffectiveVisibility (line 1364) | @Test
    class InheritTwice (line 1372) | @AutoValue
      method create (line 1374) | public static InheritTwice create(int answer) {
    method testInheritTwice (line 1379) | @Test
    class Optional (line 1385) | @AutoValue
      method getOptional (line 1387) | public abstract com.google.common.base.Optional<Object> getOptional();
      method create (line 1389) | public static Optional create(com.google.common.base.Optional<Object...
    method testAmbiguityFromAutoValueType (line 1394) | @Test
    class BaseWithNestedType (line 1400) | static class BaseWithNestedType {
      class Optional (line 1401) | static class Optional {}
    class InheritsNestedType (line 1404) | @AutoValue
      method getOptional (line 1406) | public abstract com.google.common.base.Optional<Object> getOptional();
      method create (line 1408) | public static InheritsNestedType create(com.google.common.base.Optio...
    method testAmbiguityFromInheritedType (line 1413) | @Test
    class AbstractParent (line 1420) | abstract static class AbstractParent {
      method foo (line 1421) | abstract int foo();
    class RedeclareFloatAndDouble (line 1426) | @SuppressWarnings("JavaLangClash")
      method aFloat (line 1429) | public abstract float aFloat();
      method aDouble (line 1431) | public abstract double aDouble();
      method of (line 1433) | public static RedeclareFloatAndDouble of(float aFloat, double aDoubl...
      class Float (line 1437) | static class Float {}
      class Double (line 1439) | static class Double {}
    method testRedeclareFloatAndDouble (line 1442) | @SuppressWarnings("TruthSelfEquals")
    class AbstractChild (line 1449) | @AutoValue
      method foo (line 1453) | @Override
      method create (line 1456) | static AbstractChild create(int foo) {
    method testOverrideNotDuplicated (line 1461) | @Test
    class BasicWithBuilder (line 1467) | @AutoValue
      method foo (line 1469) | public abstract int foo();
      method builder (line 1471) | public static Builder builder() {
      type Builder (line 1475) | @AutoValue.Builder
        method foo (line 1477) | Builder foo(int foo);
        method build (line 1479) | BasicWithBuilder build();
    method testBasicWithBuilder (line 1483) | @Test
    method testBasicWithBuilderHasOnlyOneConstructor (line 1499) | @Test
    class EmptyWithBuilder (line 1508) | @AutoValue
      method builder (line 1510) | public static Builder builder() {
      type Builder (line 1514) | @AutoValue.Builder
        method build (line 1516) | EmptyWithBuilder build();
    method testEmptyWithBuilder (line 1520) | @Test
    class TwoPropertiesWithBuilderClass (line 1527) | @AutoValue
      method string (line 1529) | public abstract String string();
      method integer (line 1531) | public abstract int integer();
      method builder (line 1533) | public static Builder builder() {
      method builder (line 1537) | public static Builder builder(String string) {
      class Builder (line 1541) | @AutoValue.Builder
        method string (line 1543) | public abstract Builder string(String x);
        method integer (line 1545) | public abstract Builder integer(int x);
        method build (line 1547) | public abstract TwoPropertiesWithBuilderClass build();
    method testTwoPropertiesWithBuilderClass (line 1551) | @Test
    class NullablePropertyWithBuilder (line 1570) | @AutoValue
      method notNullable (line 1572) | public abstract String notNullable();
      method nullable (line 1574) | @Nullable
      method builder (line 1577) | public static Builder builder() {
      type Builder (line 1581) | @AutoValue.Builder
        method notNullable (line 1583) | Builder notNullable(String s);
        method nullable (line 1585) | Builder nullable(@Nullable String s);
        method build (line 1587) | NullablePropertyWithBuilder build();
    method testOmitNullableWithBuilder (line 1591) | @Test
    class PrimitiveAndBoxed (line 1621) | @AutoValue
      method anInt (line 1623) | public abstract int anInt();
      method aNullableInteger (line 1625) | @Nullable
      method aNonNullableInteger (line 1628) | @SuppressWarnings("AutoValueBoxedValues")
      method toBuilder (line 1631) | public abstract Builder toBuilder();
      method builder (line 1633) | public static Builder builder() {
      type Builder (line 1637) | @AutoValue.Builder
        method setAnInt (line 1639) | Builder setAnInt(int x);
        method setANullableInteger (line 1641) | Builder setANullableInteger(int x);
        method setANonNullableInteger (line 1643) | Builder setANonNullableInteger(int x);
        method build (line 1645) | PrimitiveAndBoxed build();
    method testPrimitiveAndBoxed (line 1649) | @Test
    class OptionalPropertiesWithBuilder (line 1661) | @AutoValue
      method optionalString (line 1663) | public abstract com.google.common.base.Optional<String> optionalStri.
Condensed preview — 377 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (2,597K chars).
[
  {
    "path": ".github/dependabot.yml",
    "chars": 1012,
    "preview": "version: 2\nupdates:\n  - package-ecosystem: \"maven\"\n    directory: \"/common\"\n    schedule:\n      interval: \"weekly\"\n    g"
  },
  {
    "path": ".github/workflows/ci.yml",
    "chars": 3407,
    "preview": "name: CI\n\non:\n  push:\n    branches:\n      - main\n  pull_request:\n    branches:\n      - main\n\njobs:\n  test:\n    name: \"JD"
  },
  {
    "path": ".gitignore",
    "chars": 189,
    "preview": ".classpath\n.factorypath\n.project\n.settings\neclipsebin\n\nbin\ngen\nbuild\nout\nlib\n\ntarget\n*.class\npom.xml.*\nrelease.propertie"
  },
  {
    "path": "CONTRIBUTING.md",
    "chars": 1677,
    "preview": "Contributing\n============\n\nIf you would like to contribute code to Auto you can do so through GitHub\nby forking the repo"
  },
  {
    "path": "LICENSE",
    "chars": 11358,
    "preview": "\n                                 Apache License\n                           Version 2.0, January 2004\n                  "
  },
  {
    "path": "README.md",
    "chars": 2619,
    "preview": "# Auto\n\n[![Build Status](https://github.com/google/auto/actions/workflows/ci.yml/badge.svg)](https://github.com/google/a"
  },
  {
    "path": "build-pom.xml",
    "chars": 812,
    "preview": "<!-- A pure convenience for local builds and travis-ci. -->\n<project>\n  <modelVersion>4.0.0</modelVersion>\n  <groupId>bu"
  },
  {
    "path": "common/README.md",
    "chars": 1265,
    "preview": "# Auto Common Utilities\n\n## Overview\n\nThe Auto project has a set of common utilities to help ease use of the\nannotation "
  },
  {
    "path": "common/pom.xml",
    "chars": 6310,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  Copyright 2014 Google LLC\n\n  Licensed under the Apache License, Version 2."
  },
  {
    "path": "common/src/main/java/com/google/auto/common/AnnotationMirrors.java",
    "chars": 8793,
    "preview": "/*\n * Copyright 2014 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "common/src/main/java/com/google/auto/common/AnnotationOutput.java",
    "chars": 8715,
    "preview": "/*\n * Copyright 2014 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "common/src/main/java/com/google/auto/common/AnnotationValues.java",
    "chars": 18477,
    "preview": "/*\n * Copyright 2014 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "common/src/main/java/com/google/auto/common/BasicAnnotationProcessor.java",
    "chars": 35863,
    "preview": "/*\n * Copyright 2014 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "common/src/main/java/com/google/auto/common/GeneratedAnnotationSpecs.java",
    "chars": 4390,
    "preview": "/*\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "common/src/main/java/com/google/auto/common/GeneratedAnnotations.java",
    "chars": 2464,
    "preview": "/*\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "common/src/main/java/com/google/auto/common/MoreElements.java",
    "chars": 24617,
    "preview": "/*\n * Copyright 2013 Google LLC\n * Copyright (C) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 "
  },
  {
    "path": "common/src/main/java/com/google/auto/common/MoreStreams.java",
    "chars": 3105,
    "preview": "/*\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "common/src/main/java/com/google/auto/common/MoreTypes.java",
    "chars": 39043,
    "preview": "/*\n * Copyright 2014 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "common/src/main/java/com/google/auto/common/Overrides.java",
    "chars": 22158,
    "preview": "/*\n * Copyright 2016 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "common/src/main/java/com/google/auto/common/SimpleAnnotationMirror.java",
    "chars": 5414,
    "preview": "/*\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "common/src/main/java/com/google/auto/common/SimpleTypeAnnotationValue.java",
    "chars": 2356,
    "preview": "/*\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "common/src/main/java/com/google/auto/common/SuperficialValidation.java",
    "chars": 11355,
    "preview": "/*\n * Copyright 2014 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "common/src/main/java/com/google/auto/common/Visibility.java",
    "chars": 3160,
    "preview": "/*\n * Copyright 2014 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "common/src/main/java/com/google/auto/common/package-info.java",
    "chars": 679,
    "preview": "/*\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "common/src/test/java/com/google/auto/common/AnnotationMirrorsTest.java",
    "chars": 16013,
    "preview": "/*\n * Copyright 2014 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "common/src/test/java/com/google/auto/common/AnnotationValuesTest.java",
    "chars": 14742,
    "preview": "/*\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "common/src/test/java/com/google/auto/common/BasicAnnotationProcessorTest.java",
    "chars": 37925,
    "preview": "/*\n * Copyright 2014 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "common/src/test/java/com/google/auto/common/GeneratedAnnotationsTest.java",
    "chars": 9136,
    "preview": "/*\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "common/src/test/java/com/google/auto/common/MoreElementsTest.java",
    "chars": 21165,
    "preview": "/*\n * Copyright 2014 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "common/src/test/java/com/google/auto/common/MoreTypesIsTypeOfTest.java",
    "chars": 7396,
    "preview": "/*\n * Copyright 2014 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "common/src/test/java/com/google/auto/common/MoreTypesTest.java",
    "chars": 23685,
    "preview": "/*\n * Copyright 2014 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "common/src/test/java/com/google/auto/common/OverridesTest.java",
    "chars": 24282,
    "preview": "/*\n * Copyright 2016 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "common/src/test/java/com/google/auto/common/SimpleAnnotationMirrorTest.java",
    "chars": 4502,
    "preview": "/*\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "common/src/test/java/com/google/auto/common/SimpleTypeAnnotationValueTest.java",
    "chars": 3231,
    "preview": "/*\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "common/src/test/java/com/google/auto/common/SuperficialValidationTest.java",
    "chars": 11047,
    "preview": "/*\n * Copyright 2014 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "common/src/test/java/com/google/auto/common/VisibilityTest.java",
    "chars": 6592,
    "preview": "/*\n * Copyright 2014 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/README.md",
    "chars": 4278,
    "preview": "AutoFactory\n======\n\nA source code generator for JSR-330-compatible factories.\n\nAutoWhat‽\n-------------\n\n[Java][java] is "
  },
  {
    "path": "factory/pom.xml",
    "chars": 9958,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  Copyright 2012 Google LLC\n  Copyright (C) 2012 Square, Inc.\n\n  Licensed un"
  },
  {
    "path": "factory/src/it/functional/pom.xml",
    "chars": 3568,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  Copyright 2013 Google LLC\n\n  Licensed under the Apache License, Version 2."
  },
  {
    "path": "factory/src/it/functional/src/main/java/com/google/auto/factory/DaggerModule.java",
    "chars": 1461,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/it/functional/src/main/java/com/google/auto/factory/Dependency.java",
    "chars": 655,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/it/functional/src/main/java/com/google/auto/factory/DependencyImpl.java",
    "chars": 739,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/it/functional/src/main/java/com/google/auto/factory/FactoryComponent.java",
    "chars": 1021,
    "preview": "/*\n * Copyright 2015 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/it/functional/src/main/java/com/google/auto/factory/FactoryInterface.java",
    "chars": 691,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/it/functional/src/main/java/com/google/auto/factory/Foo.java",
    "chars": 2064,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/it/functional/src/main/java/com/google/auto/factory/GenericFoo.java",
    "chars": 1762,
    "preview": "/*\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/it/functional/src/main/java/com/google/auto/factory/GuiceModule.java",
    "chars": 1058,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/it/functional/src/main/java/com/google/auto/factory/QualifiedDependencyImpl.java",
    "chars": 757,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/it/functional/src/main/java/com/google/auto/factory/Qualifier.java",
    "chars": 793,
    "preview": "/*\n * Copyright 2015 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/it/functional/src/main/java/com/google/auto/factory/ReferencePackage.java",
    "chars": 1176,
    "preview": "/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/it/functional/src/main/java/com/google/auto/factory/otherpackage/OtherPackage.java",
    "chars": 1251,
    "preview": "/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/it/functional/src/test/java/com/google/auto/factory/DependencyInjectionIntegrationTest.java",
    "chars": 6734,
    "preview": "package com.google.auto.factory;\n\nimport static com.google.common.truth.Truth.assertThat;\n\nimport com.google.auto.factor"
  },
  {
    "path": "factory/src/main/java/com/google/auto/factory/AutoFactory.java",
    "chars": 4018,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/main/java/com/google/auto/factory/Provided.java",
    "chars": 1311,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/main/java/com/google/auto/factory/package-info.java",
    "chars": 680,
    "preview": "/*\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/main/java/com/google/auto/factory/processor/AnnotationValues.java",
    "chars": 3179,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/main/java/com/google/auto/factory/processor/AutoFactoryDeclaration.java",
    "chars": 9409,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/main/java/com/google/auto/factory/processor/AutoFactoryProcessor.java",
    "chars": 15504,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/main/java/com/google/auto/factory/processor/Elements2.java",
    "chars": 3100,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/main/java/com/google/auto/factory/processor/FactoryDescriptor.java",
    "chars": 9299,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/main/java/com/google/auto/factory/processor/FactoryDescriptorGenerator.java",
    "chars": 7371,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/main/java/com/google/auto/factory/processor/FactoryMethodDescriptor.java",
    "chars": 3589,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/main/java/com/google/auto/factory/processor/FactoryWriter.java",
    "chars": 16227,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/main/java/com/google/auto/factory/processor/ImplementationMethodDescriptor.java",
    "chars": 1722,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/main/java/com/google/auto/factory/processor/InjectApi.java",
    "chars": 3188,
    "preview": "/*\n * Copyright 2023 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/main/java/com/google/auto/factory/processor/Key.java",
    "chars": 3686,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/main/java/com/google/auto/factory/processor/Mirrors.java",
    "chars": 3691,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/main/java/com/google/auto/factory/processor/PackageAndClass.java",
    "chars": 1247,
    "preview": "/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/main/java/com/google/auto/factory/processor/Parameter.java",
    "chars": 5758,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/main/java/com/google/auto/factory/processor/ProvidedChecker.java",
    "chars": 3587,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/main/java/com/google/auto/factory/processor/ProviderField.java",
    "chars": 1513,
    "preview": "/*\n * Copyright 2016 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/main/java/com/google/auto/factory/processor/TypeVariables.java",
    "chars": 4091,
    "preview": "/*\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/main/java/com/google/auto/factory/processor/package-info.java",
    "chars": 814,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use th"
  },
  {
    "path": "factory/src/test/java/com/google/auto/factory/processor/AutoFactoryDeclarationTest.java",
    "chars": 1283,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/java/com/google/auto/factory/processor/AutoFactoryProcessorNegativeTest.java",
    "chars": 8956,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/java/com/google/auto/factory/processor/AutoFactoryProcessorTest.java",
    "chars": 22909,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/bad/AnnotationsToApplyMultiple.java",
    "chars": 980,
    "preview": "/*\n * Copyright 2023 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/bad/AnnotationsToApplyNotAnnotations.java",
    "chars": 1135,
    "preview": "/*\n * Copyright 2023 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/bad/AnnotationsToApplyRepeated.java",
    "chars": 966,
    "preview": "/*\n * Copyright 2023 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/bad/EnumSupertype.java",
    "chars": 764,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/bad/FactoryExtendingAbstractClassWithConstructorParams.java",
    "chars": 1018,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/bad/FinalSupertype.java",
    "chars": 725,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/bad/InterfaceSupertype.java",
    "chars": 726,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/bad/InvalidCustomName.java",
    "chars": 726,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/bad/MixedFinals.java",
    "chars": 883,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/bad/ProvidedButNoAutoFactory.java",
    "chars": 749,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/bad/ProvidedOnMethodParameter.java",
    "chars": 735,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/expected/CheckerFrameworkNullableFactory.java",
    "chars": 2391,
    "preview": "/*\n * Copyright 2016 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/expected/ClassUsingQualifierWithArgsFactory.java",
    "chars": 1692,
    "preview": "/*\n * Copyright 2015 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/expected/ConstructorAnnotatedFactory.java",
    "chars": 1884,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/expected/ConstructorAnnotatedNonFinalFactory.java",
    "chars": 1958,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/expected/ConstructorAnnotatedThrowsFactory.java",
    "chars": 2060,
    "preview": "/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/expected/CustomAnnotationsFactory.java",
    "chars": 1099,
    "preview": "/*\n * Copyright 2023 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/expected/CustomNamedFactory.java",
    "chars": 986,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/expected/CustomNullableFactory.java",
    "chars": 1585,
    "preview": "/*\n * Copyright 2016 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/expected/DefaultPackageFactory.java",
    "chars": 984,
    "preview": "/*\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/expected/FactoryExtendingAbstractClassFactory.java",
    "chars": 1189,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/expected/FactoryExtendingAbstractClassThrowsFactory.java",
    "chars": 1311,
    "preview": "/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/expected/FactoryImplementingCreateMethod_ConcreteClassFactory.java",
    "chars": 2193,
    "preview": "/*\n * Copyright 2016 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/expected/FactoryImplementingGenericInterfaceExtensionFactory.java",
    "chars": 1879,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/expected/Generics_ExplicitFooImplFactory.java",
    "chars": 1675,
    "preview": "/*\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/expected/Generics_FooImplFactory.java",
    "chars": 1069,
    "preview": "/*\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/expected/Generics_FooImplWithClassFactory.java",
    "chars": 1111,
    "preview": "/*\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/expected/MixedDepsImplementingInterfacesFactory.java",
    "chars": 2175,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/expected/MultipleFactoriesConflictingParameterNamesFactory.java",
    "chars": 2770,
    "preview": "/*\n * Copyright 2016 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/expected/MultipleFactoriesImplementingInterface_ClassAFactory.java",
    "chars": 1291,
    "preview": "/*\n * Copyright 2015 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/expected/MultipleFactoriesImplementingInterface_ClassBFactory.java",
    "chars": 1291,
    "preview": "/*\n * Copyright 2015 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/expected/MultipleProvidedParamsSameKeyFactory.java",
    "chars": 1845,
    "preview": "/*\n * Copyright 2016 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/expected/NestedClassCustomNamedFactory.java",
    "chars": 1062,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/expected/NestedClasses_SimpleNestedClassFactory.java",
    "chars": 1046,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/expected/OnlyPrimitivesFactory.java",
    "chars": 995,
    "preview": "/*\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/expected/ParameterAnnotationsFactory.java",
    "chars": 1983,
    "preview": "/*\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/expected/ProviderArgumentToCreateMethodFactory.java",
    "chars": 1700,
    "preview": "/*\n * Copyright 2016 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/expected/PublicClassFactory.java",
    "chars": 987,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/expected/SimpleClassFactory.java",
    "chars": 966,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/expected/SimpleClassImplementingMarkerFactory.java",
    "chars": 1093,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/expected/SimpleClassImplementingSimpleInterfaceFactory.java",
    "chars": 1246,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/expected/SimpleClassMixedDepsFactory.java",
    "chars": 1670,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/expected/SimpleClassNonFinalFactory.java",
    "chars": 992,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/expected/SimpleClassNullableParametersFactory.java",
    "chars": 2111,
    "preview": "/*\n * Copyright 2016 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/expected/SimpleClassPassedDepsFactory.java",
    "chars": 1444,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/expected/SimpleClassProvidedDepsFactory.java",
    "chars": 2442,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/expected/SimpleClassProvidedProviderDepsFactory.java",
    "chars": 1857,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/expected/SimpleClassThrowsFactory.java",
    "chars": 1059,
    "preview": "/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/expected/SimpleClassVarargsFactory.java",
    "chars": 1541,
    "preview": "/*\n * Copyright 2016 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/good/CheckerFrameworkNullable.java",
    "chars": 1270,
    "preview": "/*\n * Copyright 2016 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/good/ClassUsingQualifierWithArgs.java",
    "chars": 1000,
    "preview": "/*\n * Copyright 2015 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use th"
  },
  {
    "path": "factory/src/test/resources/good/ConstructorAnnotated.java",
    "chars": 1006,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/good/ConstructorAnnotatedNonFinal.java",
    "chars": 1150,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/good/ConstructorAnnotatedThrows.java",
    "chars": 1158,
    "preview": "/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/good/CustomAnnotations.java",
    "chars": 1045,
    "preview": "/*\n * Copyright 2023 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/good/CustomNullable.java",
    "chars": 998,
    "preview": "/*\n * Copyright 2016 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/good/DefaultPackage.java",
    "chars": 686,
    "preview": "/*\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/good/FactoryExtendingAbstractClass.java",
    "chars": 909,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/good/FactoryExtendingAbstractClassThrows.java",
    "chars": 1057,
    "preview": "/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/good/FactoryExtendingAbstractClassWithMultipleConstructors.java",
    "chars": 1063,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/good/FactoryImplementingCreateMethod.java",
    "chars": 1462,
    "preview": "/*\n * Copyright 2016 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/good/FactoryImplementingGenericInterfaceExtension.java",
    "chars": 1045,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/good/Generics.java",
    "chars": 1682,
    "preview": "/*\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/good/MixedDepsImplementingInterfaces.java",
    "chars": 1226,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/good/MultipleFactoriesConflictingParameterNames.java",
    "chars": 1413,
    "preview": "/*\n * Copyright 2016 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/good/MultipleFactoriesImplementingInterface.java",
    "chars": 1006,
    "preview": "/*\n * Copyright 2015 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/good/MultipleProvidedParamsSameKey.java",
    "chars": 1364,
    "preview": "/*\n * Copyright 2016 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/good/NestedClasses.java",
    "chars": 859,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/good/OnlyPrimitives.java",
    "chars": 761,
    "preview": "/*\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/good/ParameterAnnotations.java",
    "chars": 1622,
    "preview": "/*\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/good/ProviderArgumentToCreateMethod.java",
    "chars": 1086,
    "preview": "/*\n * Copyright 2016 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/good/PublicClass.java",
    "chars": 698,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/good/SimpleClass.java",
    "chars": 691,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/good/SimpleClassCustomName.java",
    "chars": 735,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/good/SimpleClassImplementingMarker.java",
    "chars": 763,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use th"
  },
  {
    "path": "factory/src/test/resources/good/SimpleClassImplementingSimpleInterface.java",
    "chars": 918,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/good/SimpleClassMixedDeps.java",
    "chars": 1014,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/good/SimpleClassNonFinal.java",
    "chars": 723,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/good/SimpleClassNullableParameters.java",
    "chars": 1556,
    "preview": "/*\n * Copyright 2016 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/good/SimpleClassPassedDeps.java",
    "chars": 921,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/good/SimpleClassProvidedDeps.java",
    "chars": 1365,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use th"
  },
  {
    "path": "factory/src/test/resources/good/SimpleClassProvidedProviderDeps.java",
    "chars": 1167,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use th"
  },
  {
    "path": "factory/src/test/resources/good/SimpleClassThrows.java",
    "chars": 792,
    "preview": "/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/good/SimpleClassVarargs.java",
    "chars": 944,
    "preview": "/*\n * Copyright 2016 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/support/AQualifier.java",
    "chars": 878,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/support/BQualifier.java",
    "chars": 878,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "factory/src/test/resources/support/QualifierWithArgs.java",
    "chars": 921,
    "preview": "/*\n * Copyright 2015 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "service/README.md",
    "chars": 3329,
    "preview": "# AutoService\n\nA configuration/metadata generator for java.util.ServiceLoader-style service\nproviders\n\n## AutoWhat‽\n\n[Ja"
  },
  {
    "path": "service/annotations/pom.xml",
    "chars": 2303,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  Copyright 2013 Google LLC\n\n  Licensed under the Apache License, Version 2."
  },
  {
    "path": "service/annotations/src/main/java/com/google/auto/service/AutoService.java",
    "chars": 1577,
    "preview": "/*\n * Copyright 2008 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "service/pom.xml",
    "chars": 5220,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  Copyright 2013 Google LLC\n\n  Licensed under the Apache License, Version 2."
  },
  {
    "path": "service/processor/pom.xml",
    "chars": 3113,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  Copyright 2013 Google LLC\n\n  Licensed under the Apache License, Version 2."
  },
  {
    "path": "service/processor/src/main/java/com/google/auto/service/processor/AutoServiceProcessor.java",
    "chars": 13127,
    "preview": "/*\n * Copyright 2008 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "service/processor/src/main/java/com/google/auto/service/processor/ServicesFiles.java",
    "chars": 2816,
    "preview": "/*\n * Copyright 2008 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "service/processor/src/main/java/com/google/auto/service/processor/package-info.java",
    "chars": 757,
    "preview": "/*\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use th"
  },
  {
    "path": "service/processor/src/main/resources/META-INF/gradle/incremental.annotation.processors",
    "chars": 67,
    "preview": "com.google.auto.service.processor.AutoServiceProcessor,AGGREGATING\n"
  },
  {
    "path": "service/processor/src/main/resources/META-INF/services/javax.annotation.processing.Processor",
    "chars": 55,
    "preview": "com.google.auto.service.processor.AutoServiceProcessor\n"
  },
  {
    "path": "service/processor/src/test/java/com/google/auto/service/processor/AutoServiceProcessorTest.java",
    "chars": 9758,
    "preview": "/*\n * Copyright 2008 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "service/processor/src/test/resources/META-INF/services/test.AnotherService",
    "chars": 28,
    "preview": "test.AnotherServiceProvider\n"
  },
  {
    "path": "service/processor/src/test/resources/META-INF/services/test.SomeService",
    "chars": 93,
    "preview": "test.Enclosing$NestedSomeServiceProvider\ntest.SomeServiceProvider1\ntest.SomeServiceProvider2\n"
  },
  {
    "path": "service/processor/src/test/resources/test/AnotherService.java",
    "chars": 633,
    "preview": "/*\n * Copyright 2008 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "service/processor/src/test/resources/test/AnotherServiceProvider.java",
    "chars": 750,
    "preview": "/*\n * Copyright 2008 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "service/processor/src/test/resources/test/AutoServiceOnAbstractClass.java",
    "chars": 757,
    "preview": "/*\n * Copyright 2023 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "service/processor/src/test/resources/test/AutoServiceOnInterface.java",
    "chars": 745,
    "preview": "/*\n * Copyright 2023 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "service/processor/src/test/resources/test/DoesNotImplement.java",
    "chars": 715,
    "preview": "/*\n * Copyright 2023 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "service/processor/src/test/resources/test/DoesNotImplementSuppressed.java",
    "chars": 758,
    "preview": "/*\n * Copyright 2023 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "service/processor/src/test/resources/test/Enclosing.java",
    "chars": 785,
    "preview": "/*\n * Copyright 2008 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "service/processor/src/test/resources/test/EnclosingGeneric.java",
    "chars": 1103,
    "preview": "/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "service/processor/src/test/resources/test/GenericService.java",
    "chars": 802,
    "preview": "/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "service/processor/src/test/resources/test/GenericServiceProvider.java",
    "chars": 907,
    "preview": "/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "service/processor/src/test/resources/test/GenericServiceProviderSuppressWarnings.java",
    "chars": 990,
    "preview": "/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "service/processor/src/test/resources/test/GenericServiceProviderWithMissingServiceClass.java",
    "chars": 911,
    "preview": "/*\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "service/processor/src/test/resources/test/MultiServiceProvider.java",
    "chars": 782,
    "preview": "/*\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "service/processor/src/test/resources/test/NoServices.java",
    "chars": 694,
    "preview": "/*\n * Copyright 2008 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "service/processor/src/test/resources/test/SomeService.java",
    "chars": 630,
    "preview": "/*\n * Copyright 2008 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "service/processor/src/test/resources/test/SomeServiceProvider1.java",
    "chars": 742,
    "preview": "/*\n * Copyright 2008 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "service/processor/src/test/resources/test/SomeServiceProvider2.java",
    "chars": 742,
    "preview": "/*\n * Copyright 2008 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use"
  },
  {
    "path": "util/generate-latest-docs.sh",
    "chars": 750,
    "preview": "#!/bin/bash\n\n# Run by GitHub Actions (see .github/workflows/ci.yml)\n\nset -e\n\necho -e \"Publishing javadoc...\\n\"\n\nmvn -f b"
  },
  {
    "path": "util/publish-snapshot-on-commit.sh",
    "chars": 170,
    "preview": "#!/bin/bash\n\nset -e\n\nmvn -B dependency:go-offline test clean -U --quiet --fail-never -DskipTests=true -f build-pom.xml\nm"
  },
  {
    "path": "value/CHANGES.md",
    "chars": 10693,
    "preview": "# AutoValue Changes\n\n**This document is obsolete.** For details of changes in releases since 1.5,\nsee the [releases page"
  },
  {
    "path": "value/README.md",
    "chars": 1546,
    "preview": "# AutoValue\n\n*Generated immutable value classes for Java 8+* <br />\n***Kevin Bourrillion, Éamonn McManus*** <br />\n**Goo"
  },
  {
    "path": "value/annotations/pom.xml",
    "chars": 2757,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  Copyright 2012 Google LLC\n\n  Licensed under the Apache License, Version 2."
  },
  {
    "path": "value/pom.xml",
    "chars": 8023,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  Copyright 2012 Google LLC\n\n  Licensed under the Apache License, Version 2."
  },
  {
    "path": "value/processor/pom.xml",
    "chars": 10973,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  Copyright 2012 Google LLC\n\n  Licensed under the Apache License, Version 2."
  }
]

// ... and 177 more files (download for full content)

About this extraction

This page contains the full source code of the google/auto GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 377 files (2.4 MB), approximately 640.7k tokens, and a symbol index with 5154 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!