Full Code of square/dagger for AI

master 0fa73e0ee070 cached
202 files
601.2 KB
153.0k tokens
989 symbols
1 requests
Download .txt
Showing preview only (664K chars total). Download the full file or copy to clipboard to get everything.
Repository: square/dagger
Branch: master
Commit: 0fa73e0ee070
Files: 202
Total size: 601.2 KB

Directory structure:
gitextract_cz8_4_6g/

├── .buildscript/
│   ├── deploy_snapshot.sh
│   └── settings.xml
├── .gitignore
├── .travis.yml
├── CHANGELOG.md
├── CONTRIBUTING.md
├── LICENSE.txt
├── README.md
├── checkstyle.xml
├── compiler/
│   ├── pom.xml
│   └── src/
│       ├── it/
│       │   ├── default-package-injected-type/
│       │   │   ├── pom.xml
│       │   │   └── src/
│       │   │       └── main/
│       │   │           └── java/
│       │   │               └── TestApp.java
│       │   ├── extension-graph/
│       │   │   ├── pom.xml
│       │   │   └── src/
│       │   │       └── main/
│       │   │           └── java/
│       │   │               └── test/
│       │   │                   └── TestApp.java
│       │   ├── extension-graph-setvalues/
│       │   │   ├── pom.xml
│       │   │   └── src/
│       │   │       └── main/
│       │   │           └── java/
│       │   │               └── test/
│       │   │                   └── TestApp.java
│       │   ├── final-field-inject/
│       │   │   ├── invoker.properties
│       │   │   ├── pom.xml
│       │   │   ├── src/
│       │   │   │   └── main/
│       │   │   │       └── java/
│       │   │   │           └── test/
│       │   │   │               └── TestApp.java
│       │   │   └── verify.bsh
│       │   ├── include-non-module/
│       │   │   ├── invoker.properties
│       │   │   ├── pom.xml
│       │   │   └── src/
│       │   │       └── main/
│       │   │           └── java/
│       │   │               └── test/
│       │   │                   └── TestApp.java
│       │   ├── inject-on-class/
│       │   │   ├── invoker.properties
│       │   │   ├── pom.xml
│       │   │   ├── src/
│       │   │   │   └── main/
│       │   │   │       └── java/
│       │   │   │           └── test/
│       │   │   │               └── TestApp.java
│       │   │   └── verify.bsh
│       │   ├── inject-parameterized-type/
│       │   │   ├── pom.xml
│       │   │   └── src/
│       │   │       └── main/
│       │   │           └── java/
│       │   │               └── test/
│       │   │                   └── TestApp.java
│       │   ├── inner-classes-complaint-injection/
│       │   │   ├── invoker.properties
│       │   │   ├── pom.xml
│       │   │   ├── src/
│       │   │   │   └── main/
│       │   │   │       └── java/
│       │   │   │           └── test/
│       │   │   │               └── TestApp.java
│       │   │   └── verify.bsh
│       │   ├── method-injection/
│       │   │   ├── invoker.properties
│       │   │   ├── pom.xml
│       │   │   ├── src/
│       │   │   │   └── main/
│       │   │   │       └── java/
│       │   │   │           └── test/
│       │   │   │               └── TestApp.java
│       │   │   └── verify.bsh
│       │   ├── missing-at-inject-constructor/
│       │   │   ├── invoker.properties
│       │   │   ├── pom.xml
│       │   │   ├── src/
│       │   │   │   └── main/
│       │   │   │       └── java/
│       │   │   │           └── test/
│       │   │   │               └── TestApp.java
│       │   │   └── verify.bsh
│       │   ├── module-type-validation/
│       │   │   ├── invoker.properties
│       │   │   ├── pom.xml
│       │   │   ├── src/
│       │   │   │   └── main/
│       │   │   │       └── java/
│       │   │   │           └── test/
│       │   │   │               └── TestModule.java
│       │   │   └── verify.bsh
│       │   ├── multiple-modules-setvalues/
│       │   │   ├── pom.xml
│       │   │   └── src/
│       │   │       └── main/
│       │   │           └── java/
│       │   │               └── test/
│       │   │                   └── TestApp.java
│       │   ├── multiple-provides-methods/
│       │   │   ├── pom.xml
│       │   │   ├── src/
│       │   │   │   └── main/
│       │   │   │       └── java/
│       │   │   │           └── test/
│       │   │   │               └── TestApp.java
│       │   │   └── verify.bsh
│       │   ├── multiple-qualifiers/
│       │   │   ├── invoker.properties
│       │   │   ├── pom.xml
│       │   │   ├── src/
│       │   │   │   └── main/
│       │   │   │       └── java/
│       │   │   │           └── test/
│       │   │   │               └── TestApp.java
│       │   │   └── verify.bsh
│       │   ├── private-inject/
│       │   │   ├── invoker.properties
│       │   │   ├── pom.xml
│       │   │   ├── src/
│       │   │   │   └── main/
│       │   │   │       └── java/
│       │   │   │           └── test/
│       │   │   │               ├── TestApp.java
│       │   │   │               └── TestFoo.java
│       │   │   └── verify.bsh
│       │   ├── provide-provider-or-lazy/
│       │   │   ├── invoker.properties
│       │   │   ├── pom.xml
│       │   │   ├── src/
│       │   │   │   └── main/
│       │   │   │       └── java/
│       │   │   │           └── test/
│       │   │   │               └── TestModule.java
│       │   │   └── verify.bsh
│       │   ├── provides-method-not-in-module/
│       │   │   ├── invoker.properties
│       │   │   ├── pom.xml
│       │   │   ├── src/
│       │   │   │   └── main/
│       │   │   │       └── java/
│       │   │   │           └── test/
│       │   │   │               └── TestApp.java
│       │   │   └── verify.bsh
│       │   ├── provides-method-with-throws-clause/
│       │   │   ├── invoker.properties
│       │   │   ├── pom.xml
│       │   │   ├── src/
│       │   │   │   └── main/
│       │   │   │       └── java/
│       │   │   │           └── test/
│       │   │   │               └── TestApp.java
│       │   │   └── verify.bsh
│       │   ├── qualifiers-on-invalid-elements-errors/
│       │   │   ├── invoker.properties
│       │   │   ├── pom.xml
│       │   │   ├── src/
│       │   │   │   └── main/
│       │   │   │       └── java/
│       │   │   │           └── test/
│       │   │   │               └── TestApp.java
│       │   │   └── verify.bsh
│       │   ├── qualifiers-on-invalid-elements-warnings/
│       │   │   ├── pom.xml
│       │   │   ├── src/
│       │   │   │   └── main/
│       │   │   │       └── java/
│       │   │   │           └── test/
│       │   │   │               └── TestApp.java
│       │   │   └── verify.bsh
│       │   ├── same-provides-method-name/
│       │   │   ├── pom.xml
│       │   │   └── src/
│       │   │       └── main/
│       │   │           └── java/
│       │   │               └── test/
│       │   │                   └── TestApp.java
│       │   ├── static-injected-binding-doesnt-fail-providers/
│       │   │   ├── pom.xml
│       │   │   └── src/
│       │   │       └── main/
│       │   │           └── java/
│       │   │               └── test/
│       │   │                   └── Test.java
│       │   ├── uninjectable-supertype/
│       │   │   ├── pom.xml
│       │   │   └── src/
│       │   │       └── main/
│       │   │           └── java/
│       │   │               └── test/
│       │   │                   └── TestApp.java
│       │   └── valid-use-of-qualifiers/
│       │       ├── pom.xml
│       │       └── src/
│       │           └── main/
│       │               └── java/
│       │                   └── test/
│       │                       └── TestApp.java
│       ├── main/
│       │   ├── java/
│       │   │   └── dagger/
│       │   │       └── internal/
│       │   │           └── codegen/
│       │   │               ├── AdapterJavadocs.java
│       │   │               ├── GeneratorKeys.java
│       │   │               ├── GraphAnalysisErrorHandler.java
│       │   │               ├── GraphAnalysisInjectBinding.java
│       │   │               ├── GraphAnalysisLoader.java
│       │   │               ├── GraphAnalysisProcessor.java
│       │   │               ├── GraphAnalysisStaticInjection.java
│       │   │               ├── GraphVisualizer.java
│       │   │               ├── GraphVizWriter.java
│       │   │               ├── InjectAdapterProcessor.java
│       │   │               ├── ModuleAdapterProcessor.java
│       │   │               ├── Util.java
│       │   │               └── ValidationProcessor.java
│       │   └── resources/
│       │       └── META-INF/
│       │           └── services/
│       │               └── javax.annotation.processing.Processor
│       └── test/
│           └── java/
│               └── dagger/
│                   ├── internal/
│                   │   └── codegen/
│                   │       ├── DotWriterTest.java
│                   │       ├── GraphAnalysisLoaderTest.java
│                   │       └── GraphVisualizerTest.java
│                   ├── testing/
│                   │   └── it/
│                   │       └── BuildLogValidator.java
│                   └── tests/
│                       └── integration/
│                           ├── ProcessorTestUtils.java
│                           ├── codegen/
│                           │   ├── GenericInjectAdapterGenerationTest.java
│                           │   ├── InjectAdapterGenerationTest.java
│                           │   └── ModuleAdapterGenerationTest.java
│                           ├── operation/
│                           │   ├── FailureModeErrorsTest.java
│                           │   ├── PrimitiveInjectionTest.java
│                           │   └── SimpleInjectionTest.java
│                           └── validation/
│                               ├── CyclicDependencyTest.java
│                               ├── CyclicModuleIncludesTest.java
│                               ├── GeneratedTypesNotReadyTest.java
│                               ├── LibraryModuleTest.java
│                               ├── ScopeAnnotationUseTest.java
│                               └── SimpleMissingDependencyTest.java
├── core/
│   ├── pom.xml
│   └── src/
│       ├── main/
│       │   └── java/
│       │       └── dagger/
│       │           ├── Lazy.java
│       │           ├── MembersInjector.java
│       │           ├── Module.java
│       │           ├── ObjectGraph.java
│       │           ├── Provides.java
│       │           └── internal/
│       │               ├── ArrayQueue.java
│       │               ├── Binding.java
│       │               ├── BindingsGroup.java
│       │               ├── BuiltInBinding.java
│       │               ├── FailoverLoader.java
│       │               ├── Keys.java
│       │               ├── LazyBinding.java
│       │               ├── Linker.java
│       │               ├── Loader.java
│       │               ├── Memoizer.java
│       │               ├── ModuleAdapter.java
│       │               ├── Modules.java
│       │               ├── ProblemDetector.java
│       │               ├── ProvidesBinding.java
│       │               ├── SetBinding.java
│       │               ├── StaticInjection.java
│       │               ├── ThrowingErrorHandler.java
│       │               └── loaders/
│       │                   ├── GeneratedAdapters.java
│       │                   ├── ReflectiveAtInjectBinding.java
│       │                   └── ReflectiveStaticInjection.java
│       └── test/
│           └── java/
│               └── dagger/
│                   ├── ExtensionTest.java
│                   ├── ExtensionWithSetBindingsTest.java
│                   ├── ExtensionWithStateTest.java
│                   ├── InjectStaticsTest.java
│                   ├── InjectionOfLazyTest.java
│                   ├── InjectionTest.java
│                   ├── LazyInjectionTest.java
│                   ├── MembersInjectorTest.java
│                   ├── ModuleTest.java
│                   ├── ProblemDetectorTest.java
│                   ├── SetBindingTest.java
│                   ├── ThreadSafetyTest.java
│                   ├── UnusedProviderTest.java
│                   └── internal/
│                       ├── FailoverLoaderTest.java
│                       ├── KeysTest.java
│                       ├── SingletonBindingTest.java
│                       ├── TestingLoader.java
│                       └── TestingModuleAdapter.java
├── deploy_website.sh
├── examples/
│   ├── android-activity-graphs/
│   │   ├── README.md
│   │   ├── pom.xml
│   │   └── src/
│   │       └── main/
│   │           ├── AndroidManifest.xml
│   │           ├── java/
│   │           │   └── com/
│   │           │       └── example/
│   │           │           └── dagger/
│   │           │               └── activitygraphs/
│   │           │                   ├── ActivityModule.java
│   │           │                   ├── AndroidModule.java
│   │           │                   ├── DemoApplication.java
│   │           │                   ├── DemoBaseActivity.java
│   │           │                   ├── DemoBaseFragment.java
│   │           │                   ├── ForActivity.java
│   │           │                   ├── ForApplication.java
│   │           │                   └── ui/
│   │           │                       ├── ActivityTitleController.java
│   │           │                       ├── HomeActivity.java
│   │           │                       └── HomeFragment.java
│   │           └── res/
│   │               └── values/
│   │                   └── strings.xml
│   ├── android-simple/
│   │   ├── README.md
│   │   ├── pom.xml
│   │   └── src/
│   │       └── main/
│   │           ├── AndroidManifest.xml
│   │           ├── java/
│   │           │   └── com/
│   │           │       └── example/
│   │           │           └── dagger/
│   │           │               └── simple/
│   │           │                   ├── AndroidModule.java
│   │           │                   ├── DemoApplication.java
│   │           │                   ├── DemoBaseActivity.java
│   │           │                   ├── DemoModule.java
│   │           │                   ├── ForApplication.java
│   │           │                   └── ui/
│   │           │                       └── HomeActivity.java
│   │           └── res/
│   │               └── values/
│   │                   └── strings.xml
│   ├── pom.xml
│   └── simple/
│       ├── pom.xml
│       └── src/
│           ├── main/
│           │   └── java/
│           │       └── coffee/
│           │           ├── CoffeeApp.java
│           │           ├── CoffeeMaker.java
│           │           ├── DripCoffeeModule.java
│           │           ├── ElectricHeater.java
│           │           ├── Heater.java
│           │           ├── Pump.java
│           │           ├── PumpModule.java
│           │           └── Thermosiphon.java
│           └── test/
│               └── java/
│                   └── coffee/
│                       └── CoffeeMakerTest.java
├── pom.xml
└── website/
    ├── index.html
    └── static/
        ├── app-theme.css
        ├── app.css
        └── prettify.js

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

================================================
FILE: .buildscript/deploy_snapshot.sh
================================================
#!/bin/bash
#
# Deploy a jar, source jar, and javadoc jar to Sonatype's snapshot repo.
#
# Adapted from https://coderwall.com/p/9b_lfq and
# http://benlimmer.com/2013/12/26/automatically-publish-javadoc-to-gh-pages-with-travis-ci/

SLUG="square/dagger"
JDK="oraclejdk7" # Dagger integration tests fail on JDK 8 :(
BRANCH="master"

set -e

if [ "$TRAVIS_REPO_SLUG" != "$SLUG" ]; then
  echo "Skipping snapshot deployment: wrong repository. Expected '$SLUG' but was '$TRAVIS_REPO_SLUG'."
elif [ "$TRAVIS_JDK_VERSION" != "$JDK" ]; then
  echo "Skipping snapshot deployment: wrong JDK. Expected '$JDK' but was '$TRAVIS_JDK_VERSION'."
elif [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
  echo "Skipping snapshot deployment: was pull request."
elif [ "$TRAVIS_BRANCH" != "$BRANCH" ]; then
  echo "Skipping snapshot deployment: wrong branch. Expected '$BRANCH' but was '$TRAVIS_BRANCH'."
else
  echo "Deploying snapshot..."
  mvn clean source:jar javadoc:jar deploy --settings=".buildscript/settings.xml" -Dmaven.test.skip=true -Dinvoker.skip=true
  echo "Snapshot deployed!"
fi


================================================
FILE: .buildscript/settings.xml
================================================
<settings>
  <servers>
    <server>
      <id>sonatype-nexus-snapshots</id>
      <username>${env.CI_DEPLOY_USERNAME}</username>
      <password>${env.CI_DEPLOY_PASSWORD}</password>
    </server>
  </servers>
</settings>


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

bin
gen
build
out
lib

target
pom.xml.*
release.properties

.idea
*.iml
classes

obj

.DS_Store


================================================
FILE: .travis.yml
================================================
language: android

android:
  components:
    - build-tools-20.0.0
    - android-16
  licenses:
    - android-sdk-license-5be876d5

jdk:
  - oraclejdk7
  # - oraclejdk8 Dagger integration tests fail with JDK 8 :(

install: mvn install clean --fail-never --quiet -DskipTests=true -Dinvoker.skip=true

script: mvn verify

after_success:
  - .buildscript/deploy_snapshot.sh

env:
  global:
    - secure: "MhR0Wr+bSbdyO6a6CM2MVHLwmFZoi8ZWWncMCNSi8/xdRoykpC1HkwJjQK+HJv7j3VNbVTPNJ/yTpzJsL4JV9aTF/S28mka8GmHSmQSeQzTuNMqnE30GDbhS3S73azGHvC9/wjh1mAA0Gz/zUX/rzCYvDVZ/DmK1HppomN+P32A="
    - secure: "fnHK/ei7tdcUDlQZcXWVPRgXoIFv6h0TWSzz4spgNtFlYqa47Qr4HQOLyEpWRqZHjgfR5eXD+CCI049Z73cg5oVOp1krV0aGX/wHc5lDMJuCrBZ/YoWZnDygiPzM4CvrpxRE7DjqzC0InVdbEbuECiFsI2WotLdQ6efgaxjpZCk="

branches:
  except:
    - gh-pages

notifications:
  email: false

sudo: false

cache:
  directories:
    - $HOME/.m2


================================================
FILE: CHANGELOG.md
================================================
Change Log
==========

Version 1.2.5 *(2016-05-09)*
----------------------------

 * Fix: Correctly emit generated code for binding parameterized types.


Version 1.2.4 *(2016-05-03)*
----------------------------

 * Fix: Restore static injection support to work correctly.


Version 1.2.3 *(2016-05-02)*
----------------------------

 * Fix: Correct detection of module base classes. This previously erroneously failed compilation
   on modules which extended from `Object` but were not detected as such.
 * Fix: Allow the use of dollar signs in processed class names.
 * Fix: Remove the need for `javac` to generate synthetic accessor methods for internal classes.
 * Fix: Error when duplicate classes are listed in `injects=` or `includes=` lists.


Version 1.2.2 *(2014-07-21)*
----------------------------

 * Update JavaWriter to 2.5.0. This fixes incorrectly compressing fully-qualified class names
   in child packages of `java.lang` (e.g., `java.lang.ref.WeakReference`).


Version 1.2.1 *(2014-02-16)*
----------------------------

 * Restore Java 5 compatibility.
 * New: Improve performance of `.plus()` with large volumes of set bindings.
 * Fix: Do not mask underlying exception message from binding problems when constructing a graph.


Version 1.2.0 *(2013-12-13)*
----------------------------

 * Numerous performance improvements in both the compiler and runtime.
   * Use more efficient `String` concatenation.
   * Module adapters are now stateless.
   * Use read/write locks over global locks.
   * Reflective constructor invocation is now cached with `Class.newInstance`.
   * Avoid re-linking all bindings when calling `.plus()`.
 * Set bindings are now unioned when calling `.plus()`.
 * Fix: Tolerate missing type information during compilation by deferring writing
   module adapters.


Version 1.1.0 *(2013-08-05)*
----------------------------

 * Module loading now requires code generation via the 'dagger-compiler' artifact.
 * Allow multiple contributions to Set binding via `Provides.Type.SET_VALUES`.
 * Request classloading from the classloader of the requesting object, not the current thread's
   context classloader.
 * Cache class loading at the root injector to reduce costs of loading adapters.
 * Fix: Primitive array types are no longer incorrectly changed to their boxed type.
 * Update JavaWriter to 2.1.1.


Version 1.0.1 *(2013-06-03)*
----------------------------

 * Explicitly forbid declaring `@Inject` on a class type (e.g., `@Inject class Foo {}`).
 * Update JavaWriter to 1.0.5.


Version 1.0.0 *(2013-05-07)*
----------------------------

Initial release.


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

If you would like to contribute code to Dagger 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
FEST assertions and be added to `<project>/src/test/java`.  Changes to build-time
behaviour (such as changes to code generation or graph validation) should go into
small maven projects using the `maven-invoker-plugin`.  Examples of this are in
`core/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 Square, Inc. copyright line must appear in every copyright notice.
All files are released with the Apache 2.0 license.

Checkstyle failures during compilation indicate errors in your style and will
be displayed in the console output of the build (including in Travis-CI output),
or can be viewed in the `checkstyle-result.xml` file.

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


 [1]: https://spreadsheets.google.com/spreadsheet/viewform?formkey=dDViT2xzUHAwRkI3X3k5Z0lQM091OGc6MQ&ndplr=1


================================================
FILE: LICENSE.txt
================================================

                                 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
================================================
Dagger 1
========

A fast dependency injector for Android and Java.


Deprecated – Please upgrade to Dagger 2
---------------------------------------

Square's Dagger 1.x is deprecated in favor of [Google's Dagger 2](https://github.com/google/dagger).
Please see [the migration guide](https://google.github.io/dagger/dagger-1-migration.html) for help
with the upgrade.


Download Dagger 1
-----------------

You will need to include the `dagger-${dagger.version}.jar` in your
application's runtime.  In order to activate code generation you will need to
include `dagger-compiler-${dagger.version}.jar` in your build at compile time.

In a Maven project, one would include the runtime in the dependencies section
of your `pom.xml` (replacing `${dagger.version}` with the appropriate current
release), and the `dagger-compiler` artifact as an "optional" or "provided"
dependency:

```xml
<dependencies>
  <dependency>
    <groupId>com.squareup.dagger</groupId>
    <artifactId>dagger</artifactId>
    <version>${dagger.version}</version>
  </dependency>
  <dependency>
    <groupId>com.squareup.dagger</groupId>
    <artifactId>dagger-compiler</artifactId>
    <version>${dagger.version}</version>
    <optional>true</optional>
  </dependency>
</dependencies>
```

You can also find downloadable .jars on Maven Central. You'll need
[Dagger][dl-dagger], [JavaPoet][dl-javapoet], and [javax.inject][dl-inject].

Snapshots of the development version are available in [Sonatype's `snapshots` repository][snap].



License
-------

    Copyright 2012 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.



 [1]: http://square.github.com/dagger/
 [dl-dagger]: http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.squareup.dagger%22%20a%3A%22dagger%22
 [dl-javapoet]: http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.squareup%22%20a%3A%22javapoet%22
 [dl-inject]: http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22javax.inject%22%20a%3A%22javax.inject%22
 [snap]: https://oss.sonatype.org/content/repositories/snapshots/


================================================
FILE: checkstyle.xml
================================================
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
    "-//Puppy Crawl//DTD Check Configuration 1.2//EN"
    "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">

<module name="Checker">
    <!--module name="NewlineAtEndOfFile"/-->
    <module name="FileLength"/>
    <module name="FileTabCharacter"/>

    <!-- Trailing spaces -->
    <module name="RegexpSingleline">
        <property name="format" value="\s+$"/>
        <property name="message" value="Line has trailing spaces."/>
    </module>

    <!-- Space after 'for' and 'if' -->
    <module name="RegexpSingleline">
        <property name="format" value="^\s*(for|if)[^ ]"/>
        <property name="message" value="Space needed before opening parenthesis."/>
    </module>

    <!-- For each spacing -->
    <module name="RegexpSingleline">
        <property name="format" value="^\s*for \(.*?([^ ]:|:[^ ])"/>
        <property name="message" value="Space needed around ':' character."/>
    </module>

    <module name="TreeWalker">
        <property name="cacheFile" value="${checkstyle.cache.file}"/>

        <!-- Checks for Javadoc comments.                     -->
        <!-- See http://checkstyle.sf.net/config_javadoc.html -->
        <!--module name="JavadocMethod"/-->
        <!--module name="JavadocType"/-->
        <!--module name="JavadocVariable"/-->
        <!--module name="JavadocStyle"/-->


        <!-- Checks for Naming Conventions.                  -->
        <!-- See http://checkstyle.sf.net/config_naming.html -->
        <!--<module name="ConstantName"/>-->
        <module name="LocalFinalVariableName"/>
        <module name="LocalVariableName"/>
        <module name="MemberName"/>
        <module name="MethodName"/>
        <module name="PackageName"/>
        <module name="ParameterName"/>
        <module name="StaticVariableName"/>
        <module name="TypeName"/>


        <!-- Checks for imports                              -->
        <!-- See http://checkstyle.sf.net/config_import.html -->
        <module name="AvoidStarImport"/>
        <module name="IllegalImport"/> <!-- defaults to sun.* packages -->
        <module name="RedundantImport"/>
        <module name="UnusedImports">
            <property name="processJavadoc" value="true"/>
        </module>

        <!-- Checks for Size Violations.                    -->
        <!-- See http://checkstyle.sf.net/config_sizes.html -->
        <module name="LineLength">
            <property name="max" value="100"/>
        </module>
        <module name="MethodLength">
            <property name="max" value="200"/>
        </module>
            
        <!--module name="ParameterNumber"/-->


        <!-- Checks for whitespace                               -->
        <!-- See http://checkstyle.sf.net/config_whitespace.html -->
        <module name="GenericWhitespace"/>
        <module name="EmptyForIteratorPad"/>
        <module name="MethodParamPad"/>
        <module name="NoWhitespaceAfter"/>
        <module name="NoWhitespaceBefore"/>
        <module name="OperatorWrap"/>
        <module name="ParenPad"/>
        <module name="TypecastParenPad"/>
        <module name="WhitespaceAfter"/>
        <module name="WhitespaceAround"/>


        <!-- Modifier Checks                                    -->
        <!-- See http://checkstyle.sf.net/config_modifiers.html -->
        <!--module name="ModifierOrder"/-->
        <module name="RedundantModifier"/>


        <!-- Checks for blocks. You know, those {}'s         -->
        <!-- See http://checkstyle.sf.net/config_blocks.html -->
        <!--module name="AvoidNestedBlocks"/-->
        <!--module name="EmptyBlock"/-->
        <module name="LeftCurly"/>
        <!--module name="NeedBraces"/-->
        <module name="RightCurly"/>


        <!-- Checks for common coding problems               -->
        <!-- See http://checkstyle.sf.net/config_coding.html -->
        <!--module name="AvoidInlineConditionals"/-->
        <module name="CovariantEquals"/>
        <module name="EmptyStatement"/>
        <!--<module name="EqualsAvoidNull"/>-->
        <module name="EqualsHashCode"/>
        <!--module name="HiddenField"/-->
        <module name="IllegalInstantiation"/>
        <!--<module name="InnerAssignment"/>-->
        <!--module name="MagicNumber"/-->
        <module name="MissingSwitchDefault"/>
        <module name="RedundantThrows"/>
        <module name="SimplifyBooleanExpression"/>
        <module name="SimplifyBooleanReturn"/>

        <!-- Checks for class design                         -->
        <!-- See http://checkstyle.sf.net/config_design.html -->
        <!--module name="DesignForExtension"/-->
        <!--module name="FinalClass"/-->
        <!--module name="HideUtilityClassConstructor"/-->
        <!--module name="InterfaceIsType"/-->
        <!--module name="VisibilityModifier"/-->


        <!-- Miscellaneous other checks.                   -->
        <!-- See http://checkstyle.sf.net/config_misc.html -->
        <!--module name="ArrayTypeStyle"/-->
        <!--module name="FinalParameters"/-->
        <!--module name="TodoComment"/-->
        <module name="UpperEll"/>
    </module>
</module>


================================================
FILE: compiler/pom.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<!--
 Copyright (C) 2012 Square, Inc.
 Copyright (C) 2012 Google, 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.
-->
<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>

  <parent>
    <groupId>com.squareup.dagger</groupId>
    <artifactId>dagger-parent</artifactId>
    <version>1.2.6-SNAPSHOT</version>
    <relativePath>../pom.xml</relativePath>
  </parent>

  <artifactId>dagger-compiler</artifactId>
  <name>Dagger Compiler</name>
  <description>
    Tools to generate Dagger injection and module adapters from annotated code and validate them.
  </description>

  <dependencies>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>dagger</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>com.squareup</groupId>
      <artifactId>javapoet</artifactId>
    </dependency>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
    </dependency>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>dagger</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
      <classifier>tests</classifier>
    </dependency>
    <dependency>
      <groupId>com.google.testing.compile</groupId>
      <artifactId>compile-testing</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.google.truth</groupId>
      <artifactId>truth</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <executions>
          <execution>
            <id>default-compile</id>
            <goals><goal>compile</goal></goals>
            <configuration>
              <compilerArgument>-proc:none</compilerArgument>
            </configuration>
          </execution>
          <execution>
            <id>default-test-compile</id>
            <goals><goal>testCompile</goal></goals>
            <configuration>
              <annotationProcessors>
                <annotationProcessor>dagger.internal.codegen.ValidationProcessor</annotationProcessor>
                <annotationProcessor>dagger.internal.codegen.InjectAdapterProcessor</annotationProcessor>
                <annotationProcessor>dagger.internal.codegen.ModuleAdapterProcessor</annotationProcessor>
                <annotationProcessor>dagger.internal.codegen.GraphAnalysisProcessor</annotationProcessor>
              </annotationProcessors>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-invoker-plugin</artifactId>
        <configuration>
          <addTestClassPath>true</addTestClassPath>
          <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
          <pomIncludes>
            <pomInclude>*/pom.xml</pomInclude>
          </pomIncludes>
          <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
          <postBuildHookScript>verify</postBuildHookScript>
          <filterProperties>
            <dagger.version>${project.version}</dagger.version>
            <dagger.groupId>${project.groupId}</dagger.groupId>
          </filterProperties>
        </configuration>
        <executions>
          <execution>
            <id>integration-test</id>
            <goals>
              <goal>install</goal>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <configuration>
          <descriptorRefs>
            <descriptorRef>jar-with-dependencies</descriptorRef>
          </descriptorRefs>
        </configuration>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>


================================================
FILE: compiler/src/it/default-package-injected-type/pom.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<!--
 Copyright (C) 2012 Square, Inc.
 Copyright (C) 2012 Google, 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.
-->
<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.example.dagger.tests</groupId>
  <artifactId>default-package-injected-type</artifactId>
  <version>HEAD-SNAPSHOT</version>
  <name>Default Package Injected Type</name>
  <dependencies>
    <dependency>
      <groupId>@dagger.groupId@</groupId>
      <artifactId>dagger</artifactId>
      <version>@dagger.version@</version>
    </dependency>
    <dependency>
      <groupId>@dagger.groupId@</groupId>
      <artifactId>dagger-compiler</artifactId>
      <version>@dagger.version@</version>
      <optional>true</optional>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
          <source>1.5</source>
          <target>1.5</target>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>


================================================
FILE: compiler/src/it/default-package-injected-type/src/main/java/TestApp.java
================================================
/*
 * Copyright (C) 2012 Google, Inc.
 * Copyright (C) 2012 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.
 */

import dagger.ObjectGraph;
import dagger.Module;
import javax.inject.Inject;
import javax.inject.Singleton;

class TestApp implements Runnable {
  @Inject A a;

  @Override public void run() {
    a.doit();
  }

  public static void main(String[] args) {
    ObjectGraph.create(new TestModule()).get(TestApp.class).run();
  }
  
  @Module(injects = { TestApp.class })
  static class TestModule {}

  @Singleton
  static class A {
    @Inject A() {}
    public void doit() {};
  }
}


================================================
FILE: compiler/src/it/extension-graph/pom.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<!--
 Copyright (C) 2012 Square, Inc.
 Copyright (C) 2012 Google, 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.
-->
<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.example.dagger.tests</groupId>
  <artifactId>extension-graph</artifactId>
  <version>HEAD-SNAPSHOT</version>
  <name>Dagger Integration Test Basic</name>
  <dependencies>
    <dependency>
      <groupId>@dagger.groupId@</groupId>
      <artifactId>dagger</artifactId>
      <version>@dagger.version@</version>
    </dependency>
    <dependency>
      <groupId>@dagger.groupId@</groupId>
      <artifactId>dagger-compiler</artifactId>
      <version>@dagger.version@</version>
      <optional>true</optional>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
          <source>1.5</source>
          <target>1.5</target>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>


================================================
FILE: compiler/src/it/extension-graph/src/main/java/test/TestApp.java
================================================
/*
 * Copyright (C) 2012 Google, Inc.
 * Copyright (C) 2012 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 test;

import dagger.ObjectGraph;
import dagger.Module;
import javax.inject.Inject;
import javax.inject.Singleton;

class TestApp implements Runnable {
  @Inject C c;

  @Override public void run() {
    c.doit();
  }

  public static void main(String[] args) {
    ObjectGraph root = ObjectGraph.create(new RootModule());
    ObjectGraph extension = root.plus(new ExtensionModule());
    extension.get(TestApp.class).run();
  }
  
  @Module(injects = { A.class, B.class })
  static class RootModule { }

  @Module(addsTo=RootModule.class, injects = { C.class, TestApp.class })
  static class ExtensionModule { }

  @Singleton
  static class A {
    @Inject A() {}
  }

  static class B {
    @Inject A a;
    @Inject B() {}
  }

  static class C {
    @Inject A a;
    @Inject B b;
    @Inject C() {}
    public void doit() {};
  }
}


================================================
FILE: compiler/src/it/extension-graph-setvalues/pom.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<!--
 Copyright (C) 2013 Square, Inc.
 Copyright (C) 2013 Google, 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.
-->
<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.example.dagger.tests</groupId>
  <artifactId>extension-graph-setvalues</artifactId>
  <version>HEAD-SNAPSHOT</version>
  <name>Dagger Integration Test Basic</name>
  <dependencies>
    <dependency>
      <groupId>@dagger.groupId@</groupId>
      <artifactId>dagger</artifactId>
      <version>@dagger.version@</version>
    </dependency>
    <dependency>
      <groupId>@dagger.groupId@</groupId>
      <artifactId>dagger-compiler</artifactId>
      <version>@dagger.version@</version>
      <optional>true</optional>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
          <source>1.5</source>
          <target>1.5</target>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>


================================================
FILE: compiler/src/it/extension-graph-setvalues/src/main/java/test/TestApp.java
================================================
/*
 * Copyright (C) 2013 Google, Inc.
 * 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 test;

import dagger.ObjectGraph;
import dagger.Module;
import dagger.Provides;
import java.util.HashSet;
import java.util.Set;
import javax.inject.Inject;
import javax.inject.Provider;
import javax.inject.Singleton;

import static dagger.Provides.Type.SET;
import static dagger.Provides.Type.SET_VALUES;

/**
 * Contributions to {@code SET_VALUES} binding do not affect Set of providers.
 */
class TestApp implements Runnable {
  @Inject Set<Provider<String>> providers;
  @Inject Set<String> strings;

  @Override public void run() {
    System.out.println(strings);
  }

  public static void main(String[] args) {
    ObjectGraph root = ObjectGraph.create(new RootModule());
    ObjectGraph extension = root.plus(new ExtensionModule());
    extension.get(TestApp.class).run();
  }
  
  @Module(injects = TestApp.class)
  static class RootModule {
    @Provides Set<Provider<String>> providers() {
      return new HashSet<Provider<String>>();
    }
    @Provides(type = SET_VALUES) Set<String> strings() {
      return new HashSet<String>();
    }
  }

  @Module(addsTo = RootModule.class, injects = TestApp.class)
  static class ExtensionModule {
    @Provides(type = SET) String addToSet() {
      return "contributed";
    }
  }
}


================================================
FILE: compiler/src/it/final-field-inject/invoker.properties
================================================
invoker.buildResult=failure


================================================
FILE: compiler/src/it/final-field-inject/pom.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<!--
  Copyright (C) 2013 Google, Inc.
  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.
-->
<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.example.dagger.tests</groupId>
  <artifactId>final-field-inject</artifactId>
  <version>HEAD-SNAPSHOT</version>
  <dependencies>
    <dependency>
      <groupId>@dagger.groupId@</groupId>
      <artifactId>dagger</artifactId>
      <version>@dagger.version@</version>
    </dependency>
    <dependency>
      <groupId>@dagger.groupId@</groupId>
      <artifactId>dagger-compiler</artifactId>
      <version>@dagger.version@</version>
      <optional>true</optional>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
          <source>1.5</source>
          <target>1.5</target>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>


================================================
FILE: compiler/src/it/final-field-inject/src/main/java/test/TestApp.java
================================================
/*
 * Copyright (C) 2013 Google, Inc.
 * 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 test;

import javax.inject.Inject;

class TestApp {
  @Inject final Object nope;
}


================================================
FILE: compiler/src/it/final-field-inject/verify.bsh
================================================
import dagger.testing.it.BuildLogValidator;
import java.io.File;

File buildLog = new File(basedir, "build.log");
new BuildLogValidator().assertHasText(buildLog, new String[]{
    "Can't inject a final field: test.TestApp.nope"});


================================================
FILE: compiler/src/it/include-non-module/invoker.properties
================================================
invoker.buildResult=failure

================================================
FILE: compiler/src/it/include-non-module/pom.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<!--
 Copyright (C) 2013 Square, Inc.
 Copyright (C) 2013 Google, 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.
-->
<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.example.dagger.tests</groupId>
  <artifactId>include-non-module</artifactId>
  <version>HEAD-SNAPSHOT</version>
  <name>Dagger Integration Test Basic</name>
  <dependencies>
    <dependency>
      <groupId>@dagger.groupId@</groupId>
      <artifactId>dagger</artifactId>
      <version>@dagger.version@</version>
    </dependency>
    <dependency>
      <groupId>@dagger.groupId@</groupId>
      <artifactId>dagger-compiler</artifactId>
      <version>@dagger.version@</version>
      <optional>true</optional>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
          <source>1.5</source>
          <target>1.5</target>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>


================================================
FILE: compiler/src/it/include-non-module/src/main/java/test/TestApp.java
================================================
/*
 * 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 test;

import dagger.Module;
import dagger.ObjectGraph;
import dagger.Provides;
import javax.inject.Inject;
import java.lang.String;

class TestApp {
  public static void main(String[] args) {
    TestApp app = ObjectGraph.create(new TestModule()).get(TestApp.class);
  }

  @Inject String s;

  @Module(
      injects = TestApp.class,
      includes = TestApp.class)
  static class TestModule {
    @Provides String provideString() {
      return "a";
    }
  }
}


================================================
FILE: compiler/src/it/inject-on-class/invoker.properties
================================================
invoker.buildResult=failure

================================================
FILE: compiler/src/it/inject-on-class/pom.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<!--
  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.
-->
<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.example.dagger.tests</groupId>
  <artifactId>method-injection</artifactId>
  <version>HEAD-SNAPSHOT</version>
  <dependencies>
    <dependency>
      <groupId>@dagger.groupId@</groupId>
      <artifactId>dagger</artifactId>
      <version>@dagger.version@</version>
    </dependency>
    <dependency>
      <groupId>@dagger.groupId@</groupId>
      <artifactId>dagger-compiler</artifactId>
      <version>@dagger.version@</version>
      <optional>true</optional>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
          <source>1.5</source>
          <target>1.5</target>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>


================================================
FILE: compiler/src/it/inject-on-class/src/main/java/test/TestApp.java
================================================
/*
 * 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 test;

import javax.inject.Inject;

@Inject
class TestApp {
}


================================================
FILE: compiler/src/it/inject-on-class/verify.bsh
================================================
import dagger.testing.it.BuildLogValidator;
import java.io.File;

File buildLog = new File(basedir, "build.log");
new BuildLogValidator().assertHasText(buildLog, new String[]{
    "@Inject is not valid on a class: test.TestApp"});


================================================
FILE: compiler/src/it/inject-parameterized-type/pom.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<!--
 Copyright (C) 2013 Square, Inc.
 Copyright (C) 2013 Google, 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.
-->
<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.example.dagger.tests</groupId>
  <artifactId>inject-parameterized-type</artifactId>
  <version>HEAD-SNAPSHOT</version>
  <name>Dagger Integration Test Basic</name>
  <dependencies>
    <dependency>
      <groupId>@dagger.groupId@</groupId>
      <artifactId>dagger</artifactId>
      <version>@dagger.version@</version>
    </dependency>
    <dependency>
      <groupId>@dagger.groupId@</groupId>
      <artifactId>dagger-compiler</artifactId>
      <version>@dagger.version@</version>
      <optional>true</optional>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
          <source>1.5</source>
          <target>1.5</target>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>


================================================
FILE: compiler/src/it/inject-parameterized-type/src/main/java/test/TestApp.java
================================================
/*
 * 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 test;

import dagger.Module;
import dagger.ObjectGraph;
import dagger.Provides;
import javax.inject.Inject;

class TestApp {
  public static void main(String[] args) {
    Subtype subtype = ObjectGraph.create(new TestModule()).get(Subtype.class);
  }

  static class Supertype<T> {
    @Inject String s;
  }

  static class Subtype extends Supertype<Integer> {
  }

  @Module(injects = Subtype.class)
  static class TestModule {
    @Provides String provideString() {
      return "a";
    }
  }
}


================================================
FILE: compiler/src/it/inner-classes-complaint-injection/invoker.properties
================================================
invoker.buildResult=failure

================================================
FILE: compiler/src/it/inner-classes-complaint-injection/pom.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<!--
  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.
-->
<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.example.dagger.tests</groupId>
  <artifactId>inner-classes-complaint-injection</artifactId>
  <version>HEAD-SNAPSHOT</version>
  <name>Dagger Integration Test Basic</name>
  <dependencies>
    <dependency>
      <groupId>@dagger.groupId@</groupId>
      <artifactId>dagger</artifactId>
      <version>@dagger.version@</version>
    </dependency>
    <dependency>
      <groupId>@dagger.groupId@</groupId>
      <artifactId>dagger-compiler</artifactId>
      <version>@dagger.version@</version>
      <optional>true</optional>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
          <source>1.5</source>
          <target>1.5</target>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>


================================================
FILE: compiler/src/it/inner-classes-complaint-injection/src/main/java/test/TestApp.java
================================================
/*
 * 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 test;

import dagger.Module;

import dagger.ObjectGraph;
import dagger.Provides;

import javax.inject.Inject;
import java.lang.Override;

class TestApp {

  class Foo {
    @Inject public Foo() {}
  }
}


================================================
FILE: compiler/src/it/inner-classes-complaint-injection/verify.bsh
================================================
import dagger.testing.it.BuildLogValidator;
import java.io.File;

File buildLog = new File(basedir, "build.log");
new BuildLogValidator().assertHasText(buildLog, new String[]{
    "Can't inject a non-static inner class: test.TestApp.Foo"});


================================================
FILE: compiler/src/it/method-injection/invoker.properties
================================================
invoker.buildResult=failure

================================================
FILE: compiler/src/it/method-injection/pom.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<!--
  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.
-->
<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.example.dagger.tests</groupId>
  <artifactId>method-injection</artifactId>
  <version>HEAD-SNAPSHOT</version>
  <dependencies>
    <dependency>
      <groupId>@dagger.groupId@</groupId>
      <artifactId>dagger</artifactId>
      <version>@dagger.version@</version>
    </dependency>
    <dependency>
      <groupId>@dagger.groupId@</groupId>
      <artifactId>dagger-compiler</artifactId>
      <version>@dagger.version@</version>
      <optional>true</optional>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
          <source>1.5</source>
          <target>1.5</target>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>


================================================
FILE: compiler/src/it/method-injection/src/main/java/test/TestApp.java
================================================
/*
 * 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 test;

import javax.inject.Inject;

class TestApp {
  @Inject public void doThings(Object things) {
  }
}


================================================
FILE: compiler/src/it/method-injection/verify.bsh
================================================
import dagger.testing.it.BuildLogValidator;
import java.io.File;

File buildLog = new File(basedir, "build.log");
new BuildLogValidator().assertHasText(buildLog, new String[]{
    "Method injection is not supported: test.TestApp.doThings"});


================================================
FILE: compiler/src/it/missing-at-inject-constructor/invoker.properties
================================================
invoker.buildResult=failure

================================================
FILE: compiler/src/it/missing-at-inject-constructor/pom.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<!--
 Copyright (C) 2012 Square, Inc.
 Copyright (C) 2012 Google, 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.
-->
<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.example.dagger.tests</groupId>
  <artifactId>missing-at-inject-constructor</artifactId>
  <version>HEAD-SNAPSHOT</version>
  <name>Dagger Integration Test Basic</name>
  <dependencies>
    <dependency>
      <groupId>@dagger.groupId@</groupId>
      <artifactId>dagger</artifactId>
      <version>@dagger.version@</version>
    </dependency>
    <dependency>
      <groupId>@dagger.groupId@</groupId>
      <artifactId>dagger-compiler</artifactId>
      <version>@dagger.version@</version>
      <optional>true</optional>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
          <source>1.5</source>
          <target>1.5</target>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>


================================================
FILE: compiler/src/it/missing-at-inject-constructor/src/main/java/test/TestApp.java
================================================
/*
 * Copyright (C) 2012 Google, Inc.
 * Copyright (C) 2012 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 test;

import dagger.Module;

import dagger.ObjectGraph;
import javax.inject.Inject;

class TestApp implements Runnable {
  @Inject Dependency dep;

  @Override public void run() {
    dep.doit();
  }

  public static void main(String[] args) {
    ObjectGraph.create(new TestModule()).get(TestApp.class).run();
  }
  
  static class Dependency {
    // missing @Inject Dependency() {}
    public void doit() { throw AssertionError(); };
  }
  
  @Module(injects = TestApp.class)
  static class TestModule {
    /* missing */ // @Provides Dependency a() { return new Dependency(); }
  }
}


================================================
FILE: compiler/src/it/missing-at-inject-constructor/verify.bsh
================================================
import dagger.testing.it.BuildLogValidator;
import java.io.File;

File buildLog = new File(basedir, "build.log");
new BuildLogValidator().assertHasText(buildLog, new String[]{
    "No injectable members on test.TestApp.Dependency.", 
	"required by test.TestApp for test.TestApp.TestModule"});


================================================
FILE: compiler/src/it/module-type-validation/invoker.properties
================================================
invoker.buildResult=failure

================================================
FILE: compiler/src/it/module-type-validation/pom.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<!--
  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.
-->
<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.example.dagger.tests</groupId>
  <artifactId>module-type-validation</artifactId>
  <version>HEAD-SNAPSHOT</version>
  <dependencies>
    <dependency>
      <groupId>@dagger.groupId@</groupId>
      <artifactId>dagger</artifactId>
      <version>@dagger.version@</version>
    </dependency>
    <dependency>
      <groupId>@dagger.groupId@</groupId>
      <artifactId>dagger-compiler</artifactId>
      <version>@dagger.version@</version>
      <optional>true</optional>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
          <source>1.5</source>
          <target>1.5</target>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>


================================================
FILE: compiler/src/it/module-type-validation/src/main/java/test/TestModule.java
================================================
/*
 * 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 test;

import dagger.Module;

@Module
class ThreadModule extends Thread {
}

@Module
enum EnumModule {
}

@Module
interface InterfaceModule {
}


================================================
FILE: compiler/src/it/module-type-validation/verify.bsh
================================================
import dagger.testing.it.BuildLogValidator;
import java.io.File;

File buildLog = new File(basedir, "build.log");
new BuildLogValidator().assertHasText(buildLog, new String[]{
    "Modules must not extend from other classes: test.ThreadModule"});
new BuildLogValidator().assertHasText(buildLog, new String[]{
    "Modules must be classes: test.EnumModule"});
new BuildLogValidator().assertHasText(buildLog, new String[]{
    "Modules must be classes: test.InterfaceModule"});

================================================
FILE: compiler/src/it/multiple-modules-setvalues/pom.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<!--
 Copyright (C) 2013 Square, Inc.
 Copyright (C) 2013 Google, 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.
-->
<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.example.dagger.tests</groupId>
  <artifactId>multiple-modules-setvalues</artifactId>
  <version>HEAD-SNAPSHOT</version>
  <name>Dagger Integration Test Basic</name>
  <dependencies>
    <dependency>
      <groupId>@dagger.groupId@</groupId>
      <artifactId>dagger</artifactId>
      <version>@dagger.version@</version>
    </dependency>
    <dependency>
      <groupId>@dagger.groupId@</groupId>
      <artifactId>dagger-compiler</artifactId>
      <version>@dagger.version@</version>
      <optional>true</optional>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
          <source>1.5</source>
          <target>1.5</target>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>


================================================
FILE: compiler/src/it/multiple-modules-setvalues/src/main/java/test/TestApp.java
================================================
/*
 * Copyright (C) 2013 Google, Inc.
 * 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 test;

import dagger.ObjectGraph;
import dagger.Module;
import dagger.Provides;
import java.util.HashSet;
import java.util.Set;
import javax.inject.Inject;
import javax.inject.Provider;
import javax.inject.Singleton;

import static dagger.Provides.Type.SET;
import static dagger.Provides.Type.SET_VALUES;

/**
 * Contributions to {@code SET_VALUES} binding do not affect Set of providers.
 */
class TestApp implements Runnable {
  @Inject Set<Provider<String>> providers;
  @Inject Set<String> strings;

  @Override public void run() {
    System.out.println(strings);
  }

  public static void main(String[] args) {
    ObjectGraph root = ObjectGraph.create(new RootModule(), new ContributingModule());
    root.get(TestApp.class).run();
  }
  
  @Module(injects = TestApp.class)
  static class RootModule {
    @Provides Set<Provider<String>> providers() {
      return new HashSet<Provider<String>>();
    }
    @Provides(type = SET_VALUES) Set<String> strings() {
      return new HashSet<String>();
    }
  }

  @Module(injects = TestApp.class, complete = false)
  static class ContributingModule {
    @Provides(type = SET) String addToSet() {
      return "contributed";
    }
  }
}


================================================
FILE: compiler/src/it/multiple-provides-methods/pom.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<!--
 Copyright (C) 2013 Square, Inc.
 Copyright (C) 2013 Google, 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.
-->
<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.example.dagger.tests</groupId>
  <artifactId>multiple-provides-methods</artifactId>
  <version>HEAD-SNAPSHOT</version>
  <name>Dagger Integration Test Basic</name>
  <dependencies>
    <dependency>
      <groupId>@dagger.groupId@</groupId>
      <artifactId>dagger</artifactId>
      <version>@dagger.version@</version>
    </dependency>
    <dependency>
      <groupId>@dagger.groupId@</groupId>
      <artifactId>dagger-compiler</artifactId>
      <version>@dagger.version@</version>
      <optional>true</optional>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
          <source>1.5</source>
          <target>1.5</target>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>


================================================
FILE: compiler/src/it/multiple-provides-methods/src/main/java/test/TestApp.java
================================================
/*
 * Copyright (C) 2013 Square, Inc.
 * Copyright (C) 2013 Google, 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 test;

import dagger.Module;
import dagger.Provides;
import javax.inject.Inject;

class TestApp {
  static class NotInjectable {
  }

  static class InjectableSubclass extends NotInjectable {
    @Inject String string;
    @Inject Integer integer;
  }

  @Module(injects = InjectableSubclass.class)
  static class TestModule {
    @Provides String string() {
      return "string";
    }
    @Provides Integer integer() {
      return 5;
    }
  }
}


================================================
FILE: compiler/src/it/multiple-provides-methods/verify.bsh
================================================
import java.io.File;

File classes = new File(basedir, "target/classes/test/");

File moduleAdapter = new File(classes, "TestApp$TestModule$$ModuleAdapter.class");
if (!moduleAdapter.exists()) throw new Exception("No binding generated for module");

File integerBinding = new File(classes, "TestApp$TestModule$$ModuleAdapter$IntegerProvidesAdapter.class");
if (!integerBinding.exists()) throw new Exception("No binding generated for integer()");

File stringBinding = new File(classes, "TestApp$TestModule$$ModuleAdapter$StringProvidesAdapter.class");
if (!stringBinding.exists()) throw new Exception("No binding generated for string()");


================================================
FILE: compiler/src/it/multiple-qualifiers/invoker.properties
================================================
invoker.buildResult=failure


================================================
FILE: compiler/src/it/multiple-qualifiers/pom.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<!--
  Copyright (C) 2013 Google, Inc.
  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.
-->
<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.example.dagger.tests</groupId>
  <artifactId>multiple-qualifiers</artifactId>
  <version>HEAD-SNAPSHOT</version>
  <dependencies>
    <dependency>
      <groupId>@dagger.groupId@</groupId>
      <artifactId>dagger</artifactId>
      <version>@dagger.version@</version>
    </dependency>
    <dependency>
      <groupId>@dagger.groupId@</groupId>
      <artifactId>dagger-compiler</artifactId>
      <version>@dagger.version@</version>
      <optional>true</optional>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
          <source>1.5</source>
          <target>1.5</target>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>


================================================
FILE: compiler/src/it/multiple-qualifiers/src/main/java/test/TestApp.java
================================================
/*
 * Copyright (C) 2013 Google, Inc.
 * 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 test;

import dagger.Module;
import dagger.Provides;
import java.lang.annotation.Retention;
import javax.inject.Inject;
import javax.inject.Singleton;
import javax.inject.Qualifier;

import static java.lang.annotation.RetentionPolicy.RUNTIME;

class TestApp {
  static class TestClass1 {
    @Inject
    @MyQualifier1
    @MyQualifier2
    String field;
  }

  static class TestClass2 {
    String string;

    public TestClass2(@MyQualifier1 @MyQualifier2 String constructorParam) {
      this.string = string;
    }
  }

  @Module(injects = TestClass1.class)
  static class TestModule {
    @MyQualifier1
    @MyQualifier2
    @Provides
    String providesString() {
      return "string";
    }
  }
 
  @Qualifier
  @Retention(value = RUNTIME)
  @interface MyQualifier1 {}
 
  @Qualifier
  @Retention(value = RUNTIME)
  @interface MyQualifier2 {}
}


================================================
FILE: compiler/src/it/multiple-qualifiers/verify.bsh
================================================
import dagger.testing.it.BuildLogValidator;
import java.io.File;

File buildLog = new File(basedir, "build.log");
new BuildLogValidator().assertHasText(buildLog, new String[]{
    "Only one qualifier annotation is allowed per element: test.TestApp.TestClass1.field"});
new BuildLogValidator().assertHasText(buildLog, new String[]{
    "Only one qualifier annotation is allowed per element: constructorParam"});   
new BuildLogValidator().assertHasText(buildLog, new String[]{
    "Only one qualifier annotation is allowed per element: test.TestApp.TestModule.providesString()"});


================================================
FILE: compiler/src/it/private-inject/invoker.properties
================================================
invoker.buildResult=failure

================================================
FILE: compiler/src/it/private-inject/pom.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<!--
  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.
-->
<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.example.dagger.tests</groupId>
  <artifactId>private-inject</artifactId>
  <version>HEAD-SNAPSHOT</version>
  <dependencies>
    <dependency>
      <groupId>@dagger.groupId@</groupId>
      <artifactId>dagger</artifactId>
      <version>@dagger.version@</version>
    </dependency>
    <dependency>
      <groupId>@dagger.groupId@</groupId>
      <artifactId>dagger-compiler</artifactId>
      <version>@dagger.version@</version>
      <optional>true</optional>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
          <source>1.5</source>
          <target>1.5</target>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>


================================================
FILE: compiler/src/it/private-inject/src/main/java/test/TestApp.java
================================================
/*
 * 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 test;

import javax.inject.Inject;

class TestApp {
  @Inject private Object nope;
}


================================================
FILE: compiler/src/it/private-inject/src/main/java/test/TestFoo.java
================================================
/*
 * 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 test;

import javax.inject.Inject;

class TestFoo {
  @Inject private TestFoo() {
  }
}


================================================
FILE: compiler/src/it/private-inject/verify.bsh
================================================
import dagger.testing.it.BuildLogValidator;
import java.io.File;

File buildLog = new File(basedir, "build.log");
new BuildLogValidator().assertHasText(buildLog, new String[]{
    "Can't inject a private field: test.TestApp.nope"});
new BuildLogValidator().assertHasText(buildLog, new String[]{
    "Can't inject a private constructor: test.TestFoo.TestFoo()"});


================================================
FILE: compiler/src/it/provide-provider-or-lazy/invoker.properties
================================================
invoker.buildResult=failure

================================================
FILE: compiler/src/it/provide-provider-or-lazy/pom.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<!--
  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.
-->
<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.example.dagger.tests</groupId>
  <artifactId>provide-provider-or-lazy</artifactId>
  <version>HEAD-SNAPSHOT</version>
  <dependencies>
    <dependency>
      <groupId>@dagger.groupId@</groupId>
      <artifactId>dagger</artifactId>
      <version>@dagger.version@</version>
    </dependency>
    <dependency>
      <groupId>@dagger.groupId@</groupId>
      <artifactId>dagger-compiler</artifactId>
      <version>@dagger.version@</version>
      <optional>true</optional>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
          <source>1.5</source>
          <target>1.5</target>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>


================================================
FILE: compiler/src/it/provide-provider-or-lazy/src/main/java/test/TestModule.java
================================================
/*
 * 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 test;

import dagger.Lazy;
import dagger.Module;
import dagger.Provides;
import javax.inject.Provider;

@Module class TestModule {
  @Provides Provider<Object> provideProvider() {
    return null;
  }

  @Provides Provider provideRawProvider() {
    return null;
  }

  @Provides Lazy<Object> provideLazy() {
    return null;
  }

  @Provides Lazy provideRawLazy() {
    return null;
  }
}


================================================
FILE: compiler/src/it/provide-provider-or-lazy/verify.bsh
================================================
import dagger.testing.it.BuildLogValidator;
import java.io.File;

File buildLog = new File(basedir, "build.log");
new BuildLogValidator().assertHasText(buildLog, new String[]{
    "@Provides method must not return javax.inject.Provider directly: test.TestModule.provideProvider"});
new BuildLogValidator().assertHasText(buildLog, new String[]{
    "@Provides method must not return javax.inject.Provider directly: test.TestModule.provideRawProvider"});
new BuildLogValidator().assertHasText(buildLog, new String[]{
    "@Provides method must not return dagger.Lazy directly: test.TestModule.provideLazy"});
new BuildLogValidator().assertHasText(buildLog, new String[]{
    "@Provides method must not return dagger.Lazy directly: test.TestModule.provideRawLazy"});


================================================
FILE: compiler/src/it/provides-method-not-in-module/invoker.properties
================================================
invoker.buildResult=failure


================================================
FILE: compiler/src/it/provides-method-not-in-module/pom.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<!--
  Copyright (C) 2013 Google, Inc.
  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.
-->
<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.example.dagger.tests</groupId>
  <artifactId>provides-method-not-in-module</artifactId>
  <version>HEAD-SNAPSHOT</version>
  <dependencies>
    <dependency>
      <groupId>@dagger.groupId@</groupId>
      <artifactId>dagger</artifactId>
      <version>@dagger.version@</version>
    </dependency>
    <dependency>
      <groupId>@dagger.groupId@</groupId>
      <artifactId>dagger-compiler</artifactId>
      <version>@dagger.version@</version>
      <optional>true</optional>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
          <source>1.5</source>
          <target>1.5</target>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>


================================================
FILE: compiler/src/it/provides-method-not-in-module/src/main/java/test/TestApp.java
================================================
/*
 * Copyright (C) 2013 Google, Inc.
 * 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 test;

import dagger.Provides;

class TestApp {

  @Provides
  String providesString() {
    return "string";
  }
}


================================================
FILE: compiler/src/it/provides-method-not-in-module/verify.bsh
================================================
import dagger.testing.it.BuildLogValidator;
import java.io.File;

File buildLog = new File(basedir, "build.log");
new BuildLogValidator().assertHasText(buildLog, new String[]{
    "@Provides methods must be declared in modules: test.TestApp.providesString()"});


================================================
FILE: compiler/src/it/provides-method-with-throws-clause/invoker.properties
================================================
invoker.buildResult=failure

================================================
FILE: compiler/src/it/provides-method-with-throws-clause/pom.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<!--
 Copyright (C) 2013 Square, Inc.
 Copyright (C) 2013 Google, 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.
-->
<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.example.dagger.tests</groupId>
  <artifactId>provides-method-with-throws-clause</artifactId>
  <version>HEAD-SNAPSHOT</version>
  <name>Dagger Integration Test Basic</name>
  <dependencies>
    <dependency>
      <groupId>@dagger.groupId@</groupId>
      <artifactId>dagger</artifactId>
      <version>@dagger.version@</version>
    </dependency>
    <dependency>
      <groupId>@dagger.groupId@</groupId>
      <artifactId>dagger-compiler</artifactId>
      <version>@dagger.version@</version>
      <optional>true</optional>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
          <source>1.5</source>
          <target>1.5</target>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>


================================================
FILE: compiler/src/it/provides-method-with-throws-clause/src/main/java/test/TestApp.java
================================================
/*
 * Copyright (C) 2013 Google, Inc.
 * 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 test;

import dagger.Module;

import dagger.ObjectGraph;
import dagger.Provides;

import javax.inject.Inject;
import java.io.IOException;
import java.lang.Override;

class TestApp implements Runnable {

  @Inject String string;

  @Override public void run() {
    // Yay! \o/
  }

  public static void main(String[] args) {
    ObjectGraph.create(new TestModule()).get(TestApp.class).run();
  }

  @Module(injects = TestApp.class)
  static class TestModule {

    @Provides String string() throws IOException {
      return "string";
    }
  }
}


================================================
FILE: compiler/src/it/provides-method-with-throws-clause/verify.bsh
================================================
import dagger.testing.it.BuildLogValidator;
import java.io.File;

File buildLog = new File(basedir, "build.log");
new BuildLogValidator().assertHasText(buildLog, new String[]{
    "@Provides methods must not have a throws clause"});


================================================
FILE: compiler/src/it/qualifiers-on-invalid-elements-errors/invoker.properties
================================================
invoker.buildResult=failure


================================================
FILE: compiler/src/it/qualifiers-on-invalid-elements-errors/pom.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<!--
  Copyright (C) 2013 Google, Inc.
  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.
-->
<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.example.dagger.tests</groupId>
  <artifactId>qualifiers-on-invalid-elements-errors</artifactId>
  <version>HEAD-SNAPSHOT</version>
  <dependencies>
    <dependency>
      <groupId>@dagger.groupId@</groupId>
      <artifactId>dagger</artifactId>
      <version>@dagger.version@</version>
    </dependency>
    <dependency>
      <groupId>@dagger.groupId@</groupId>
      <artifactId>dagger-compiler</artifactId>
      <version>@dagger.version@</version>
      <optional>true</optional>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
          <source>1.5</source>
          <target>1.5</target>
          <showWarnings>true</showWarnings>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>


================================================
FILE: compiler/src/it/qualifiers-on-invalid-elements-errors/src/main/java/test/TestApp.java
================================================
/*
 * Copyright (C) 2013 Google, Inc.
 * 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 test;

import dagger.Module;
import dagger.Provides;
import java.lang.annotation.Retention;
import javax.inject.Inject;
import javax.inject.Qualifier;

import static java.lang.annotation.RetentionPolicy.RUNTIME;

class TestApp {

  @MyQualifier
  static class TestClass1 {
    
    @MyQualifier // qualifier on non-injectable constructor
    public TestClass1(String constructorParam) {}
  }
  
  static class TestClass2 {
    String string;
    
    @Inject
    @MyQualifier // qualifier on injectable constructor
    public TestClass2(String injectableConstructorParam) {
      this.string = string;
    }  
  }
  
  @Qualifier
  @Retention(value = RUNTIME)
  @interface MyQualifier {}
}


================================================
FILE: compiler/src/it/qualifiers-on-invalid-elements-errors/verify.bsh
================================================
import dagger.testing.it.BuildLogValidator;
import java.io.File;

File buildLog = new File(basedir, "build.log");
new BuildLogValidator().assertHasText(buildLog, new String[]{
    "Qualifier annotations are only allowed on fields, methods, and parameters: test.TestApp.TestClass1"});   
new BuildLogValidator().assertHasText(buildLog, new String[]{
    "Qualifier annotations are only allowed on fields, methods, and parameters: test.TestApp.TestClass1.TestClass1(java.lang.String)"});   
new BuildLogValidator().assertHasText(buildLog, new String[]{
    "Qualifier annotations are only allowed on fields, methods, and parameters: test.TestApp.TestClass2.TestClass2(java.lang.String)"});


================================================
FILE: compiler/src/it/qualifiers-on-invalid-elements-warnings/pom.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<!--
  Copyright (C) 2013 Google, Inc.
  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.
-->
<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.example.dagger.tests</groupId>
  <artifactId>qualifiers-on-invalid-elements-warnings</artifactId>
  <version>HEAD-SNAPSHOT</version>
  <dependencies>
    <dependency>
      <groupId>@dagger.groupId@</groupId>
      <artifactId>dagger</artifactId>
      <version>@dagger.version@</version>
    </dependency>
    <dependency>
      <groupId>@dagger.groupId@</groupId>
      <artifactId>dagger-compiler</artifactId>
      <version>@dagger.version@</version>
      <optional>true</optional>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
          <source>1.5</source>
          <target>1.5</target>
          <showWarnings>true</showWarnings>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>


================================================
FILE: compiler/src/it/qualifiers-on-invalid-elements-warnings/src/main/java/test/TestApp.java
================================================
/*
 * Copyright (C) 2013 Google, Inc.
 * 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 test;

import dagger.Module;
import dagger.Provides;
import java.lang.annotation.Retention;
import javax.inject.Inject;
import javax.inject.Qualifier;

import static java.lang.annotation.RetentionPolicy.RUNTIME;

class TestApp {

  static class TestClass {
    @MyQualifier int field1; // non-injectable field
    
    @SuppressWarnings("some string other than 'qualifiers'")
    @MyQualifier 
    int field2;
    
    @SuppressWarnings("qualifiers")
    @MyQualifier 
    int fieldWithWarningSuppressed1;
    
    @SuppressWarnings({"foo", "qualifiers", "bar"})
    @MyQualifier 
    int fieldWithWarningSuppressed2;
    
    // qualifier on non-injectable constructor parameter
    public TestClass(@MyQualifier String constructorParam) {}
    
    @MyQualifier 
    void nonProvidesMethod(@MyQualifier String methodParam) {}
  }
  
  @Qualifier
  @Retention(value = RUNTIME)
  @interface MyQualifier {}
}


================================================
FILE: compiler/src/it/qualifiers-on-invalid-elements-warnings/verify.bsh
================================================
import dagger.testing.it.BuildLogValidator;
import java.io.File;

File buildLog = new File(basedir, "build.log");
new BuildLogValidator().assertHasText(buildLog, new String[]{
    "Dagger will ignore qualifier annotations on fields that are not annotated with @Inject: test.TestApp.TestClass.field1"});   
new BuildLogValidator().assertHasText(buildLog, new String[]{
    "Dagger will ignore qualifier annotations on fields that are not annotated with @Inject: test.TestApp.TestClass.field2"});   
new BuildLogValidator().assertHasText(buildLog, new String[]{
    "Dagger will ignore qualifier annotations on methods that are not @Provides methods: test.TestApp.TestClass.nonProvidesMethod(java.lang.String)"});  
new BuildLogValidator().assertHasText(buildLog, new String[]{
    "Dagger will ignore qualifier annotations on parameters that are not @Inject constructor parameters or @Provides method parameters: methodParam"});  
new BuildLogValidator().assertHasText(buildLog, new String[]{
    "Dagger will ignore qualifier annotations on parameters that are not @Inject constructor parameters or @Provides method parameters: constructorParam"});
new BuildLogValidator().assertDoesNotHaveText(buildLog, new String[]{
    "Dagger will ignore qualifier annotations on fields that are not annotated with @Inject: test.TestApp.TestClass.fieldWithWarningSuppressed1"});
new BuildLogValidator().assertDoesNotHaveText(buildLog, new String[]{
    "Dagger will ignore qualifier annotations on fields that are not annotated with @Inject: test.TestApp.TestClass.fieldWithWarningSuppressed2"});


================================================
FILE: compiler/src/it/same-provides-method-name/pom.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<!--
 Copyright (C) 2012 Square, Inc.
 Copyright (C) 2012 Google, 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.
-->
<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.example.dagger.tests</groupId>
  <artifactId>same-provides-method-name</artifactId>
  <version>HEAD-SNAPSHOT</version>
  <name>Dagger Integration Test Basic</name>
  <dependencies>
    <dependency>
      <groupId>@dagger.groupId@</groupId>
      <artifactId>dagger</artifactId>
      <version>@dagger.version@</version>
    </dependency>
    <dependency>
      <groupId>@dagger.groupId@</groupId>
      <artifactId>dagger-compiler</artifactId>
      <version>@dagger.version@</version>
      <optional>true</optional>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
          <source>1.5</source>
          <target>1.5</target>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>


================================================
FILE: compiler/src/it/same-provides-method-name/src/main/java/test/TestApp.java
================================================
/*
 * Copyright (C) 2012 Google, Inc.
 * Copyright (C) 2012 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 test;

import dagger.Module;

import dagger.ObjectGraph;
import dagger.Provides;

import javax.inject.Inject;
import java.lang.Override;

class TestApp implements Runnable {

  @Inject Foo foo;

  @Override public void run() {
    // Yay! \o/
  }

  public static void main(String[] args) {
    ObjectGraph.create(new TestModule()).get(TestApp.class).run();
  }

  static class Foo {
  }

  static class MyFoo extends Foo {
  }

  @Module(injects = TestApp.class)
  static class TestModule {

    @Provides Foo providesFoo(MyFoo foo) {
      return foo;
    }

    @Provides MyFoo providesFoo() {
      return new MyFoo();
    }
  }
}


================================================
FILE: compiler/src/it/static-injected-binding-doesnt-fail-providers/pom.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<!--
  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.
-->
<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.squareup.dagger.tests</groupId>
  <artifactId>static-injected-binding-doesnt-fail-providers</artifactId>
  <version>@dagger.version@</version>
  <packaging>jar</packaging>
  <name>Dagger Integration Test Basic</name>
  <dependencies>
    <dependency>
      <groupId>@dagger.groupId@</groupId>
      <artifactId>dagger</artifactId>
      <version>@dagger.version@</version>
    </dependency>
    <dependency>
      <groupId>@dagger.groupId@</groupId>
      <artifactId>dagger-compiler</artifactId>
      <version>@dagger.version@</version>
      <optional>true</optional>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
          <source>1.5</source>
          <target>1.5</target>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>


================================================
FILE: compiler/src/it/static-injected-binding-doesnt-fail-providers/src/main/java/test/Test.java
================================================
/*
 * 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 test;

import dagger.Module;

import dagger.ObjectGraph;
import dagger.Provides;
import javax.inject.Inject;

import java.lang.Override;

public class Test {

  public static class InjectsOneField {
    @Inject static String staticallyInjectedString;
  }

  @Module(staticInjections = { InjectsOneField.class })
  public static class TestModule {
    @Provides String string() {
      return "string";
    }
  }
}


================================================
FILE: compiler/src/it/uninjectable-supertype/pom.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<!--
 Copyright (C) 2012 Square, Inc.
 Copyright (C) 2012 Google, 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.
-->
<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.example.dagger.tests</groupId>
  <artifactId>uninjectable-supertype</artifactId>
  <version>HEAD-SNAPSHOT</version>
  <name>Dagger Integration Test Basic</name>
  <dependencies>
    <dependency>
      <groupId>@dagger.groupId@</groupId>
      <artifactId>dagger</artifactId>
      <version>@dagger.version@</version>
    </dependency>
    <dependency>
      <groupId>@dagger.groupId@</groupId>
      <artifactId>dagger-compiler</artifactId>
      <version>@dagger.version@</version>
      <optional>true</optional>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
          <source>1.5</source>
          <target>1.5</target>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>


================================================
FILE: compiler/src/it/uninjectable-supertype/src/main/java/test/TestApp.java
================================================
/*
 * Copyright (C) 2012 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 test;

import dagger.Module;
import dagger.Provides;
import javax.inject.Inject;

class TestApp {
  static class NotInjectable {
  }

  static class InjectableSubclass extends NotInjectable {
    @Inject String string;
  }

  @Module(injects = InjectableSubclass.class)
  static class TestModule {
    @Provides String provideString() {
      return "string";
    }
  }
}


================================================
FILE: compiler/src/it/valid-use-of-qualifiers/pom.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<!--
 Copyright (C) 2013 Google, Inc.
 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.
-->
<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.example.dagger.tests</groupId>
  <artifactId>valid-use-ofqualifiers</artifactId>
  <version>HEAD-SNAPSHOT</version>
  <name>Dagger Integration Test Basic</name>
  <dependencies>
    <dependency>
      <groupId>@dagger.groupId@</groupId>
      <artifactId>dagger</artifactId>
      <version>@dagger.version@</version>
    </dependency>
    <dependency>
      <groupId>@dagger.groupId@</groupId>
      <artifactId>dagger-compiler</artifactId>
      <version>@dagger.version@</version>
      <optional>true</optional>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
          <source>1.5</source>
          <target>1.5</target>
          <showWarnings>true</showWarnings>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>


================================================
FILE: compiler/src/it/valid-use-of-qualifiers/src/main/java/test/TestApp.java
================================================
/*
 * Copyright (C) 2013 Google, Inc.
 * 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 test;

import dagger.Module;
import dagger.Provides;
import java.lang.annotation.Retention;
import javax.inject.Inject;
import javax.inject.Qualifier;

import static java.lang.annotation.RetentionPolicy.RUNTIME;

class TestApp {
  static class TestClass1 {
    @Inject @MyQualifier1 String field;
  }
  
  static class TestClass2 {
    String string;
    
    @Inject
    public TestClass2(@MyQualifier1 String constructorParam) {
      this.string = string;
    }
  }

  @Module(injects = TestClass1.class)
  static class TestModule {

    @Provides
    @MyQualifier1
    String providesString(@MyQualifier2 String providesMethodParam) {
      return providesMethodParam + "foo";
    }
    
    @Provides
    @MyQualifier2
    String providesString() {
      return "foo";
    }
  }
  @Qualifier
  @Retention(value = RUNTIME)
  @interface MyQualifier1 {}
  
  @Qualifier
  @Retention(value = RUNTIME)
  @interface MyQualifier2 {}
}


================================================
FILE: compiler/src/main/java/dagger/internal/codegen/AdapterJavadocs.java
================================================
/*
 * Copyright (C) 2012 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 dagger.internal.codegen;

import com.squareup.javapoet.CodeBlock;
import com.squareup.javapoet.TypeName;

/**
 * Utility class providing some commonly used boilerplate between {@code InjectAdapterProcessor}
 * and {@code ModuleAdapterProcessor}.
 */
public final class AdapterJavadocs {
  static final String GENERATED_BY_DAGGER = "Code generated by dagger-compiler.  Do not edit.";
  static final String MEMBERS_INJECT_METHOD = ""
      + "Injects any {@code @Inject} annotated fields in the given instance,\n"
      + "satisfying the contract for {@code Provider<$T>}.\n";
  static final String GET_METHOD = ""
      + "Returns the fully provisioned instance satisfying the contract for\n"
      + "{@code Provider<$T>}.\n";
  static final String GET_DEPENDENCIES_METHOD = ""
      + "Used internally obtain dependency information, such as for cyclical\n"
      + "graph detection.\n";
  static final String ATTACH_METHOD = ""
      + "Used internally to link bindings/providers together at run time\n"
      + "according to their dependency graph.\n";
  static final String STATIC_INJECT_METHOD = ""
      + "Performs the injections of dependencies into static fields when requested by\n"
      + "the {@code $T}.\n";
  static final String MODULE_TYPE = ""
      + "A manager of modules and provides adapters allowing for proper linking and\n"
      + "instance provision of types served by {@code @$T} methods.\n";
  static final String STATIC_INJECTION_TYPE = ""
      + "A manager for {@code $T}'s injections into static fields.\n";

  /** Creates an appropriate javadoc depending on aspects of the type in question. */
  static CodeBlock bindingTypeDocs(
      TypeName type, boolean abstrakt, boolean members, boolean dependent) {
    CodeBlock.Builder result = CodeBlock.builder()
        .add("A {@code Binding<$T>} implementation which satisfies\n", type)
        .add("Dagger's infrastructure requirements including:\n");
    if (dependent) {
      result.add("\n")
          .add("Owning the dependency links between {@code $T} and its\n", type)
          .add("dependencies.\n");
    }
    if (!abstrakt) {
      result.add("\n")
          .add("Being a {@code Provider<$T>} and handling creation and\n", type)
          .add("preparation of object instances.\n");
    }
    if (members) {
      result.add("\n")
          .add("Being a {@code MembersInjector<$T>} and handling injection\n", type)
          .add("of annotated fields.\n");
    }
    return result.build();
  }
}


================================================
FILE: compiler/src/main/java/dagger/internal/codegen/GeneratorKeys.java
================================================
/*
 * Copyright (C) 2012 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 dagger.internal.codegen;

import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.inject.Qualifier;
import javax.lang.model.element.AnnotationMirror;
import javax.lang.model.element.AnnotationValue;
import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.VariableElement;
import javax.lang.model.type.TypeMirror;

import static dagger.internal.codegen.Util.rawTypeToString;
import static dagger.internal.codegen.Util.typeToString;

/**
 * Creates keys using javac's mirror APIs. Unlike {@code Keys}, this class uses
 * APIs not available on Android.
 */
final class GeneratorKeys {
  private static final String SET_PREFIX = Set.class.getCanonicalName() + "<";

  private GeneratorKeys() {
  }

  /**
   * Returns the members injector key for the raw type of {@code type}.
   * Parameterized types are not currently supported for members injection in
   * generated code.
   */
  public static String rawMembersKey(TypeMirror type) {
    return "members/" + rawTypeToString(type, '$');
  }

  /** Returns the provider key for {@code type}. */
  public static String get(TypeMirror type) {
    StringBuilder result = new StringBuilder();
    typeToString(type, result, '$');
    return result.toString();
  }

  /** Returns the provided key for {@code method}. */
  public static String get(ExecutableElement method) {
    StringBuilder result = new StringBuilder();
    AnnotationMirror qualifier = getQualifier(method.getAnnotationMirrors());
    if (qualifier != null) {
      qualifierToString(qualifier, result);
    }
    typeToString(method.getReturnType(), result, '$');
    return result.toString();
  }

  /** Returns the provided key for {@code method} wrapped by {@code Set}. */
  public static String getSetKey(ExecutableElement method) {
    StringBuilder result = new StringBuilder();
    AnnotationMirror qualifier = getQualifier(method.getAnnotationMirrors());
    if (qualifier != null) {
      qualifierToString(qualifier, result);
    }
    result.append(SET_PREFIX);
    typeToString(method.getReturnType(), result, '$');
    result.append(">");
    return result.toString();
  }

  /** Returns the provider key for {@code variable}. */
  public static String get(VariableElement variable) {
    StringBuilder result = new StringBuilder();
    AnnotationMirror qualifier = getQualifier(variable.getAnnotationMirrors());
    if (qualifier != null) {
      qualifierToString(qualifier, result);
    }
    typeToString(variable.asType(), result, '$');
    return result.toString();
  }

  private static void qualifierToString(AnnotationMirror qualifier, StringBuilder result) {
    // TODO: guarantee that element values are sorted by name (if there are multiple)
    result.append('@');
    typeToString(qualifier.getAnnotationType(), result, '$');
    result.append('(');
    for (Map.Entry<? extends ExecutableElement, ? extends AnnotationValue> entry
        : qualifier.getElementValues().entrySet()) {
      result.append(entry.getKey().getSimpleName());
      result.append('=');
      result.append(entry.getValue().getValue());
    }
    result.append(")/");
  }

  /** Does not test for multiple qualifiers. This is tested in {@code ValidationProcessor}.  */
  private static AnnotationMirror getQualifier(
      List<? extends AnnotationMirror> annotations) {
    AnnotationMirror qualifier = null;
    for (AnnotationMirror annotation : annotations) {
      if (annotation.getAnnotationType().asElement().getAnnotation(Qualifier.class) == null) {
        continue;
      }
      qualifier = annotation;
    }
    return qualifier;
  }
}


================================================
FILE: compiler/src/main/java/dagger/internal/codegen/GraphAnalysisErrorHandler.java
================================================
/*
 * Copyright (C) 2012 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 dagger.internal.codegen;

import dagger.internal.Linker;
import java.util.List;
import javax.annotation.processing.ProcessingEnvironment;
import javax.lang.model.element.TypeElement;
import javax.tools.Diagnostic;

/**
 * A {@code Linker.ErrorHandler} which gathers errors and reports them via a processing
 * environment.
 */
final class GraphAnalysisErrorHandler implements Linker.ErrorHandler {
  private final ProcessingEnvironment processingEnv;
  private final String moduleName;

  GraphAnalysisErrorHandler(ProcessingEnvironment processingEnv, String moduleName) {
    this.processingEnv = processingEnv;
    this.moduleName = moduleName;
  }

  @Override public void handleErrors(List<String> errors) {
    TypeElement module = processingEnv.getElementUtils().getTypeElement(moduleName);
    for (String error : errors) {
      processingEnv.getMessager().printMessage(Diagnostic.Kind.ERROR, error + " for " + moduleName,
          module);
    }
  }
}


================================================
FILE: compiler/src/main/java/dagger/internal/codegen/GraphAnalysisInjectBinding.java
================================================
/*
 * Copyright (C) 2012 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 dagger.internal.codegen;

import dagger.internal.Binding;
import dagger.internal.Linker;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import javax.inject.Inject;
import javax.inject.Singleton;
import javax.lang.model.element.Element;
import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.Modifier;
import javax.lang.model.element.TypeElement;
import javax.lang.model.element.VariableElement;
import javax.lang.model.type.TypeMirror;

import static dagger.internal.codegen.Util.getApplicationSupertype;

/**
 * A build time binding that injects the constructor and fields of a class.
 */
final class GraphAnalysisInjectBinding extends Binding<Object> {
  private final TypeElement type;
  private final List<String> keys;
  private final Binding<?>[] bindings;
  private final String supertypeKey;

  private GraphAnalysisInjectBinding(String provideKey, String membersKey,
      TypeElement type, List<String> keys, String supertypeKey) {
    super(provideKey, membersKey, type.getAnnotation(Singleton.class) != null,
        type.getQualifiedName().toString());
    this.type = type;
    this.keys = keys;
    this.bindings = new Binding<?>[keys.size()];
    this.supertypeKey = supertypeKey;
  }

  static GraphAnalysisInjectBinding create(TypeElement type, boolean mustHaveInjections) {
    List<String> requiredKeys = new ArrayList<String>();
    boolean hasInjectConstructor = false;
    boolean hasNoArgsConstructor = false;

    for (Element enclosed : type.getEnclosedElements()) {
      switch (enclosed.getKind()) {
      case FIELD:
        if (hasAtInject(enclosed) && !enclosed.getModifiers().contains(Modifier.STATIC)) {
          // Attach the non-static fields of 'type'.
          requiredKeys.add(GeneratorKeys.get((VariableElement) enclosed));
        }
        break;

      case CONSTRUCTOR:
        ExecutableElement constructor = (ExecutableElement) enclosed;
        List<? extends VariableElement> parameters = constructor.getParameters();
        if (hasAtInject(enclosed)) {
          if (hasAtSingleton(enclosed)) {
            throw new IllegalArgumentException("Singleton annotations have no effect on "
                + "constructors. Did you mean to annotate the class? "
                + type.getQualifiedName().toString());
          }
          if (hasInjectConstructor) {
            throw new IllegalArgumentException("Too many injectable constructors on "
                + type.getQualifiedName().toString());
          }
          hasInjectConstructor = true;
          for (VariableElement parameter : parameters) {
            requiredKeys.add(GeneratorKeys.get(parameter));
          }
        } else if (parameters.isEmpty()) {
          hasNoArgsConstructor = true;
        }
        break;

      default:
        if (hasAtInject(enclosed)) {
          throw new IllegalArgumentException("Unexpected @Inject annotation on " + enclosed);
        }
      }
    }

    if (!hasInjectConstructor && requiredKeys.isEmpty() && mustHaveInjections) {
      throw new IllegalArgumentException("No injectable members on "
          + type.getQualifiedName().toString() + ". Do you want to add an injectable constructor?");
    }

    // Attach the supertype.
    TypeMirror supertype = getApplicationSupertype(type);
    String supertypeKey = supertype != null
        ? GeneratorKeys.rawMembersKey(supertype)
        : null;

    String provideKey = hasInjectConstructor || (hasNoArgsConstructor && !requiredKeys.isEmpty())
        ? GeneratorKeys.get(type.asType())
        : null;
    String membersKey = GeneratorKeys.rawMembersKey(type.asType());
    return new GraphAnalysisInjectBinding(provideKey, membersKey, type, requiredKeys, supertypeKey);
  }

  private static boolean hasAtInject(Element enclosed) {
    return enclosed.getAnnotation(Inject.class) != null;
  }

  private static boolean hasAtSingleton(Element enclosed) {
    return enclosed.getAnnotation(Singleton.class) != null;
  }

  @Override public void attach(Linker linker) {
    String requiredBy = type.getQualifiedName().toString();
    for (int i = 0; i < keys.size(); i++) {
      bindings[i] = linker.requestBinding(keys.get(i), requiredBy,
          getClass().getClassLoader());
    }
    if (supertypeKey != null) {
      // Force the binding lookup.
      linker.requestBinding(supertypeKey, requiredBy, getClass().getClassLoader(), false, true);
    }
  }

  @Override public Object get() {
    throw new AssertionError("Compile-time binding should never be called to inject.");
  }

  @Override public void injectMembers(Object t) {
    throw new AssertionError("Compile-time binding should never be called to inject.");
  }

  @Override public void getDependencies(Set<Binding<?>> get, Set<Binding<?>> injectMembers) {
    Collections.addAll(get, bindings);
  }
}


================================================
FILE: compiler/src/main/java/dagger/internal/codegen/GraphAnalysisLoader.java
================================================
/*
 * Copyright (C) 2012 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 dagger.internal.codegen;

import com.google.common.annotations.VisibleForTesting;
import dagger.internal.Binding;
import dagger.internal.Loader;
import dagger.internal.ModuleAdapter;
import dagger.internal.StaticInjection;
import javax.annotation.processing.ProcessingEnvironment;
import javax.lang.model.element.ElementKind;
import javax.lang.model.element.TypeElement;
import javax.lang.model.util.Elements;

/**
 * A {@code Binding.Resolver} suitable for tool use at build time. The bindings created by
 * this {@code Binding.Resolver} have the correct dependency graph, but do not implement
 * {@link Binding#get} or {@link Binding#injectMembers} methods. They are only suitable
 * for graph analysis and error detection.
 */
public final class GraphAnalysisLoader extends Loader {

  private final ProcessingEnvironment processingEnv;

  public GraphAnalysisLoader(ProcessingEnvironment processingEnv) {
    this.processingEnv = processingEnv;
  }

  @Override public Binding<?> getAtInjectBinding(
      String key, String className, ClassLoader classLoader, boolean mustHaveInjections) {
    TypeElement type = resolveType(processingEnv.getElementUtils(), className);
    if (type == null) {
      // We've encountered a type that the compiler can't introspect. If this
      // causes problems in practice (due to incremental compiles, etc.) we
      // should return a new unresolved binding and warn about the possibility
      // of runtime failures.
      return null;
    }
    if (type.getKind() == ElementKind.INTERFACE) {
      return null;
    }
    return GraphAnalysisInjectBinding.create(type, mustHaveInjections);
  }

  /**
   * Resolves the given class name into a {@link TypeElement}. The class name is a binary name, but
   * {@link Elements#getTypeElement(CharSequence)} wants a canonical name. So this method searches
   * the space of possible canonical names, starting with the most likely (since '$' is rarely used
   * in canonical class names).
   */
  @VisibleForTesting static TypeElement resolveType(Elements elements, String className) {
    int index = nextDollar(className, className, 0);
    if (index == -1) {
      return getTypeElement(elements, className);
    }
    // have to test various possibilities of replacing '$' with '.' since '.' in a canonical name
    // of a nested type is replaced with '$' in the binary name.
    StringBuilder sb = new StringBuilder(className);
    return resolveType(elements, className, sb, index);
  }

  /**
   * Recursively explores the space of possible canonical names for a given binary class name.
   *
   * @param elements used to resolve a name into a {@link TypeElement}
   * @param className binary class name
   * @param sb the current permutation of canonical name to attempt to resolve
   * @param index the index of a {@code '$'} which may be changed to {@code '.'} in a canonical name
   */
  private static TypeElement resolveType(Elements elements, String className, StringBuilder sb,
      final int index) {

    // We assume '$' should be converted to '.'. So we search for classes with dots first.
    sb.setCharAt(index, '.');
    int nextIndex = nextDollar(className, sb, index + 1);
    TypeElement type = nextIndex == -1
        ? getTypeElement(elements, sb)
        : resolveType(elements, className, sb, nextIndex);
    if (type != null) {
      return type;
    }

    // if not found, change back to dollar and search.
    sb.setCharAt(index, '$');
    nextIndex = nextDollar(className, sb, index + 1);
    return nextIndex == -1
        ? getTypeElement(elements, sb)
        : resolveType(elements, className, sb, nextIndex);
  }

  /**
   * Finds the next {@code '$'} in a class name which can be changed to a {@code '.'} when computing
   * a canonical class name.
   */
  private static int nextDollar(String className, CharSequence current, int searchStart) {
    while (true) {
      int index = className.indexOf('$', searchStart);
      if (index == -1) {
        return -1;
      }
      // We'll never have two dots nor will a type name end or begin with dot. So no need to
      // consider dollars at the beginning, end, or adjacent to dots.
      if (index == 0 || index == className.length() - 1
          || current.charAt(index - 1) == '.' || current.charAt(index + 1) == '.') {
        searchStart = index + 1;
        continue;
      }
      return index;
    }
  }

  private static TypeElement getTypeElement(Elements elements, CharSequence className) {
    try {
      return elements.getTypeElement(className);
    } catch (ClassCastException e) {
      // work-around issue in javac in Java 7 where querying for non-existent type can
      // throw a ClassCastException
      // TODO(jh): refer to Oracle Bug ID if/when one is assigned to bug report
      // (Review ID: JI-9027367)
      return null;
    }
  }

  @Override public <T> ModuleAdapter<T> getModuleAdapter(Class<T> moduleClass) {
    throw new UnsupportedOperationException();
  }

  @Override public StaticInjection getStaticInjection(Class<?> injectedClass) {
    throw new UnsupportedOperationException();
  }
}


================================================
FILE: compiler/src/main/java/dagger/internal/codegen/GraphAnalysisProcessor.java
================================================
/*
 * Copyright (C) 2012 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 dagger.internal.codegen;

import dagger.Module;
import dagger.Provides;
import dagger.internal.Binding;
import dagger.internal.Binding.InvalidBindingException;
import dagger.internal.BindingsGroup;
import dagger.internal.Linker;
import dagger.internal.ProblemDetector;
import dagger.internal.ProvidesBinding;
import dagger.internal.SetBinding;
import dagger.internal.codegen.Util.CodeGenerationIncompleteException;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.io.Writer;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Deque;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.annotation.processing.AbstractProcessor;
import javax.annotation.processing.RoundEnvironment;
import javax.annotation.processing.SupportedAnnotationTypes;
import javax.inject.Singleton;
import javax.lang.model.SourceVersion;
import javax.lang.model.element.Element;
import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.TypeElement;
import javax.lang.model.element.VariableElement;
import javax.lang.model.type.TypeMirror;
import javax.lang.model.util.Elements;
import javax.lang.model.util.Types;
import javax.tools.Diagnostic;
import javax.tools.FileObject;
import javax.tools.JavaFileManager;
import javax.tools.StandardLocation;

import static dagger.Provides.Type.SET;
import static dagger.Provides.Type.SET_VALUES;
import static dagger.internal.codegen.Util.className;
import static dagger.internal.codegen.Util.getAnnotation;
import static dagger.internal.codegen.Util.getPackage;
import static dagger.internal.codegen.Util.isInterface;
import static java.util.Arrays.asList;

/**
 * Performs full graph analysis on a module.
 */
@SupportedAnnotationTypes("dagger.Module")
public final class GraphAnalysisProcessor extends AbstractProcessor {
  private static final Set<String> ERROR_NAMES_TO_PROPAGATE = new LinkedHashSet<String>(asList(
      "com.sun.tools.javac.code.Symbol$CompletionFailure"));

  private final Set<String> delayedModuleNames = new LinkedHashSet<String>();

  @Override public SourceVersion getSupportedSourceVersion() {
    return SourceVersion.latestSupported();
  }

  /**
   * Perform full-graph analysis on complete modules. This checks that all of
   * the module's dependencies are satisfied.
   */
  @Override public boolean process(Set<? extends TypeElement> types, RoundEnvironment env) {
    if (!env.processingOver()) {
      // Storing module names for later retrieval as the element instance is invalidated across
      // passes.
      for (Element e : env.getElementsAnnotatedWith(Module.class)) {
        if (!(e instanceof TypeElement)) {
          error("@Module applies to a type, " + e.getSimpleName() + " is a " + e.getKind(), e);
          continue;
        }
        delayedModuleNames.add(((TypeElement) e).getQualifiedName().toString());
      }
      return false;
    }

    Set<Element> modules = new LinkedHashSet<Element>();
    for (String moduleName : delayedModuleNames) {
      modules.add(elements().getTypeElement(moduleName));
    }

    for (Element element : modules) {
      Map<String, Object> annotation = null;
      try {
        annotation = getAnnotation(Module.class, element);
      } catch (CodeGenerationIncompleteException e) {
        continue; // skip this element. An up-stream compiler error is in play.
      }

      TypeElement moduleType = (TypeElement) element;
      if (annotation == null) {
        error("Missing @Module annotation.", moduleType);
        continue;
      }
      if (annotation.get("complete").equals(Boolean.TRUE)) {
        Map<String, Binding<?>> bindings;
        try {
          bindings = processCompleteModule(moduleType, false);
          new ProblemDetector().detectCircularDependencies(bindings.values());
        } catch (ModuleValidationException e) {
          error("Graph validation failed: " + e.getMessage(), e.source);
          continue;
        } catch (InvalidBindingException e) {
          error("Graph validation failed: " + e.getMessage(), elements().getTypeElement(e.type));
          continue;
        } catch (RuntimeException e) {
          if (ERROR_NAMES_TO_PROPAGATE.contains(e.getClass().getName())) {
            throw e;
          }
          error("Unknown error " + e.getClass().getName() + " thrown by javac in graph validation: "
              + e.getMessage(), moduleType);
          continue;
        }
        try {
          writeDotFile(moduleType, bindings);
        } catch (IOException e) {
          StringWriter sw = new StringWriter();
          e.printStackTrace(new PrintWriter(sw));
          processingEnv.getMessager()
              .printMessage(Diagnostic.Kind.WARNING,
                  "Graph visualization failed. Please report this as a bug.\n\n" + sw, moduleType);
        }
      }

      if (annotation.get("library").equals(Boolean.FALSE)) {
        Map<String, Binding<?>> bindings = processCompleteModule(moduleType, true);
        try {
          new ProblemDetector().detectUnusedBinding(bindings.values());
        } catch (IllegalStateException e) {
          error("Graph validation failed: " + e.getMessage(), moduleType);
        }
      }
    }
    return false;
  }

  private void error(String message, Element element) {
    processingEnv.getMessager().printMessage(Diagnostic.Kind.ERROR, message, element);
  }

  private Map<String, Binding<?>> processCompleteModule(TypeElement rootModule,
      boolean ignoreCompletenessErrors) {
    Map<String, TypeElement> allModules = new LinkedHashMap<String, TypeElement>();
    collectIncludesRecursively(rootModule, allModules, new LinkedList<String>());
    ArrayList<GraphAnalysisStaticInjection> staticInjections =
        new ArrayList<GraphAnalysisStaticInjection>();

    Linker.ErrorHandler errorHandler = ignoreCompletenessErrors ? Linker.ErrorHandler.NULL
        : new GraphAnalysisErrorHandler(processingEnv, rootModule.getQualifiedName().toString());
    Linker linker = new Linker(null, new GraphAnalysisLoader(processingEnv), errorHandler);
    // Linker requires synchronization for calls to requestBinding and linkAll.
    // We know statically that we're single threaded, but we synchronize anyway
    // to make the linker happy.
    synchronized (linker) {
      BindingsGroup baseBindings = new BindingsGroup() {
        @Override public Binding<?> contributeSetBinding(String key, SetBinding<?> value) {
          return super.put(key, value);
        }
      };
      BindingsGroup overrideBindings = new BindingsGroup() {
        @Override public Binding<?> contributeSetBinding(String key, SetBinding<?> value) {
          throw new IllegalStateException("Module overrides cannot contribute set bindings.");
        }
      };
      for (TypeElement module : allModules.values()) {
        Map<String, Object> annotation = getAnnotation(Module.class, module);
        boolean overrides = (Boolean) annotation.get("overrides");
        boolean library = (Boolean) annotation.get("library");
        BindingsGroup addTo = overrides ? overrideBindings : baseBindings;

        // Gather the injectable types from the annotation.
        Set<String> injectsProvisionKeys = new LinkedHashSet<String>();
        for (Object injectableTypeObject : (Object[]) annotation.get("injects")) {
          TypeMirror injectableType = (TypeMirror) injectableTypeObject;
          String providerKey = GeneratorKeys.get(injectableType);
          injectsProvisionKeys.add(providerKey);
          String key = isInterface(injectableType)
              ? providerKey
              : GeneratorKeys.rawMembersKey(injectableType);
          linker.requestBinding(key, module.getQualifiedName().toString(),
              getClass().getClassLoader(), false, true);
        }

        // Gather the static injections.
        for (Object staticInjection : (Object[]) annotation.get("staticInjections")) {
          TypeMirror staticInjectionTypeMirror = (TypeMirror) staticInjection;
          Element element = processingEnv.getTypeUtils().asElement(staticInjectionTypeMirror);
          staticInjections.add(new GraphAnalysisStaticInjection(element));
        }

        // Gather the enclosed @Provides methods.
        for (Element enclosed : module.getEnclosedElements()) {
          Provides provides = enclosed.getAnnotation(Provides.class);
          if (provides == null) {
            continue;
          }
          ExecutableElement providerMethod = (ExecutableElement) enclosed;
          String key = GeneratorKeys.get(providerMethod);
          ProvidesBinding<?> binding = new ProviderMethodBinding(key, providerMethod, library);

          Binding<?> previous = addTo.get(key);
          if (previous != null) {
            if ((provides.type() == SET || provides.type() == SET_VALUES)
                && previous instanceof SetBinding) {
              // No duplicate bindings error if both bindings are set bindings.
            } else {
              String message = "Duplicate bindings for " + key;
              if (overrides) {
                message += " in override module(s) - cannot override an override";
              }
              message += ":\n    " + previous.requiredBy + "\n    " + binding.requiredBy;
              error(message, providerMethod);
            }
          }

          switch (provides.type()) {
            case UNIQUE:
              if (injectsProvisionKeys.contains(binding.provideKey)) {
                binding.setDependedOn(true);
              }
              try {
                addTo.contributeProvidesBinding(key, binding);
              } catch (IllegalStateException ise) {
                throw new ModuleValidationException(ise.getMessage(), providerMethod);
              }
              break;

            case SET:
              String setKey = GeneratorKeys.getSetKey(providerMethod);
              SetBinding.add(addTo, setKey, binding);
              break;

            case SET_VALUES:
              SetBinding.add(addTo, key, binding);
              break;

            default:
              throw new AssertionError("Unknown @Provides type " + provides.type());
          }
        }
      }

      linker.installBindings(baseBindings);
      linker.installBindings(overrideBindings);
      for (GraphAnalysisStaticInjection staticInjection : staticInjections) {
        staticInjection.attach(linker);
      }

      // Link the bindings. This will traverse the dependency graph, and report
      // errors if any dependencies are missing.
      return linker.linkAll();
    }
  }

  private Elements elements() {
    return processingEnv.getElementUtils();
  }

  void collectIncludesRecursively(
      TypeElement module, Map<String, TypeElement> result, Deque<String> path) {
    Map<String, Object> annotation = getAnnotation(Module.class, module);
    if (annotation == null) {
      // TODO(tbroyer): pass annotation information
      throw new ModuleValidationException("No @Module on " + module, module);
    }

    // Add the module.
    String name = module.getQualifiedName().toString();
    if (path.contains(name)) {
      StringBuilder message = new StringBuilder("Module Inclusion Cycle: ");
      if (path.size() == 1) {
        message.append(name).append(" includes itself directly.");
      } else {
        String current = null;
        String includer = name;
        for (int i = 0; path.size() > 0; i++) {
          current = includer;
          includer = path.pop();
          message.append("\n").append(i).append(". ")
              .append(current).append(" included by ").append(includer);
        }
        message.append("\n0. ").append(name);
      }
      throw new ModuleValidationException(message.toString(), module);
    }
    result.put(name, module);

    // Recurse for each included module.
    Types types = processingEnv.getTypeUtils();
    List<Object> seedModules = new ArrayList<Object>();
    seedModules.addAll(Arrays.asList((Object[]) annotation.get("includes")));
    if (!annotation.get("addsTo").equals(Void.class)) seedModules.add(annotation.get("addsTo"));
    for (Object include : seedModules) {
      if (!(include instanceof TypeMirror)) {
        // TODO(tbroyer): pass annotation information
        processingEnv.getMessager().printMessage(Diagnostic.Kind.WARNING,
            "Unexpected value for include: " + include + " in " + module, module);
        continue;
      }
      TypeElement includedModule = (TypeElement) types.asElement((TypeMirror) include);
      path.push(name);
      collectIncludesRecursively(includedModule, result, path);
      path.pop();
    }
  }

  static class ProviderMethodBinding extends ProvidesBinding<Object> {
    private final ExecutableElement method;
    private final Binding<?>[] parameters;

    protected ProviderMethodBinding(String provideKey, ExecutableElement method, boolean library) {
      super(provideKey, method.getAnnotation(Singleton.class) != null,
          className(method), method.getSimpleName().toString());
      this.method = method;
      this.parameters = new Binding[method.getParameters().size()];
      setLibrary(library);
    }

    @Override public void attach(Linker linker) {
      for (int i = 0; i < method.getParameters().size(); i++) {
        VariableElement parameter = method.getParameters().get(i);
        String parameterKey = GeneratorKeys.get(parameter);
        parameters[i] = linker.requestBinding(parameterKey, method.toString(),
            getClass().getClassLoader());
      }
    }

    @Override public Object get() {
      throw new AssertionError("Compile-time binding should never be called to inject.");
    }

    @Override public void injectMembers(Object t) {
      throw new AssertionError("Compile-time binding should never be called to inject.");
    }

    @Override public void getDependencies(Set<Binding<?>> get, Set<Binding<?>> injectMembers) {
      Collections.addAll(get, parameters);
    }

    @Override public String toString() {
      return "ProvidesBinding[key=" + provideKey
          + " method=" + moduleClass + "." + method.getSimpleName() + "()";
    }
  }

  void writeDotFile(TypeElement module, Map<String, Binding<?>> bindings) throws IOException {
    JavaFileManager.Location location = StandardLocation.SOURCE_OUTPUT;
    String path = getPackage(module).getQualifiedName().toString();
    String file = module.getQualifiedName().toString().substring(path.length() + 1) + ".dot";
    FileObject resource = processingEnv.getFiler().createResource(location, path, file, module);

    Writer writer = resource.openWriter();
    GraphVizWriter dotWriter = new GraphVizWriter(writer);
    new GraphVisualizer().write(bindings, dotWriter);
    dotWriter.close();
  }

  static class ModuleValidationException extends IllegalStateException {
    final Element source;

    public ModuleValidationException(String message, Element source) {
      super(message);
      this.source = source;
    }
  }
}


================================================
FILE: compiler/src/main/java/dagger/internal/codegen/GraphAnalysisStaticInjection.java
================================================
/*
 * Copyright (C) 2012 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 dagger.internal.codegen;

import dagger.internal.Linker;
import dagger.internal.StaticInjection;
import javax.inject.Inject;
import javax.lang.model.element.Element;

import static dagger.internal.codegen.Util.isStatic;

public final class GraphAnalysisStaticInjection extends StaticInjection {

  private final Element enclosingClass;

  public GraphAnalysisStaticInjection(Element enclosingClass) {
    this.enclosingClass = enclosingClass;
  }

  @Override public void attach(Linker linker) {
    for (Element enclosedElement : enclosingClass.getEnclosedElements()) {
      if (enclosedElement.getKind().isField() && isStatic(enclosedElement)) {
        Inject injectAnnotation = enclosedElement.getAnnotation(Inject.class);
        if (injectAnnotation != null) {
          String key = GeneratorKeys.get(enclosedElement.asType());
          linker.requestBinding(key, enclosingClass.toString(),
              getClass().getClassLoader());
        }
      }
    }
  }

  @Override public void inject() {
    throw new UnsupportedOperationException();
  }
}

================================================
FILE: compiler/src/main/java/dagger/internal/codegen/GraphVisualizer.java
================================================
/*
 * Copyright (C) 2012 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 dagger.internal.codegen;

import dagger.internal.Binding;
import java.io.IOException;
import java.util.Comparator;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import java.util.TreeSet;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * Emits an object graph in dot format.
 */
public final class GraphVisualizer {
  private static final Pattern KEY_PATTERN = Pattern.compile(""
      + "(?:@"            // Full annotation start.
      + "(?:[\\w$]+\\.)*" // Annotation package
      + "([\\w$]+)"       // Annotation simple name. Group 1.
      + "(?:\\(.*\\))?"   // Annotation arguments
      + "/)?"             // Full annotation end.
      + "(?:members/)?"   // Members prefix.
      + "(?:[\\w$]+\\.)*" // Type package.
      + "([\\w$]+)"       // Type simple name. Group 2.
      + "(\\<[^/]+\\>)?"  // Type parameters. Group 3.
      + "((\\[\\])*)"     // Arrays. Group 4.
      + "");

  public void write(Map<String, Binding<?>> bindings, GraphVizWriter writer) throws IOException {
    Map<Binding<?>, String> namesIndex = buildNamesIndex(bindings);

    writer.beginGraph("concentrate", "true");
    for (Map.Entry<Binding<?>, String> entry : namesIndex.entrySet()) {
      Binding<?> sourceBinding = entry.getKey();
      String sourceName = entry.getValue();
      Set<Binding<?>> dependencies = new TreeSet<Binding<?>>(new BindingComparator());
      sourceBinding.getDependencies(dependencies, dependencies);
      for (Binding<?> targetBinding : dependencies) {
        String targetName = namesIndex.get(targetBinding);
        if (targetName == null) {
          targetName = "Unbound:" + targetBinding.provideKey;
        }
        writer.edge(sourceName, targetName);
      }
    }
    writer.endGraph();
  }

  private Map<Binding<?>, String> buildNamesIndex(Map<String, Binding<?>> bindings) {
    // Optimistically shorten each binding to the class short name; remembering collisions.
    Map<String, Binding<?>> shortNameToBinding = new TreeMap<String, Binding<?>>();
    Set<Binding<?>> collisions = new HashSet<Binding<?>>();
    for (Map.Entry<String, Binding<?>> entry : bindings.entrySet()) {
      String key = entry.getKey();
      Binding<?> binding = entry.getValue();
      String shortName = shortName(key);
      Binding<?> collision = shortNameToBinding.put(shortName, binding);
      if (collision != null && collision != binding) {
        collisions.add(binding);
        collisions.add(collision);
      }
    }

    // Replace collisions with full names.
    for (Map.Entry<String, Binding<?>> entry : bindings.entrySet()) {
      Binding<?> binding = entry.getValue();
      if (collisions.contains(binding)) {
        String key = entry.getKey();
        String shortName = shortName(key);
        shortNameToBinding.remove(shortName);
        shortNameToBinding.put(key, binding);
      }
    }

    // Reverse the map.
    Map<Binding<?>, String> bindingToName = new LinkedHashMap<Binding<?>, String>();
    for (Map.Entry<String, Binding<?>> entry : shortNameToBinding.entrySet()) {
      bindingToName.put(entry.getValue(), entry.getKey());
    }

    return bindingToName;
  }

  String shortName(String key) {
    Matcher matcher = KEY_PATTERN.matcher(key);
    if (!matcher.matches()) throw new IllegalArgumentException("Unexpected key: " + key);
    StringBuilder result = new StringBuilder();

    String annotationSimpleName = matcher.group(1);
    if (annotationSimpleName != null) {
      result.append('@').append(annotationSimpleName).append(' ');
    }

    String simpleName = matcher.group(2);
    result.append(simpleName);

    String typeParameters = matcher.group(3);
    if (typeParameters != null) {
      result.append(typeParameters);
    }

    String arrays = matcher.group(4);
    if (arrays != null) {
      result.append(arrays);
    }

    return result.toString();
  }

  /** A Comparator for Bindings so we can insure a consistent ordering of output. */
  private static class BindingComparator implements Comparator<Binding<?>> {
    @Override
    public int compare(Binding<?> left, Binding<?> right) {
      return getStringForBinding(left).compareTo(getStringForBinding(right));
    }

    private String getStringForBinding(Binding<?> binding) {
      return binding == null ? "" : binding.toString();
    }
  }
}


================================================
FILE: compiler/src/main/java/dagger/internal/codegen/GraphVizWriter.java
================================================
/**
 * Copyright (C) 2012 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 dagger.internal.codegen;

import com.squareup.javapoet.CodeBlock;
import java.io.Closeable;
import java.io.IOException;
import java.io.Writer;
import java.util.LinkedHashMap;
import java.util.Map;

/**
 * Emits dot graphs.
 */
public final class GraphVizWriter implements Closeable {
  private static final String INDENT = "  ";
  private final Writer out;
  private int indent = 0;
  private int nextName = 1;
  private final Map<String, String> generatedNames = new LinkedHashMap<String, String>();

  /**
   * @param out the stream to which dot data will be written. This should be a
   *     buffered stream.
   */
  public GraphVizWriter(Writer out) {
    this.out = out;
  }

  public void beginGraph(String... attributes) throws IOException {
    indent();
    String type = indent == 0 ? "digraph " : "subgraph ";
    String name = nextName(indent == 0 ? "G" : "cluster");
    out.write(type);
    out.write(name);
    out.write(" {\n");
    indent++;
    attributes(attributes);
  }

  public void endGraph() throws IOException {
    indent--;
    indent();
    out.write("}\n");
  }

  public void node(String name, String... attributes) throws IOException {
    name = nodeName(name);
    indent();
    out.write(name);
    inlineAttributes(attributes);
    out.write(";\n");
  }

  public void edge(String source, String target, String... attributes) throws IOException {
    source = nodeName(source);
    target = nodeName(target);
    indent();
    out.write(source);
    out.write(" -> ");
    out.write(target);
    inlineAttributes(attributes);
    out.write(";\n");
  }

  public void nodeDefaults(String... attributes) throws IOException {
    if (attributes.length == 0) return;
    indent();
    out.write("node");
    inlineAttributes(attributes);
    out.write(";\n");
  }

  public void edgeDefaults(String... attributes) throws IOException {
    if (attributes.length == 0) return;
    indent();
    out.write("edge");
    inlineAttributes(attributes);
    out.write(";\n");
  }

  private void attributes(String[] attributes) throws IOException {
    if (attributes.length == 0) return;
    if (attributes.length % 2 != 0) throw new IllegalArgumentException();
    for (int i = 0; i < attributes.length; i += 2) {
      indent();
      out.write(attributes[i]);
      out.write(" = ");
      out.write(literal(attributes[i + 1]));
      out.write(";\n");
    }
  }

  private void inlineAttributes(String[] attributes) throws IOException {
    if (attributes.length == 0) return;
    if (attributes.length % 2 != 0) throw new IllegalArgumentException();
    out.write(" [");
    for (int i = 0; i < attributes.length; i += 2) {
      if (i != 0) out.write(";");
      out.write(attributes[i]);
      out.write("=");
      out.write(literal(attributes[i + 1]));
    }
    out.write("]");
  }

  private String nodeName(String name) throws IOException {
    if (name.matches("\\w+")) return name;
    String generatedName = generatedNames.get(name);
    if (generatedName != null) return generatedName;
    generatedName = nextName("n");
    generatedNames.put(name, generatedName);
    node(generatedName, "label", name);
    return generatedName;
  }

  private String literal(String raw) {
    if (raw.matches("\\w+")) return raw;
    return CodeBlock.builder()
        .add("$S", raw)
        .build()
        .toString();
  }

  private void indent() throws IOException {
    for (int i = 0; i < indent; i++) {
      out.write(INDENT);
    }
  }

  private String nextName(String prefix) {
    return prefix + (nextName++);
  }

  @Override public void close() throws IOException {
    out.close();
  }
}


================================================
FILE: compiler/src/main/java/dagger/internal/codegen/InjectAdapterProcessor.java
================================================
/*
 * Copyright (C) 2012 Square, Inc.
 * Copyright (C) 2013 Google, 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 dagger.internal.codegen;

import com.squareup.javapoet.ClassName;
import com.squareup.javapoet.FieldSpec;
import com.squareup.javapoet.JavaFile;
import com.squareup.javapoet.MethodSpec;
import com.squareup.javapoet.ParameterizedTypeName;
import com.squareup.javapoet.TypeSpec;
import dagger.ObjectGraph;
import dagger.internal.Binding;
import dagger.internal.Linker;
import dagger.internal.StaticInjection;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
import javax.annotation.processing.AbstractProcessor;
import javax.annotation.processing.RoundEnvironment;
import javax.annotation.processing.SupportedAnnotationTypes;
import javax.inject.Inject;
import javax.inject.Singleton;
import javax.lang.model.SourceVersion;
import javax.lang.model.element.Element;
import javax.lang.model.element.ElementKind;
import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.TypeElement;
import javax.lang.model.element.VariableElement;
import javax.lang.model.type.TypeKind;
import javax.lang.model.type.TypeMirror;
import javax.tools.Diagnostic;

import static dagger.internal.codegen.AdapterJavadocs.bindingTypeDocs;
import static dagger.internal.codegen.Util.SET_OF_BINDINGS;
import static dagger.internal.codegen.Util.adapterName;
import static dagger.internal.codegen.Util.bindingOf;
import static dagger.internal.codegen.Util.elementToString;
import static dagger.internal.codegen.Util.getApplicationSupertype;
import static dagger.internal.codegen.Util.getNoArgsConstructor;
import static dagger.internal.codegen.Util.getPackage;
import static dagger.internal.codegen.Util.injectableType;
import static dagger.internal.codegen.Util.isCallableConstructor;
import static dagger.internal.codegen.Util.rawTypeToString;
import static dagger.internal.loaders.GeneratedAdapters.INJECT_ADAPTER_SUFFIX;
import static dagger.internal.loaders.GeneratedAdapters.STATIC_INJECTION_SUFFIX;
import static javax.lang.model.element.Modifier.ABSTRACT;
import static javax.lang.model.element.Modifier.FINAL;
import static javax.lang.model.element.Modifier.PRIVATE;
import static javax.lang.model.element.Modifier.PUBLIC;
import static javax.lang.model.element.Modifier.STATIC;

/**
 * Generates an implementation of {@link Binding} that injects the
 * {@literal @}{@code Inject}-annotated members of a class.
 */
@SupportedAnnotationTypes("javax.inject.Inject")
public final class InjectAdapterProcessor extends AbstractProcessor {
  private final Set<String> remainingTypeNames = new LinkedHashSet<String>();

  @Override public SourceVersion getSupportedSourceVersion() {
    return SourceVersion.latestSupported();
  }

  @Override public boolean process(Set<? extends TypeElement> types, RoundEnvironment env) {
    remainingTypeNames.addAll(findInjectedClassNames(env));
    for (Iterator<String> i = remainingTypeNames.iterator(); i.hasNext();) {
      InjectedClass injectedClass = createInjectedClass(i.next());
      // Verify that we have access to all types to be injected on this pass.
      boolean missingDependentClasses =
          !allTypesExist(injectedClass.fields)
          || (injectedClass.constructor != null && !allTypesExist(injectedClass.constructor
              .getParameters()))
          || !allTypesExist(injectedClass.staticFields);
      if (!missingDependentClasses) {
        try {
          generateInjectionsForClass(injectedClass);
        } catch (IOException e) {
          error("Code gen failed: " + e, injectedClass.type);
        }
        i.remove();
      }
    }
    if (env.processingOver() && !remainingTypeNames.isEmpty()) {
      processingEnv.getMessager().printMessage(Diagnostic.Kind.ERROR,
          "Could not find injection type required by " + remainingTypeNames);
    }
    return false;
  }

  private void generateInjectionsForClass(InjectedClass injectedClass) throws IOException {
    if (injectedClass.constructor != null || !injectedClass.fields.isEmpty()) {
      generateInjectAdapter(injectedClass.type, injectedClass.constructor, injectedClass.fields);
    }
    if (!injectedClass.staticFields.isEmpty()) {
      generateStaticInjection(injectedClass.type, injectedClass.staticFields);
    }
  }

  /**
   * Return true if all element types are currently available in this code
   * generation pass. Unavailable types will be of kind {@link TypeKind#ERROR}.
   */
  private boolean allTypesExist(Collection<? extends Element> elements) {
    for (Element element : elements) {
      if (element.asType().getKind() == TypeKind.ERROR) {
        return false;
      }
    }
    return true;
  }

  private Set<String> findInjectedClassNames(RoundEnvironment env) {
    // First gather the set of classes that have @Inject-annotated members.
    Set<String> injectedTypeNames = new LinkedHashSet<String>();
    for (Element element : env.getElementsAnnotatedWith(Inject.class)) {
      if (!validateInjectable(element)) {
        continue;
      }
      injectedTypeNames.add(rawTypeToString(element.getEnclosingElement().asType(), '.'));
    }
    return injectedTypeNames;
  }

  private boolean validateInjectable(Element injectable) {
    Element injectableType = injectable.getEnclosingElement();

    if (injectable.getKind() == ElementKind.CLASS) {
      error("@Inject is not valid on a class: " + elementToString(injectable), injectable);
      return false;
    }

    if (injectable.getKind() == ElementKind.METHOD) {
      error("Method injection is not supported: " + elementToString(injectable), injectable);
      return false;
    }

    if (injectable.getKind() == ElementKind.FIELD
        && injectable.getModifiers().contains(FINAL)) {
      error("Can't inject a final field: " + elementToString(injectable), injectable);
      return false;
    }

    if (injectable.getKind() == ElementKind.FIELD
        && injectable.getModifiers().contains(PRIVATE)) {
      error("Can't inject a private field: " + elementToString(injectable), injectable);
      return false;
    }

    if (injectable.getKind() == ElementKind.CONSTRUCTOR
        && injectable.getModifiers().contains(PRIVATE)) {
      error("Can't inject a private constructor: " + elementToString(injectable), injectable);
      return false;
    }

    ElementKind elementKind = injectableType.getEnclosingElement().getKind();
    boolean isClassOrInterface = elementKind.isClass() || elementKind.isInterface();
    boolean isStatic = injectableType.getModifiers().contains(STATIC);

    if (isClassOrInterface && !isStatic) {
      error("Can't inject a non-static inner class: " + elementToString(injectable),
          injectableType);
      return false;
    }

    return true;
  }

  /**
   * @param injectedClassName the name of a class with an @Inject-annotated member.
   */
  private InjectedClass createInjectedClass(String injectedClassName) {
    TypeElement type = processingEnv.getElementUtils().getTypeElement(injectedClassName);
    boolean isAbstract = type.getModifiers().contains(ABSTRACT);
    List<Element> staticFields = new ArrayList<Element>();
    ExecutableElement constructor = null;
    List<Element> fields = new ArrayList<Element>();
    for (Element member : type.getEnclosedElements()) {
      if (member.getAnnotation(Inject.class) == null) {
        continue;
      }

      switch (member.getKind()) {
        case FIELD:
          if (member.getModifiers().contains(STATIC)) {
            staticFields.add(member);
          } else {
            fields.add(member);
          }
          break;
        case CONSTRUCTOR:
          if (constructor != null) {
            // TODO(tbroyer): pass annotation information
            error("Too many injectable constructors on " + type.getQualifiedName(), member);
          } else if (isAbstract) {
            // TODO(tbroyer): pass annotation information
            error("Abstract class " + type.getQualifiedName()
                + " must not have an @Inject-annotated constructor.", member);
          }
          constructor = (ExecutableElement) member;
          break;
        default:
          // TODO(tbroyer): pass annotation information
          error("Cannot inject " + elementToString(member), member);
          break;
      }
    }

    if (constructor == null && !isAbstract) {
      constructor = getNoArgsConstructor(type);
      if (constructor != null && !isCallableConstructor(constructor)) {
        constructor = null;
      }
    }

    return new InjectedClass(type, staticFields, constructor, fields);
  }

  /**
   * Write a companion class for {@code type} that extends {@link Binding}.
   *
   * @param constructor the injectable constructor, or null if this binding
   *     supports members injection only.
   */
  private void generateInjectAdapter(TypeElement type, ExecutableElement constructor,
      List<Element> fields) throws IOException {
    String packageName = getPackage(type).getQualifiedName().toString();
    TypeMirror supertype = getApplicationSupertype(type);
    if (supertype != null) {
      supertype = processingEnv.getTypeUtils().erasure(supertype);
    }
    ClassName injectedClassName = ClassName.get(type);
    ClassName adapterClassName = adapterName(injectedClassName, INJECT_ADAPTER_SUFFIX);

    boolean isAbstract = type.getModifiers().contains(ABSTRACT);
    boolean injectMembers = !fields.isEmpty() || supertype != null;
    boolean disambiguateFields = !fields.isEmpty()
        && (constructor != null)
        && !constructor.getParameters().isEmpty();
    boolean dependent = injectMembers
        || ((constructor != null) && !constructor.getParameters().isEmpty());

    TypeSpec.Builder result = TypeSpec.classBuilder(adapterClassName.simpleName())
        .addOriginatingElement(type)
        .addModifiers(PUBLIC, FINAL)
        .superclass(ParameterizedTypeName.get(ClassName.get(Binding.class), injectedClassName))
        .addJavadoc("$L", bindingTypeDocs(injectableType(type.asType()), isAbstract,
            injectMembers, dependent).toString());

    for (Element field : fields) {
      result.addField(memberBindingField(disambiguateFields, field));
    }
    if (constructor != null) {
      for (VariableElement parameter : constructor.getParameters()) {
        result.addField(parameterBindingField(disambiguateFields, parameter));
      }
    }
    if (supertype != null) {
      result.addField(supertypeBindingField(supertype));
    }

    result.addMethod(writeInjectAdapterConstructor(constructor, type, injectedClassName));
    if (dependent) {
      result.addMethod(attachMethod(
          constructor, fields, disambiguateFields, injectedClassName, supertype, true));
      result.addMethod(getDependenciesMethod(
          constructor, fields, disambiguateFields, supertype, true));
    }
    if (constructor != null) {
      result.addMethod(
          getMethod(constructor, disambiguateFields, injectMembers, injectedClassName));
    }
    if (injectMembers) {
      result.addMethod(
          membersInjectMethod(fields, disambiguateFields, injectedClassName, supertype));
    }

    JavaFile javaFile = JavaFile.builder(packageName, result.build())
        .addFileComment(AdapterJavadocs.GENERATED_BY_DAGGER)
        .build();
    javaFile.writeTo(processingEnv.getFiler());
  }

  /**
   * Write a companion class for {@code type} that extends {@link StaticInjection}.
   */
  private void generateStaticInjection(TypeElement type, List<Element> fields) throws IOException {
    ClassName typeName = ClassName.get(type);
    ClassName adapterClassName = adapterName(ClassName.get(type), STATIC_INJECTION_SUFFIX);

    TypeSpec.Builder result = TypeSpec.classBuilder(adapterClassName.simpleName())
        .addOriginatingElement(type)
        .addJavadoc(AdapterJavadocs.STATIC_INJECTION_TYPE, type)
        .addModifiers(PUBLIC, FINAL)
        .superclass(StaticInjection.class);
    for (Element field : fields) {
      result.addField(memberBindingField(false, field));
    }
    result.addMethod(attachMethod(null, fields, false, typeName, null, true));
    result.addMethod(staticInjectMethod(fields, typeName));

    String packageName = getPackage(type).getQualifiedName().toString();
    JavaFile javaFile = JavaFile.builder(packageName, result.build())
        .addFileComment(AdapterJavadocs.GENERATED_BY_DAGGER)
        .build();
    javaFile.writeTo(processingEnv.getFiler());
  }

  private FieldSpec memberBindingField(boolean disambiguateFields, Element field) {
    return FieldSpec.builder(bindingOf(field.asType()), fieldName(disambiguateFields, field),
        PRIVATE).build();
  }

  private FieldSpec parameterBindingField(boolean disambiguateFields, VariableElement parameter) {
    return FieldSpec.builder(bindingOf(parameter.asType()),
        parameterName(disambiguateFields, parameter), PRIVATE).build();
  }

  private FieldSpec supertypeBindingField(TypeMirror supertype) {
    return FieldSpec.builder(bindingOf(supertype), "supertype", PRIVATE).build();
  }

  private MethodSpec writeInjectAdapterConstructor(ExecutableElement constructor, TypeElement type,
      ClassName strippedTypeName) {
    String key = (constructor != null)
        ? GeneratorKeys.get(type.asType())
        : null;
    String membersKey = GeneratorKeys.rawMembersKey(type.asType());
    boolean singleton = type.getAnnotation(Singleton.class) != null;

    return MethodSpec.constructorBuilder()
        .addModifiers(PUBLIC)
        .addStatement("super($S, $S, $N, $T.class)",
            key, membersKey, (singleton ? "IS_SINGLETON" : "NOT_SINGLETON"), strippedTypeName)
        .build();
  }

  private MethodSpec attachMethod(ExecutableElement constructor,
      List<Element> fields, boolean disambiguateFields, ClassName typeName, TypeMirror supertype,
      boolean extendsBinding) throws IOException {
    MethodSpec.Builder result = MethodSpec.methodBuilder("attach")
        .addJavadoc(AdapterJavadocs.ATTACH_METHOD)
        .addModifiers(PUBLIC)
        .addParameter(Linker.class, "linker");

    if (extendsBinding) {
      result.addAnnotation(Override.class);
    }
    result.addAnnotation(Util.UNCHECKED);
    if (constructor != null) {
      for (VariableElement parameter : constructor.getParameters()) {
        result.addStatement(
            "$N = ($T) linker.requestBinding($S, $T.class, getClass().getClassLoader())",
            parameterName(disambiguateFields, parameter), bindingOf(parameter.asType()),
            GeneratorKeys.get(parameter), typeName);
      }
    }
    for (Element field : fields) {
      result.addStatement(
          "$N = ($T) linker.requestBinding($S, $T.class, getClass().getClassLoader())",
          fieldName(disambiguateFields, field), bindingOf(field.asType()),
          GeneratorKeys.get((VariableElement) field), typeName);
    }
    if (supertype != null) {
      result.addStatement(
          "$N = ($T) linker.requestBinding($S, $T.class, getClass().getClassLoader()"
              + ", false, true)",
          "supertype",
          bindingOf(supertype),
          GeneratorKeys.rawMembersKey(supertype), typeName);
    }
    return result.build();
  }

  private MethodSpec getDependenciesMethod(ExecutableElement constructor,
      List<Element> fields, boolean disambiguateFields, TypeMirror supertype,
      boolean extendsBinding) throws IOException {
    MethodSpec.Builder result = MethodSpec.methodBuilder("getDependencies")
        .addJavadoc(AdapterJavadocs.GET_DEPENDENCIES_METHOD)
        .addModifiers(PUBLIC)
        .addParameter(SET_OF_BINDINGS, "getBindings")
        .addParameter(SET_OF_BINDINGS, "injectMembersBindings");

    if (extendsBinding) {
      result.addAnnotation(Override.class);
    }
    if (constructor != null) {
      for (Element parameter : constructor.getParameters()) {
        result.addStatement("getBindings.add($N)", parameterName(disambiguateFields, parameter));
      }
    }
    for (Element field : fields) {
      result.addStatement("injectMembersBindings.add($N)", fieldName(disambiguateFields, field));
    }
    if (supertype != null) {
      result.addStatement("injectMembersBindings.add($N)", "supertype");
    }
    return result.build();
  }

  private MethodSpec getMethod(ExecutableElement constructor, boolean disambiguateFields,
      boolean injectMembers, ClassName injectedClassName) {
    MethodSpec.Builder result = MethodSpec.methodBuilder("get")
        .addJavadoc(AdapterJavadocs.GET_METHOD, injectedClassName)
        .addAnnotation(Override.class)
        .returns(injectedClassName)
        .addModifiers(PUBLIC);

    result.addCode("$T result = new $T(", injectedClassName, injectedClassName);
    boolean first = true;
    for (VariableElement parameter : constructor.getParameters()) {
      if (!first) result.addCode(", ");
      else first = false;
      result.addCode("$N.get()", parameterName(disambiguateFields, parameter));
    }
    result.addCode(");\n");
    if (injectMembers) {
      result.addStatement("injectMembers(result)");
    }
    result.addStatement("return result");
    return result.build();
  }

  private MethodSpec membersInjectMethod(List<Element> fields, boolean disambiguateFields,
      ClassName injectedClassName, TypeMirror supertype) {
    MethodSpec.Builder result = MethodSpec.methodBuilder("injectMembers")
        .addJavadoc(AdapterJavadocs.MEMBERS_INJECT_METHOD, injectedClassName)
        .addAnnotation(Override.class)
        .addModifiers(PUBLIC)
        .addParameter(injectedClassName, "object");
    for (Element field : fields) {
      result.addStatement("object.$N = $N.get()",
          field.getSimpleName(),
          fieldName(disambiguateFields, field));
    }
    if (supertype != null) {
      result.addStatement("supertype.injectMembers(object)");
    }
    return result.build();
  }

  private MethodSpec staticInjectMethod(List<Element> fields, ClassName typeName) {
    MethodSpec.Builder result = MethodSpec.methodBuilder("inject")
        .addJavadoc(AdapterJavadocs.STATIC_INJECT_METHOD, ObjectGraph.class)
        .addAnnotation(Override.class)
        .addModifiers(PUBLIC);
    for (Element field : fields) {
      result.addStatement("$T.$N = $N.get()",
          typeName,
          field.getSimpleName().toString(),
          fieldName(false, field));
    }
    return result.build();
  }

  private String fieldName(boolean disambiguateFields, Element field) {
    return (disambiguateFields ? "field_" : "") + field.getSimpleName().toString();
  }

  private String parameterName(boolean disambiguateFields, Element parameter) {
    return (disambiguateFields ? "parameter_" : "") + parameter.getSimpleName().toString();
  }

  private void error(String msg, Element element) {
    processingEnv.getMessager().printMessage(Diagnostic.Kind.ERROR, msg, element);
  }

  static class InjectedClass {
    final TypeElement type;
    final List<Element> staticFields;
    final ExecutableElement constructor;
    final List<Element> fields;

    InjectedClass(TypeElement type, List<Element> staticFields, ExecutableElement constructor,
        List<Element> fields) {
      this.type = type;
      this.staticFields = staticFields;
      this.constructor = constructor;
      this.fields = fields;
    }
  }
}


================================================
FILE: compiler/src/main/java/dagger/internal/codegen/ModuleAdapterProcessor.java
================================================
/*
 * Copyright (C) 2012 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 dagger.internal.codegen;

import com.squareup.javapoet.ClassName;
import com.squareup.javapoet.CodeBlock;
import com.squareup.javapoet.FieldSpec;
import com.squareup.javapoet.JavaFile;
import com.squareup.javapoet.MethodSpec;
import com.squareup.javapoet.ParameterizedTypeName;
import com.squareup.javapoet.TypeName;
import com.squareup.javapoet.TypeSpec;
import dagger.Lazy;
import dagger.Module;
import dagger.Provides;
import dagger.internal.BindingsGroup;
import dagger.internal.Linker;
import dagger.internal.ModuleAdapter;
import dagger.internal.ProvidesBinding;
import dagger.internal.SetBinding;
import dagger.internal.codegen.Util.CodeGenerationIncompleteException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.atomic.AtomicInteger;
import javax.annotation.processing.AbstractProcessor;
import javax.annotation.processing.RoundEnvironment;
import javax.annotation.processing.SupportedAnnotationTypes;
import javax.inject.Provider;
import javax.inject.Singleton;
import javax.lang.model.SourceVersion;
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.VariableElement;
import javax.lang.model.type.TypeKind;
import javax.lang.model.type.TypeMirror;
import javax.lang.model.util.Elements;
import javax.lang.model.util.Types;
import javax.tools.Diagnostic;

import static dagger.internal.codegen.AdapterJavadocs.bindingTypeDocs;
import static dagger.internal.codegen.Util.ARRAY_OF_CLASS;
import static dagger.internal.codegen.Util.bindingOf;
import static dagger.internal.codegen.Util.elementToString;
import static dagger.internal.codegen.Util.getAnnotation;
import static dagger.internal.codegen.Util.getNoArgsConstructor;
import static dagger.internal.codegen.Util.isCallableConstructor;
import static dagger.internal.codegen.Util.isInterface;
import static dagger.internal.codegen.Util.typeToString;
import static dagger.internal.loaders.GeneratedAdapters.MODULE_ADAPTER_SUFFIX;
import static javax.lang.model.element.Modifier.ABSTRACT;
import static javax.lang.model.element.Modifier.FINAL;
import static javax.lang.model.element.Modifier.PRIVATE;
import static javax.lang.model.element.Modifier.PUBLIC;
import static javax.lang.model.element.Modifier.STATIC;

/**
 * Generates an implementation of {@link ModuleAdapter} that includes a binding
 * for each {@code @Provides} method of a target class.
 */
@SupportedAnnotationTypes({ "*" })
public final class ModuleAdapterProcessor extends AbstractProcessor {
  private static final List<String> INVALID_RETURN_TYPES =
      Arrays.asList(Provider.class.getCanonicalName(), Lazy.class.getCanonicalName());

  private final LinkedHashMap<String, List<ExecutableElement>> remainingTypes =
      new LinkedHashMap<String, List<ExecutableElement>>();

  @Override public SourceVersion getSupportedSourceVersion() {
    return SourceVersion.latestSupported();
  }

  @Override public boolean process(Set<? extends TypeElement> types, RoundEnvironment env) {
    remainingTypes.putAll(providerMethodsByClass(env));
    for (Iterator<String> i = remainingTypes.keySet().iterator(); i.hasNext();) {
      String typeName = i.next();
      TypeElement type = processingEnv.getElementUtils().getTypeElement(typeName);
      List<ExecutableElement> providesTypes = remainingTypes.get(typeName);

      try {
        // Attempt to get the annotation. If types are missing, this will throw
        // CodeGenerationIncompleteException.
        Map<String, Object> parsedAnnotation = getAnnotation(Module.class, type);
        if (parsedAnnotation == null) {
          error(type + " has @Provides methods but no @Module annotation", type);
          continue;
        }
        JavaFile javaFile = generateModuleAdapter(type, parsedAnnotation, providesTypes);
        javaFile.writeTo(processingEnv.getFiler());
      } catch (CodeGenerationIncompleteException e) {
        continue; // A dependent type was not defined, we'll try to catch it on another pass.
      } catch (IOException e) {
        error("Code gen failed: " + e, type);
      }
      i.remove();
    }
    if (env.processingOver() && remainingTypes.size() > 0) {
      processingEnv.getMessager().printMessage(Diagnostic.Kind.ERROR,
          "Could not find types required by provides methods for " + remainingTypes.keySet());
    }
    return false; // FullGraphProcessor needs an opportunity to process.
  }

  private void error(String msg, Element element) {
    processingEnv.getMessager().printMessage(Diagnostic.Kind.ERROR, msg, element);
  }

  /**
   * Returns a map containing all {@code @Provides} methods, indexed by class.
   */
  private Map<String, List<ExecutableElement>> providerMethodsByClass(RoundEnvironment env) {
    Elements elementUtils = processingEnv.getElementUtils();
    Types types = processingEnv.getTypeUtils();

    Map<String, List<ExecutableElement>> result = new HashMap<String, List<ExecutableElement>>();

    provides:
    for (Element providerMethod : findProvidesMethods(env)) {
      switch (providerMethod.getEnclosingElement().getKind()) {
        case CLASS:
          break; // valid, move along
        default:
          // TODO(tbroyer): pass annotation information
          error("Unexpected @Provides on " + elementToString(providerMethod), providerMethod);
          continue;
      }
      TypeElement type = (TypeElement) providerMethod.getEnclosingElement();
      Set<Modifier> typeModifiers = type.getModifiers();
      if (typeModifiers.contains(PRIVATE)
          || typeModifiers.contains(ABSTRACT)) {
        error("Classes declaring @Provides methods must not be private or abstract: "
                + type.getQualifiedName(), type);
        continue;
      }

      Set<Modifier> methodModifiers = providerMethod.getModifiers();
      if (methodModifiers.contains(PRIVATE)
          || methodModifiers.contains(ABSTRACT)
          || methodModifiers.contains(STATIC)) {
        error("@Provides methods must not be private, abstract or static: "
                + type.getQualifiedName() + "." + providerMethod, providerMethod);
        continue;
      }

      ExecutableElement providerMethodAsExecutable = (ExecutableElement) providerMethod;
      if (!providerMethodAsExecutable.getThrownTypes().isEmpty()) {
        error("@Provides methods must not have a throws clause: "
            + type.getQualifiedName() + "." + providerMethod, providerMethod);
        continue;
      }

      // Invalidate return types.
      TypeMirror returnType = types.erasure(providerMethodAsExecutable.getReturnType());
      if (!returnType.getKind().equals(TypeKind.ERROR)) {
        // Validate if we have a type to validate (a type yet to be generated by other
        // processors is not "invalid" in this way, so ignore).
        for (String invalidTypeName : INVALID_RETURN_TYPES) {
          TypeElement invalidTypeElement = elementUtils.getTypeElement(invalidTypeName);
          if (invalidTypeElement != null && types.isSameType(returnType,
              types.erasure(invalidTypeElement.asType()))) {
            error(String.format("@Provides method must not return %s directly: %s.%s",
                invalidTypeElement, type.getQualifiedName(), providerMethod), providerMethod);
            continue provides; // Skip to next provides method.
          }
        }
      }

      List<ExecutableElement> methods = result.get(type.getQualifiedName().toString());
      if (methods == null) {
        methods = new ArrayList<ExecutableElement>();
        result.put(type.getQualifiedName().toString(), methods);
      }
      methods.add(providerMethodAsExecutable);
    }

    TypeMirror objectType = elementUtils.getTypeElement("java.lang.Object").asType();

    // Catch any stray modules without @Provides since their injectable types
    // should still be registered and a ModuleAdapter should still be written.
    for (Element module : env.getElementsAnnotatedWith(Module.class)) {
      if (!module.getKind().equals(ElementKind.CLASS)) {
        error("Modules must be classes: " + elementToString(module), module);
        continue;
      }

      TypeElement moduleType = (TypeElement) module;

      // Verify that all modules do not extend from non-Object types.
      if (!types.isSameType(moduleType.getSuperclass(), objectType)) {
        error("Modul
Download .txt
gitextract_cz8_4_6g/

├── .buildscript/
│   ├── deploy_snapshot.sh
│   └── settings.xml
├── .gitignore
├── .travis.yml
├── CHANGELOG.md
├── CONTRIBUTING.md
├── LICENSE.txt
├── README.md
├── checkstyle.xml
├── compiler/
│   ├── pom.xml
│   └── src/
│       ├── it/
│       │   ├── default-package-injected-type/
│       │   │   ├── pom.xml
│       │   │   └── src/
│       │   │       └── main/
│       │   │           └── java/
│       │   │               └── TestApp.java
│       │   ├── extension-graph/
│       │   │   ├── pom.xml
│       │   │   └── src/
│       │   │       └── main/
│       │   │           └── java/
│       │   │               └── test/
│       │   │                   └── TestApp.java
│       │   ├── extension-graph-setvalues/
│       │   │   ├── pom.xml
│       │   │   └── src/
│       │   │       └── main/
│       │   │           └── java/
│       │   │               └── test/
│       │   │                   └── TestApp.java
│       │   ├── final-field-inject/
│       │   │   ├── invoker.properties
│       │   │   ├── pom.xml
│       │   │   ├── src/
│       │   │   │   └── main/
│       │   │   │       └── java/
│       │   │   │           └── test/
│       │   │   │               └── TestApp.java
│       │   │   └── verify.bsh
│       │   ├── include-non-module/
│       │   │   ├── invoker.properties
│       │   │   ├── pom.xml
│       │   │   └── src/
│       │   │       └── main/
│       │   │           └── java/
│       │   │               └── test/
│       │   │                   └── TestApp.java
│       │   ├── inject-on-class/
│       │   │   ├── invoker.properties
│       │   │   ├── pom.xml
│       │   │   ├── src/
│       │   │   │   └── main/
│       │   │   │       └── java/
│       │   │   │           └── test/
│       │   │   │               └── TestApp.java
│       │   │   └── verify.bsh
│       │   ├── inject-parameterized-type/
│       │   │   ├── pom.xml
│       │   │   └── src/
│       │   │       └── main/
│       │   │           └── java/
│       │   │               └── test/
│       │   │                   └── TestApp.java
│       │   ├── inner-classes-complaint-injection/
│       │   │   ├── invoker.properties
│       │   │   ├── pom.xml
│       │   │   ├── src/
│       │   │   │   └── main/
│       │   │   │       └── java/
│       │   │   │           └── test/
│       │   │   │               └── TestApp.java
│       │   │   └── verify.bsh
│       │   ├── method-injection/
│       │   │   ├── invoker.properties
│       │   │   ├── pom.xml
│       │   │   ├── src/
│       │   │   │   └── main/
│       │   │   │       └── java/
│       │   │   │           └── test/
│       │   │   │               └── TestApp.java
│       │   │   └── verify.bsh
│       │   ├── missing-at-inject-constructor/
│       │   │   ├── invoker.properties
│       │   │   ├── pom.xml
│       │   │   ├── src/
│       │   │   │   └── main/
│       │   │   │       └── java/
│       │   │   │           └── test/
│       │   │   │               └── TestApp.java
│       │   │   └── verify.bsh
│       │   ├── module-type-validation/
│       │   │   ├── invoker.properties
│       │   │   ├── pom.xml
│       │   │   ├── src/
│       │   │   │   └── main/
│       │   │   │       └── java/
│       │   │   │           └── test/
│       │   │   │               └── TestModule.java
│       │   │   └── verify.bsh
│       │   ├── multiple-modules-setvalues/
│       │   │   ├── pom.xml
│       │   │   └── src/
│       │   │       └── main/
│       │   │           └── java/
│       │   │               └── test/
│       │   │                   └── TestApp.java
│       │   ├── multiple-provides-methods/
│       │   │   ├── pom.xml
│       │   │   ├── src/
│       │   │   │   └── main/
│       │   │   │       └── java/
│       │   │   │           └── test/
│       │   │   │               └── TestApp.java
│       │   │   └── verify.bsh
│       │   ├── multiple-qualifiers/
│       │   │   ├── invoker.properties
│       │   │   ├── pom.xml
│       │   │   ├── src/
│       │   │   │   └── main/
│       │   │   │       └── java/
│       │   │   │           └── test/
│       │   │   │               └── TestApp.java
│       │   │   └── verify.bsh
│       │   ├── private-inject/
│       │   │   ├── invoker.properties
│       │   │   ├── pom.xml
│       │   │   ├── src/
│       │   │   │   └── main/
│       │   │   │       └── java/
│       │   │   │           └── test/
│       │   │   │               ├── TestApp.java
│       │   │   │               └── TestFoo.java
│       │   │   └── verify.bsh
│       │   ├── provide-provider-or-lazy/
│       │   │   ├── invoker.properties
│       │   │   ├── pom.xml
│       │   │   ├── src/
│       │   │   │   └── main/
│       │   │   │       └── java/
│       │   │   │           └── test/
│       │   │   │               └── TestModule.java
│       │   │   └── verify.bsh
│       │   ├── provides-method-not-in-module/
│       │   │   ├── invoker.properties
│       │   │   ├── pom.xml
│       │   │   ├── src/
│       │   │   │   └── main/
│       │   │   │       └── java/
│       │   │   │           └── test/
│       │   │   │               └── TestApp.java
│       │   │   └── verify.bsh
│       │   ├── provides-method-with-throws-clause/
│       │   │   ├── invoker.properties
│       │   │   ├── pom.xml
│       │   │   ├── src/
│       │   │   │   └── main/
│       │   │   │       └── java/
│       │   │   │           └── test/
│       │   │   │               └── TestApp.java
│       │   │   └── verify.bsh
│       │   ├── qualifiers-on-invalid-elements-errors/
│       │   │   ├── invoker.properties
│       │   │   ├── pom.xml
│       │   │   ├── src/
│       │   │   │   └── main/
│       │   │   │       └── java/
│       │   │   │           └── test/
│       │   │   │               └── TestApp.java
│       │   │   └── verify.bsh
│       │   ├── qualifiers-on-invalid-elements-warnings/
│       │   │   ├── pom.xml
│       │   │   ├── src/
│       │   │   │   └── main/
│       │   │   │       └── java/
│       │   │   │           └── test/
│       │   │   │               └── TestApp.java
│       │   │   └── verify.bsh
│       │   ├── same-provides-method-name/
│       │   │   ├── pom.xml
│       │   │   └── src/
│       │   │       └── main/
│       │   │           └── java/
│       │   │               └── test/
│       │   │                   └── TestApp.java
│       │   ├── static-injected-binding-doesnt-fail-providers/
│       │   │   ├── pom.xml
│       │   │   └── src/
│       │   │       └── main/
│       │   │           └── java/
│       │   │               └── test/
│       │   │                   └── Test.java
│       │   ├── uninjectable-supertype/
│       │   │   ├── pom.xml
│       │   │   └── src/
│       │   │       └── main/
│       │   │           └── java/
│       │   │               └── test/
│       │   │                   └── TestApp.java
│       │   └── valid-use-of-qualifiers/
│       │       ├── pom.xml
│       │       └── src/
│       │           └── main/
│       │               └── java/
│       │                   └── test/
│       │                       └── TestApp.java
│       ├── main/
│       │   ├── java/
│       │   │   └── dagger/
│       │   │       └── internal/
│       │   │           └── codegen/
│       │   │               ├── AdapterJavadocs.java
│       │   │               ├── GeneratorKeys.java
│       │   │               ├── GraphAnalysisErrorHandler.java
│       │   │               ├── GraphAnalysisInjectBinding.java
│       │   │               ├── GraphAnalysisLoader.java
│       │   │               ├── GraphAnalysisProcessor.java
│       │   │               ├── GraphAnalysisStaticInjection.java
│       │   │               ├── GraphVisualizer.java
│       │   │               ├── GraphVizWriter.java
│       │   │               ├── InjectAdapterProcessor.java
│       │   │               ├── ModuleAdapterProcessor.java
│       │   │               ├── Util.java
│       │   │               └── ValidationProcessor.java
│       │   └── resources/
│       │       └── META-INF/
│       │           └── services/
│       │               └── javax.annotation.processing.Processor
│       └── test/
│           └── java/
│               └── dagger/
│                   ├── internal/
│                   │   └── codegen/
│                   │       ├── DotWriterTest.java
│                   │       ├── GraphAnalysisLoaderTest.java
│                   │       └── GraphVisualizerTest.java
│                   ├── testing/
│                   │   └── it/
│                   │       └── BuildLogValidator.java
│                   └── tests/
│                       └── integration/
│                           ├── ProcessorTestUtils.java
│                           ├── codegen/
│                           │   ├── GenericInjectAdapterGenerationTest.java
│                           │   ├── InjectAdapterGenerationTest.java
│                           │   └── ModuleAdapterGenerationTest.java
│                           ├── operation/
│                           │   ├── FailureModeErrorsTest.java
│                           │   ├── PrimitiveInjectionTest.java
│                           │   └── SimpleInjectionTest.java
│                           └── validation/
│                               ├── CyclicDependencyTest.java
│                               ├── CyclicModuleIncludesTest.java
│                               ├── GeneratedTypesNotReadyTest.java
│                               ├── LibraryModuleTest.java
│                               ├── ScopeAnnotationUseTest.java
│                               └── SimpleMissingDependencyTest.java
├── core/
│   ├── pom.xml
│   └── src/
│       ├── main/
│       │   └── java/
│       │       └── dagger/
│       │           ├── Lazy.java
│       │           ├── MembersInjector.java
│       │           ├── Module.java
│       │           ├── ObjectGraph.java
│       │           ├── Provides.java
│       │           └── internal/
│       │               ├── ArrayQueue.java
│       │               ├── Binding.java
│       │               ├── BindingsGroup.java
│       │               ├── BuiltInBinding.java
│       │               ├── FailoverLoader.java
│       │               ├── Keys.java
│       │               ├── LazyBinding.java
│       │               ├── Linker.java
│       │               ├── Loader.java
│       │               ├── Memoizer.java
│       │               ├── ModuleAdapter.java
│       │               ├── Modules.java
│       │               ├── ProblemDetector.java
│       │               ├── ProvidesBinding.java
│       │               ├── SetBinding.java
│       │               ├── StaticInjection.java
│       │               ├── ThrowingErrorHandler.java
│       │               └── loaders/
│       │                   ├── GeneratedAdapters.java
│       │                   ├── ReflectiveAtInjectBinding.java
│       │                   └── ReflectiveStaticInjection.java
│       └── test/
│           └── java/
│               └── dagger/
│                   ├── ExtensionTest.java
│                   ├── ExtensionWithSetBindingsTest.java
│                   ├── ExtensionWithStateTest.java
│                   ├── InjectStaticsTest.java
│                   ├── InjectionOfLazyTest.java
│                   ├── InjectionTest.java
│                   ├── LazyInjectionTest.java
│                   ├── MembersInjectorTest.java
│                   ├── ModuleTest.java
│                   ├── ProblemDetectorTest.java
│                   ├── SetBindingTest.java
│                   ├── ThreadSafetyTest.java
│                   ├── UnusedProviderTest.java
│                   └── internal/
│                       ├── FailoverLoaderTest.java
│                       ├── KeysTest.java
│                       ├── SingletonBindingTest.java
│                       ├── TestingLoader.java
│                       └── TestingModuleAdapter.java
├── deploy_website.sh
├── examples/
│   ├── android-activity-graphs/
│   │   ├── README.md
│   │   ├── pom.xml
│   │   └── src/
│   │       └── main/
│   │           ├── AndroidManifest.xml
│   │           ├── java/
│   │           │   └── com/
│   │           │       └── example/
│   │           │           └── dagger/
│   │           │               └── activitygraphs/
│   │           │                   ├── ActivityModule.java
│   │           │                   ├── AndroidModule.java
│   │           │                   ├── DemoApplication.java
│   │           │                   ├── DemoBaseActivity.java
│   │           │                   ├── DemoBaseFragment.java
│   │           │                   ├── ForActivity.java
│   │           │                   ├── ForApplication.java
│   │           │                   └── ui/
│   │           │                       ├── ActivityTitleController.java
│   │           │                       ├── HomeActivity.java
│   │           │                       └── HomeFragment.java
│   │           └── res/
│   │               └── values/
│   │                   └── strings.xml
│   ├── android-simple/
│   │   ├── README.md
│   │   ├── pom.xml
│   │   └── src/
│   │       └── main/
│   │           ├── AndroidManifest.xml
│   │           ├── java/
│   │           │   └── com/
│   │           │       └── example/
│   │           │           └── dagger/
│   │           │               └── simple/
│   │           │                   ├── AndroidModule.java
│   │           │                   ├── DemoApplication.java
│   │           │                   ├── DemoBaseActivity.java
│   │           │                   ├── DemoModule.java
│   │           │                   ├── ForApplication.java
│   │           │                   └── ui/
│   │           │                       └── HomeActivity.java
│   │           └── res/
│   │               └── values/
│   │                   └── strings.xml
│   ├── pom.xml
│   └── simple/
│       ├── pom.xml
│       └── src/
│           ├── main/
│           │   └── java/
│           │       └── coffee/
│           │           ├── CoffeeApp.java
│           │           ├── CoffeeMaker.java
│           │           ├── DripCoffeeModule.java
│           │           ├── ElectricHeater.java
│           │           ├── Heater.java
│           │           ├── Pump.java
│           │           ├── PumpModule.java
│           │           └── Thermosiphon.java
│           └── test/
│               └── java/
│                   └── coffee/
│                       └── CoffeeMakerTest.java
├── pom.xml
└── website/
    ├── index.html
    └── static/
        ├── app-theme.css
        ├── app.css
        └── prettify.js
Download .txt
SYMBOL INDEX (989 symbols across 120 files)

FILE: compiler/src/it/default-package-injected-type/src/main/java/TestApp.java
  class TestApp (line 23) | class TestApp implements Runnable {
    method run (line 26) | @Override public void run() {
    method main (line 30) | public static void main(String[] args) {
    class TestModule (line 34) | @Module(injects = { TestApp.class })
    class A (line 37) | @Singleton
      method A (line 39) | @Inject A() {}
      method doit (line 40) | public void doit() {}

FILE: compiler/src/it/extension-graph-setvalues/src/main/java/test/TestApp.java
  class TestApp (line 34) | class TestApp implements Runnable {
    method run (line 38) | @Override public void run() {
    method main (line 42) | public static void main(String[] args) {
    class RootModule (line 48) | @Module(injects = TestApp.class)
      method providers (line 50) | @Provides Set<Provider<String>> providers() {
      method strings (line 53) | @Provides(type = SET_VALUES) Set<String> strings() {
    class ExtensionModule (line 58) | @Module(addsTo = RootModule.class, injects = TestApp.class)
      method addToSet (line 60) | @Provides(type = SET) String addToSet() {

FILE: compiler/src/it/extension-graph/src/main/java/test/TestApp.java
  class TestApp (line 24) | class TestApp implements Runnable {
    method run (line 27) | @Override public void run() {
    method main (line 31) | public static void main(String[] args) {
    class RootModule (line 37) | @Module(injects = { A.class, B.class })
    class ExtensionModule (line 40) | @Module(addsTo=RootModule.class, injects = { C.class, TestApp.class })
    class A (line 43) | @Singleton
      method A (line 45) | @Inject A() {}
    class B (line 48) | static class B {
      method B (line 50) | @Inject B() {}
    class C (line 53) | static class C {
      method C (line 56) | @Inject C() {}
      method doit (line 57) | public void doit() {}

FILE: compiler/src/it/final-field-inject/src/main/java/test/TestApp.java
  class TestApp (line 21) | class TestApp {

FILE: compiler/src/it/include-non-module/src/main/java/test/TestApp.java
  class TestApp (line 24) | class TestApp {
    method main (line 25) | public static void main(String[] args) {
    class TestModule (line 31) | @Module(
      method provideString (line 35) | @Provides String provideString() {

FILE: compiler/src/it/inject-on-class/src/main/java/test/TestApp.java
  class TestApp (line 20) | @Inject

FILE: compiler/src/it/inject-parameterized-type/src/main/java/test/TestApp.java
  class TestApp (line 23) | class TestApp {
    method main (line 24) | public static void main(String[] args) {
    class Supertype (line 28) | static class Supertype<T> {
    class Subtype (line 32) | static class Subtype extends Supertype<Integer> {
    class TestModule (line 35) | @Module(injects = Subtype.class)
      method provideString (line 37) | @Provides String provideString() {

FILE: compiler/src/it/inner-classes-complaint-injection/src/main/java/test/TestApp.java
  class TestApp (line 26) | class TestApp {
    class Foo (line 28) | class Foo {
      method Foo (line 29) | @Inject public Foo() {}

FILE: compiler/src/it/method-injection/src/main/java/test/TestApp.java
  class TestApp (line 20) | class TestApp {
    method doThings (line 21) | @Inject public void doThings(Object things) {

FILE: compiler/src/it/missing-at-inject-constructor/src/main/java/test/TestApp.java
  class TestApp (line 24) | class TestApp implements Runnable {
    method run (line 27) | @Override public void run() {
    method main (line 31) | public static void main(String[] args) {
    class Dependency (line 35) | static class Dependency {
      method doit (line 37) | public void doit() { throw AssertionError(); }
    class TestModule (line 40) | @Module(injects = TestApp.class)

FILE: compiler/src/it/module-type-validation/src/main/java/test/TestModule.java
  class ThreadModule (line 20) | @Module
  type EnumModule (line 24) | @Module
  type InterfaceModule (line 28) | @Module

FILE: compiler/src/it/multiple-modules-setvalues/src/main/java/test/TestApp.java
  class TestApp (line 34) | class TestApp implements Runnable {
    method run (line 38) | @Override public void run() {
    method main (line 42) | public static void main(String[] args) {
    class RootModule (line 47) | @Module(injects = TestApp.class)
      method providers (line 49) | @Provides Set<Provider<String>> providers() {
      method strings (line 52) | @Provides(type = SET_VALUES) Set<String> strings() {
    class ContributingModule (line 57) | @Module(injects = TestApp.class, complete = false)
      method addToSet (line 59) | @Provides(type = SET) String addToSet() {

FILE: compiler/src/it/multiple-provides-methods/src/main/java/test/TestApp.java
  class TestApp (line 23) | class TestApp {
    class NotInjectable (line 24) | static class NotInjectable {
    class InjectableSubclass (line 27) | static class InjectableSubclass extends NotInjectable {
    class TestModule (line 32) | @Module(injects = InjectableSubclass.class)
      method string (line 34) | @Provides String string() {
      method integer (line 37) | @Provides Integer integer() {

FILE: compiler/src/it/multiple-qualifiers/src/main/java/test/TestApp.java
  class TestApp (line 28) | class TestApp {
    class TestClass1 (line 29) | static class TestClass1 {
    class TestClass2 (line 36) | static class TestClass2 {
      method TestClass2 (line 39) | public TestClass2(@MyQualifier1 @MyQualifier2 String constructorPara...
    class TestModule (line 44) | @Module(injects = TestClass1.class)
      method providesString (line 46) | @MyQualifier1

FILE: compiler/src/it/private-inject/src/main/java/test/TestApp.java
  class TestApp (line 20) | class TestApp {

FILE: compiler/src/it/private-inject/src/main/java/test/TestFoo.java
  class TestFoo (line 20) | class TestFoo {
    method TestFoo (line 21) | @Inject private TestFoo() {

FILE: compiler/src/it/provide-provider-or-lazy/src/main/java/test/TestModule.java
  class TestModule (line 23) | @Module class TestModule {
    method provideProvider (line 24) | @Provides Provider<Object> provideProvider() {
    method provideRawProvider (line 28) | @Provides Provider provideRawProvider() {
    method provideLazy (line 32) | @Provides Lazy<Object> provideLazy() {
    method provideRawLazy (line 36) | @Provides Lazy provideRawLazy() {

FILE: compiler/src/it/provides-method-not-in-module/src/main/java/test/TestApp.java
  class TestApp (line 21) | class TestApp {
    method providesString (line 23) | @Provides

FILE: compiler/src/it/provides-method-with-throws-clause/src/main/java/test/TestApp.java
  class TestApp (line 28) | class TestApp implements Runnable {
    method run (line 32) | @Override public void run() {
    method main (line 36) | public static void main(String[] args) {
    class TestModule (line 40) | @Module(injects = TestApp.class)
      method string (line 43) | @Provides String string() throws IOException {

FILE: compiler/src/it/qualifiers-on-invalid-elements-errors/src/main/java/test/TestApp.java
  class TestApp (line 27) | class TestApp {
    class TestClass1 (line 29) | @MyQualifier
      method TestClass1 (line 32) | @MyQualifier // qualifier on non-injectable constructor
    class TestClass2 (line 36) | static class TestClass2 {
      method TestClass2 (line 39) | @Inject

FILE: compiler/src/it/qualifiers-on-invalid-elements-warnings/src/main/java/test/TestApp.java
  class TestApp (line 27) | class TestApp {
    class TestClass (line 29) | static class TestClass {
      method TestClass (line 45) | public TestClass(@MyQualifier String constructorParam) {}
      method nonProvidesMethod (line 47) | @MyQualifier

FILE: compiler/src/it/same-provides-method-name/src/main/java/test/TestApp.java
  class TestApp (line 27) | class TestApp implements Runnable {
    method run (line 31) | @Override public void run() {
    method main (line 35) | public static void main(String[] args) {
    class Foo (line 39) | static class Foo {
    class MyFoo (line 42) | static class MyFoo extends Foo {
    class TestModule (line 45) | @Module(injects = TestApp.class)
      method providesFoo (line 48) | @Provides Foo providesFoo(MyFoo foo) {
      method providesFoo (line 52) | @Provides MyFoo providesFoo() {

FILE: compiler/src/it/static-injected-binding-doesnt-fail-providers/src/main/java/test/Test.java
  class Test (line 26) | public class Test {
    class InjectsOneField (line 28) | public static class InjectsOneField {
    class TestModule (line 32) | @Module(staticInjections = { InjectsOneField.class })
      method string (line 34) | @Provides String string() {

FILE: compiler/src/it/uninjectable-supertype/src/main/java/test/TestApp.java
  class TestApp (line 22) | class TestApp {
    class NotInjectable (line 23) | static class NotInjectable {
    class InjectableSubclass (line 26) | static class InjectableSubclass extends NotInjectable {
    class TestModule (line 30) | @Module(injects = InjectableSubclass.class)
      method provideString (line 32) | @Provides String provideString() {

FILE: compiler/src/it/valid-use-of-qualifiers/src/main/java/test/TestApp.java
  class TestApp (line 27) | class TestApp {
    class TestClass1 (line 28) | static class TestClass1 {
    class TestClass2 (line 32) | static class TestClass2 {
      method TestClass2 (line 35) | @Inject
    class TestModule (line 41) | @Module(injects = TestClass1.class)
      method providesString (line 44) | @Provides
      method providesString (line 50) | @Provides

FILE: compiler/src/main/java/dagger/internal/codegen/AdapterJavadocs.java
  class AdapterJavadocs (line 25) | public final class AdapterJavadocs {
    method bindingTypeDocs (line 49) | static CodeBlock bindingTypeDocs(

FILE: compiler/src/main/java/dagger/internal/codegen/GeneratorKeys.java
  class GeneratorKeys (line 35) | final class GeneratorKeys {
    method GeneratorKeys (line 38) | private GeneratorKeys() {
    method rawMembersKey (line 46) | public static String rawMembersKey(TypeMirror type) {
    method get (line 51) | public static String get(TypeMirror type) {
    method get (line 58) | public static String get(ExecutableElement method) {
    method getSetKey (line 69) | public static String getSetKey(ExecutableElement method) {
    method get (line 82) | public static String get(VariableElement variable) {
    method qualifierToString (line 92) | private static void qualifierToString(AnnotationMirror qualifier, Stri...
    method getQualifier (line 107) | private static AnnotationMirror getQualifier(

FILE: compiler/src/main/java/dagger/internal/codegen/GraphAnalysisErrorHandler.java
  class GraphAnalysisErrorHandler (line 28) | final class GraphAnalysisErrorHandler implements Linker.ErrorHandler {
    method GraphAnalysisErrorHandler (line 32) | GraphAnalysisErrorHandler(ProcessingEnvironment processingEnv, String ...
    method handleErrors (line 37) | @Override public void handleErrors(List<String> errors) {

FILE: compiler/src/main/java/dagger/internal/codegen/GraphAnalysisInjectBinding.java
  class GraphAnalysisInjectBinding (line 38) | final class GraphAnalysisInjectBinding extends Binding<Object> {
    method GraphAnalysisInjectBinding (line 44) | private GraphAnalysisInjectBinding(String provideKey, String membersKey,
    method create (line 54) | static GraphAnalysisInjectBinding create(TypeElement type, boolean mus...
    method hasAtInject (line 115) | private static boolean hasAtInject(Element enclosed) {
    method hasAtSingleton (line 119) | private static boolean hasAtSingleton(Element enclosed) {
    method attach (line 123) | @Override public void attach(Linker linker) {
    method get (line 135) | @Override public Object get() {
    method injectMembers (line 139) | @Override public void injectMembers(Object t) {
    method getDependencies (line 143) | @Override public void getDependencies(Set<Binding<?>> get, Set<Binding...

FILE: compiler/src/main/java/dagger/internal/codegen/GraphAnalysisLoader.java
  class GraphAnalysisLoader (line 34) | public final class GraphAnalysisLoader extends Loader {
    method GraphAnalysisLoader (line 38) | public GraphAnalysisLoader(ProcessingEnvironment processingEnv) {
    method getAtInjectBinding (line 42) | @Override public Binding<?> getAtInjectBinding(
    method resolveType (line 64) | @VisibleForTesting static TypeElement resolveType(Elements elements, S...
    method resolveType (line 83) | private static TypeElement resolveType(Elements elements, String class...
    method nextDollar (line 108) | private static int nextDollar(String className, CharSequence current, ...
    method getTypeElement (line 125) | private static TypeElement getTypeElement(Elements elements, CharSeque...
    method getModuleAdapter (line 137) | @Override public <T> ModuleAdapter<T> getModuleAdapter(Class<T> module...
    method getStaticInjection (line 141) | @Override public StaticInjection getStaticInjection(Class<?> injectedC...

FILE: compiler/src/main/java/dagger/internal/codegen/GraphAnalysisProcessor.java
  class GraphAnalysisProcessor (line 70) | @SupportedAnnotationTypes("dagger.Module")
    method getSupportedSourceVersion (line 77) | @Override public SourceVersion getSupportedSourceVersion() {
    method process (line 85) | @Override public boolean process(Set<? extends TypeElement> types, Rou...
    method error (line 159) | private void error(String message, Element element) {
    method processCompleteModule (line 163) | private Map<String, Binding<?>> processCompleteModule(TypeElement root...
    method elements (line 277) | private Elements elements() {
    method collectIncludesRecursively (line 281) | void collectIncludesRecursively(
    class ProviderMethodBinding (line 329) | static class ProviderMethodBinding extends ProvidesBinding<Object> {
      method ProviderMethodBinding (line 333) | protected ProviderMethodBinding(String provideKey, ExecutableElement...
      method attach (line 341) | @Override public void attach(Linker linker) {
      method get (line 350) | @Override public Object get() {
      method injectMembers (line 354) | @Override public void injectMembers(Object t) {
      method getDependencies (line 358) | @Override public void getDependencies(Set<Binding<?>> get, Set<Bindi...
      method toString (line 362) | @Override public String toString() {
    method writeDotFile (line 368) | void writeDotFile(TypeElement module, Map<String, Binding<?>> bindings...
    class ModuleValidationException (line 380) | static class ModuleValidationException extends IllegalStateException {
      method ModuleValidationException (line 383) | public ModuleValidationException(String message, Element source) {

FILE: compiler/src/main/java/dagger/internal/codegen/GraphAnalysisStaticInjection.java
  class GraphAnalysisStaticInjection (line 25) | public final class GraphAnalysisStaticInjection extends StaticInjection {
    method GraphAnalysisStaticInjection (line 29) | public GraphAnalysisStaticInjection(Element enclosingClass) {
    method attach (line 33) | @Override public void attach(Linker linker) {
    method inject (line 46) | @Override public void inject() {

FILE: compiler/src/main/java/dagger/internal/codegen/GraphVisualizer.java
  class GraphVisualizer (line 33) | public final class GraphVisualizer {
    method write (line 47) | public void write(Map<String, Binding<?>> bindings, GraphVizWriter wri...
    method buildNamesIndex (line 67) | private Map<Binding<?>, String> buildNamesIndex(Map<String, Binding<?>...
    method shortName (line 102) | String shortName(String key) {
    class BindingComparator (line 129) | private static class BindingComparator implements Comparator<Binding<?...
      method compare (line 130) | @Override
      method getStringForBinding (line 135) | private String getStringForBinding(Binding<?> binding) {

FILE: compiler/src/main/java/dagger/internal/codegen/GraphVizWriter.java
  class GraphVizWriter (line 28) | public final class GraphVizWriter implements Closeable {
    method GraphVizWriter (line 39) | public GraphVizWriter(Writer out) {
    method beginGraph (line 43) | public void beginGraph(String... attributes) throws IOException {
    method endGraph (line 54) | public void endGraph() throws IOException {
    method node (line 60) | public void node(String name, String... attributes) throws IOException {
    method edge (line 68) | public void edge(String source, String target, String... attributes) t...
    method nodeDefaults (line 79) | public void nodeDefaults(String... attributes) throws IOException {
    method edgeDefaults (line 87) | public void edgeDefaults(String... attributes) throws IOException {
    method attributes (line 95) | private void attributes(String[] attributes) throws IOException {
    method inlineAttributes (line 107) | private void inlineAttributes(String[] attributes) throws IOException {
    method nodeName (line 120) | private String nodeName(String name) throws IOException {
    method literal (line 130) | private String literal(String raw) {
    method indent (line 138) | private void indent() throws IOException {
    method nextName (line 144) | private String nextName(String prefix) {
    method close (line 148) | @Override public void close() throws IOException {

FILE: compiler/src/main/java/dagger/internal/codegen/InjectAdapterProcessor.java
  class InjectAdapterProcessor (line 74) | @SupportedAnnotationTypes("javax.inject.Inject")
    method getSupportedSourceVersion (line 78) | @Override public SourceVersion getSupportedSourceVersion() {
    method process (line 82) | @Override public boolean process(Set<? extends TypeElement> types, Rou...
    method generateInjectionsForClass (line 108) | private void generateInjectionsForClass(InjectedClass injectedClass) t...
    method allTypesExist (line 121) | private boolean allTypesExist(Collection<? extends Element> elements) {
    method findInjectedClassNames (line 130) | private Set<String> findInjectedClassNames(RoundEnvironment env) {
    method validateInjectable (line 142) | private boolean validateInjectable(Element injectable) {
    method createInjectedClass (line 189) | private InjectedClass createInjectedClass(String injectedClassName) {
    method generateInjectAdapter (line 242) | private void generateInjectAdapter(TypeElement type, ExecutableElement...
    method generateStaticInjection (line 304) | private void generateStaticInjection(TypeElement type, List<Element> f...
    method memberBindingField (line 326) | private FieldSpec memberBindingField(boolean disambiguateFields, Eleme...
    method parameterBindingField (line 331) | private FieldSpec parameterBindingField(boolean disambiguateFields, Va...
    method supertypeBindingField (line 336) | private FieldSpec supertypeBindingField(TypeMirror supertype) {
    method writeInjectAdapterConstructor (line 340) | private MethodSpec writeInjectAdapterConstructor(ExecutableElement con...
    method attachMethod (line 355) | private MethodSpec attachMethod(ExecutableElement constructor,
    method getDependenciesMethod (line 392) | private MethodSpec getDependenciesMethod(ExecutableElement constructor,
    method getMethod (line 418) | private MethodSpec getMethod(ExecutableElement constructor, boolean di...
    method membersInjectMethod (line 441) | private MethodSpec membersInjectMethod(List<Element> fields, boolean d...
    method staticInjectMethod (line 459) | private MethodSpec staticInjectMethod(List<Element> fields, ClassName ...
    method fieldName (line 473) | private String fieldName(boolean disambiguateFields, Element field) {
    method parameterName (line 477) | private String parameterName(boolean disambiguateFields, Element param...
    method error (line 481) | private void error(String msg, Element element) {
    class InjectedClass (line 485) | static class InjectedClass {
      method InjectedClass (line 491) | InjectedClass(TypeElement type, List<Element> staticFields, Executab...

FILE: compiler/src/main/java/dagger/internal/codegen/ModuleAdapterProcessor.java
  class ModuleAdapterProcessor (line 84) | @SupportedAnnotationTypes({ "*" })
    method getSupportedSourceVersion (line 92) | @Override public SourceVersion getSupportedSourceVersion() {
    method process (line 96) | @Override public boolean process(Set<? extends TypeElement> types, Rou...
    method error (line 127) | private void error(String msg, Element element) {
    method providerMethodsByClass (line 134) | private Map<String, List<ExecutableElement>> providerMethodsByClass(Ro...
    method findProvidesMethods (line 223) | private Set<? extends Element> findProvidesMethods(RoundEnvironment en...
    method generateModuleAdapter (line 233) | private JavaFile generateModuleAdapter(TypeElement type,
    method extractDuplicates (line 345) | private static List<Object> extractDuplicates(Object[] items) {
    method injectsInitializer (line 354) | private CodeBlock injectsInitializer(Object[] injects) {
    method staticInjectionsInitializer (line 368) | private CodeBlock staticInjectionsInitializer(Object[] staticInjection...
    method includesInitializer (line 378) | private CodeBlock includesInitializer(TypeElement type, Object[] inclu...
    method bindingClassName (line 395) | private ClassName bindingClassName(ClassName adapterName, ExecutableEl...
    method generateProvidesAdapter (line 417) | private TypeSpec generateProvidesAdapter(ClassName moduleClassName, Cl...
    method parameterName (line 500) | private String parameterName(Element parameter) {

FILE: compiler/src/main/java/dagger/internal/codegen/Util.java
  class Util (line 55) | final class Util {
    method Util (line 70) | private Util() {
    method getPackage (line 73) | public static PackageElement getPackage(Element type) {
    method getApplicationSupertype (line 85) | public static TypeMirror getApplicationSupertype(TypeElement type) {
    method adapterName (line 91) | public static ClassName adapterName(ClassName type, String suffix) {
    method typeToString (line 97) | public static String typeToString(TypeMirror type) {
    method rawTypeToString (line 104) | public static String rawTypeToString(TypeMirror type, char innerClassS...
    method typeToString (line 123) | public static void typeToString(final TypeMirror type, final StringBui...
    method injectableType (line 182) | public static TypeName injectableType(TypeMirror type) {
    method visitString (line 210) | @Override public Object visitString(String s, Void p) {
    method visitType (line 218) | @Override public Object visitType(TypeMirror t, Void p) {
    method defaultAction (line 221) | @Override protected Object defaultAction(Object o, Void v) {
    method visitArray (line 224) | @Override public Object visitArray(List<? extends AnnotationValue> val...
    method getAnnotation (line 239) | public static Map<String, Object> getAnnotation(Class<?> annotationTyp...
    method lenientIsInstance (line 272) | private static boolean lenientIsInstance(Class<?> expectedClass, Objec...
    method elementToString (line 290) | static String elementToString(Element element) {
    method rawTypeToString (line 303) | static void rawTypeToString(StringBuilder result, TypeElement type,
    method box (line 317) | static TypeName box(PrimitiveType primitiveType) {
    method getNoArgsConstructor (line 346) | public static ExecutableElement getNoArgsConstructor(TypeElement type) {
    method isCallableConstructor (line 364) | public static boolean isCallableConstructor(ExecutableElement construc...
    method className (line 377) | public static String className(ExecutableElement method) {
    method isInterface (line 381) | public static boolean isInterface(TypeMirror typeMirror) {
    method isStatic (line 386) | static boolean isStatic(Element element) {
    method bindingOf (line 395) | static ParameterizedTypeName bindingOf(TypeMirror type) {
    class CodeGenerationIncompleteException (line 404) | final static class CodeGenerationIncompleteException extends IllegalSt...
      method CodeGenerationIncompleteException (line 405) | public CodeGenerationIncompleteException(String s) {

FILE: compiler/src/main/java/dagger/internal/codegen/ValidationProcessor.java
  class ValidationProcessor (line 56) | @SupportedAnnotationTypes({ "*" })
    method getSupportedSourceVersion (line 59) | @Override public SourceVersion getSupportedSourceVersion() {
    method process (line 63) | @Override public boolean process(Set<? extends TypeElement> types, Rou...
    method validateProvides (line 79) | private void validateProvides(Element element) {
    method validateQualifiers (line 86) | private void validateQualifiers(Element element, Map<Element, Element>...
    method validateScoping (line 131) | private void validateScoping(Element element) {
    method getAllElements (line 165) | private void getAllElements(
    method addAllEnclosed (line 172) | private void addAllEnclosed(
    method isProvidesMethod (line 186) | private boolean isProvidesMethod(Element element) {
    method isProvidesMethodParameter (line 194) | private boolean isProvidesMethodParameter(
    method isInjectableConstructorParameter (line 203) | private boolean isInjectableConstructorParameter(
    method error (line 209) | private void error(String msg, Element element) {
    method warning (line 213) | private void warning(String msg, Element element) {

FILE: compiler/src/test/java/dagger/internal/codegen/DotWriterTest.java
  class DotWriterTest (line 26) | @RunWith(JUnit4.class)
    method graphWithAttributes (line 31) | @Test public void graphWithAttributes() throws IOException {
    method subgraph (line 45) | @Test public void subgraph() throws IOException {
    method defaultAttributes (line 66) | @Test public void defaultAttributes() throws IOException {
    method invalidNodeNames (line 80) | @Test public void invalidNodeNames() throws IOException {
    method assertGraph (line 94) | private void assertGraph(String expected) {

FILE: compiler/src/test/java/dagger/internal/codegen/GraphAnalysisLoaderTest.java
  class GraphAnalysisLoaderTest (line 36) | @RunWith(JUnit4.class)
    method resolveType (line 38) | @Test public void resolveType() {

FILE: compiler/src/test/java/dagger/internal/codegen/GraphVisualizerTest.java
  class GraphVisualizerTest (line 29) | @RunWith(JUnit4.class)
    method testSimpleKey (line 34) | @Test public void testSimpleKey() throws Exception {
    method testAnnotatedKey (line 41) | @Test public void testAnnotatedKey() throws Exception {
    method testAnnotatedKeyWithParameters (line 48) | @Test public void testAnnotatedKeyWithParameters() throws Exception {
    method testArrayKey (line 55) | @Test public void testArrayKey() throws Exception {
    method testTypeParameterKey (line 61) | @Test public void testTypeParameterKey() throws Exception {
    method testEverythingKey (line 69) | @Test public void testEverythingKey() throws Exception {
    method testMembersKey (line 75) | @Test public void testMembersKey() throws Exception {
    method fieldKey (line 80) | private String fieldKey(String fieldName) throws NoSuchFieldException {

FILE: compiler/src/test/java/dagger/testing/it/BuildLogValidator.java
  class BuildLogValidator (line 25) | public class BuildLogValidator {
    method assertHasText (line 33) | public void assertHasText(File buildLogfile, String ... expectedString...
    method assertDoesNotHaveText (line 58) | public void assertDoesNotHaveText(File buildLogfile, String... unexpec...
    method getBuildOutput (line 77) | private String getBuildOutput(File buildLogfile) throws Throwable {
    method appendBuildStatus (line 93) | private void appendBuildStatus(StringBuilder sb, String buildOutput) {

FILE: compiler/src/test/java/dagger/tests/integration/ProcessorTestUtils.java
  class ProcessorTestUtils (line 29) | public class ProcessorTestUtils {
    method daggerProcessors (line 30) | public static Iterable<? extends Processor> daggerProcessors() {

FILE: compiler/src/test/java/dagger/tests/integration/codegen/GenericInjectAdapterGenerationTest.java
  class GenericInjectAdapterGenerationTest (line 28) | @RunWith(JUnit4.class)
    method basicInjectAdapter (line 31) | @Test public void basicInjectAdapter() {

FILE: compiler/src/test/java/dagger/tests/integration/codegen/InjectAdapterGenerationTest.java
  class InjectAdapterGenerationTest (line 29) | @RunWith(JUnit4.class)
    method basicInjectAdapter (line 31) | @Test public void basicInjectAdapter() {

FILE: compiler/src/test/java/dagger/tests/integration/codegen/ModuleAdapterGenerationTest.java
  class ModuleAdapterGenerationTest (line 31) | @RunWith(JUnit4.class)
    method providerForCtorInjection (line 48) | @Test public void providerForCtorInjection() {
    method injectsMembersInjectedAndProvidedAndConstructedTypes (line 138) | @Test public void injectsMembersInjectedAndProvidedAndConstructedTypes...
    method providesHasParameterNamedModule (line 260) | @Test public void providesHasParameterNamedModule() {
    method duplicateInjectsFails (line 292) | @Test public void duplicateInjectsFails() {
    method duplicateIncludesFails (line 310) | @Test public void duplicateIncludesFails() {

FILE: compiler/src/test/java/dagger/tests/integration/operation/FailureModeErrorsTest.java
  class FailureModeErrorsTest (line 30) | @RunWith(JUnit4.class)
    class CompleteModule (line 33) | @Module
    class ArrayFoo (line 36) | static class ArrayFoo {
      method ArrayFoo (line 37) | @Inject ArrayFoo(String[] ignored) {}
    class ArrayFooModule (line 40) | @Module(injects = ArrayFoo.class, complete = false)
    method failOnMissingModule_arrayorgenerics (line 43) | @Test public void failOnMissingModule_arrayorgenerics() {
    class QualifyingFoo (line 58) | static class QualifyingFoo {
      method QualifyingFoo (line 59) | @Inject QualifyingFoo(@MyFoo String ignored) {}
    class QualifyingFooModule (line 62) | @Module(injects = QualifyingFoo.class, complete = false)
    method failOnMissingModule_qualified (line 65) | @Test public void failOnMissingModule_qualified() {

FILE: compiler/src/test/java/dagger/tests/integration/operation/PrimitiveInjectionTest.java
  class PrimitiveInjectionTest (line 29) | @RunWith(JUnit4.class)
    class ArrayInjectable (line 31) | static class ArrayInjectable {
    class PrimitiveArrayModule (line 41) | @Module(injects = ArrayInjectable.class)
      method byteArray (line 43) | @Provides byte[] byteArray() { return new byte[] { Byte.MAX_VALUE }; }
      method provideInt (line 44) | @Provides int[] provideInt() { return new int[] { Integer.MAX_VALUE ...
      method provideBoolean (line 45) | @Provides boolean[] provideBoolean() { return new boolean[] { true }; }
      method provideLong (line 46) | @Provides long[] provideLong() { return new long[] { Long.MAX_VALUE ...
      method provideChar (line 47) | @Provides char[] provideChar() { return new char[] { Character.MAX_V...
      method provideFloat (line 48) | @Provides float[] provideFloat() { return new float[] { Float.MAX_VA...
      method provideDouble (line 49) | @Provides double[] provideDouble() { return new double[] { Double.MA...
    method primitiveArrayTypesAllInjected (line 52) | @Test public void primitiveArrayTypesAllInjected() {

FILE: compiler/src/test/java/dagger/tests/integration/operation/SimpleInjectionTest.java
  class SimpleInjectionTest (line 29) | @RunWith(JUnit4.class)
    class AbstractFoo (line 31) | static abstract class AbstractFoo {
    class Foo (line 35) | static class Foo extends AbstractFoo { }
    class FooModule (line 37) | @Module(injects = Foo.class)
      method string (line 39) | @Provides String string() { return "blah"; }
    class ProvidingFooModule (line 42) | @Module(injects = Foo.class)
      method string (line 44) | @Provides String string() { return "blah"; }
      method foo (line 45) | @Provides Foo foo(String blah) {
    method memberInject_WithoutProvidesMethod (line 52) | @Test public void memberInject_WithoutProvidesMethod() {
    method membersInject_WithProvidesMethod (line 58) | @Test public void membersInject_WithProvidesMethod() {
    method get_WithProvidesMethod (line 64) | @Test public void get_WithProvidesMethod() {
    class Bar (line 69) | static class Bar { }
    class BarModule (line 71) | @Module(injects = Bar.class)
    method membersInject_WithNonInjectable (line 75) | @Test public void membersInject_WithNonInjectable() {
    class ProvidingBarModule (line 80) | @Module(injects = Bar.class)
      method bar (line 82) | @Provides public Bar bar() { return new Bar(); }
    method membersInject_WithProvidedNonInjectable (line 85) | @Test public void membersInject_WithProvidedNonInjectable() {

FILE: compiler/src/test/java/dagger/tests/integration/validation/CyclicDependencyTest.java
  class CyclicDependencyTest (line 29) | @RunWith(JUnit4.class)
    method cyclicDepsWithInjectables (line 32) | @Test public void cyclicDepsWithInjectables() {
    method cyclicDepsWithProvidesMethods (line 58) | @Test public void cyclicDepsWithProvidesMethods() {

FILE: compiler/src/test/java/dagger/tests/integration/validation/CyclicModuleIncludesTest.java
  class CyclicModuleIncludesTest (line 29) | @RunWith(JUnit4.class)
    method cyclicModuleSelfIncludes (line 50) | @Test public void cyclicModuleSelfIncludes() {
    method cyclicModuleIncludes_full_cycle (line 59) | @Test public void cyclicModuleIncludes_full_cycle() {
    method cyclicModuleIncludes_initial_inclusion (line 76) | @Test public void cyclicModuleIncludes_initial_inclusion() {

FILE: compiler/src/test/java/dagger/tests/integration/validation/GeneratedTypesNotReadyTest.java
  class GeneratedTypesNotReadyTest (line 45) | @RunWith(JUnit4.class)
    method withstandsMissingTypeReferencedInInjects (line 59) | @Test public void withstandsMissingTypeReferencedInInjects() {
    method withstandsMissingTypeReferencedInsideModule (line 79) | @Test public void withstandsMissingTypeReferencedInsideModule() {
    method withstandsMissingTypeReferencedByProvidesReturnType (line 98) | @Test public void withstandsMissingTypeReferencedByProvidesReturnType() {
    method failsWhenMissingGenericTypeReferencedByProvidesReturnType (line 122) | @Test public void failsWhenMissingGenericTypeReferencedByProvidesRetur...
    method withstandsMissingTypeReferencedInTransitiveJITDependency (line 149) | @Test public void withstandsMissingTypeReferencedInTransitiveJITDepend...
    method verifyFooImplGeneratorIsCompilingWithoutDagger (line 171) | @Test public void verifyFooImplGeneratorIsCompilingWithoutDagger() {
    class FooImplGenerator (line 189) | @SupportedAnnotationTypes("*")
      method process (line 192) | @Override public boolean process(Set<? extends TypeElement> na1, Rou...
      method getSupportedSourceVersion (line 223) | @Override public SourceVersion getSupportedSourceVersion() {

FILE: compiler/src/test/java/dagger/tests/integration/validation/LibraryModuleTest.java
  class LibraryModuleTest (line 31) | @RunWith(JUnit4.class)
    method unusedProviderMethodsPassOnLibrary (line 33) | @Test public void unusedProviderMethodsPassOnLibrary() {
    method unusedProviderMethodsFailOnNonLibrary (line 51) | @Test public void unusedProviderMethodsFailOnNonLibrary() {
    method injectsOfInterfaceMakesProvidesBindingNotAnOrphan (line 73) | @Test public void injectsOfInterfaceMakesProvidesBindingNotAnOrphan() {
    method injectsOfClassMakesProvidesBindingNotAnOrphan (line 92) | @Test public void injectsOfClassMakesProvidesBindingNotAnOrphan() {

FILE: compiler/src/test/java/dagger/tests/integration/validation/ScopeAnnotationUseTest.java
  class ScopeAnnotationUseTest (line 37) | @RunWith(JUnit4.class)
    method compileSucceedsScopeOnConcreteType (line 46) | @Test public void compileSucceedsScopeOnConcreteType() {
    method compileSucceedsScopeOnProvidesMethod (line 64) | @Test public void compileSucceedsScopeOnProvidesMethod() {
    method compileSucceedsWithScopedSuppressedNonProvidesMethod (line 83) | @Test public void compileSucceedsWithScopedSuppressedNonProvidesMethod...
    method compileSucceedsWithScopedMultiplySuppressedNonProvidesMethod (line 100) | @Test public void compileSucceedsWithScopedMultiplySuppressedNonProvid...
    method compileWarnsWithScopedNonProvidesMethod (line 117) | @Test public void compileWarnsWithScopedNonProvidesMethod() {
    method compileWarnsWithScopedIncorrectlySuppressedNonProvidesMethod (line 134) | @Test public void compileWarnsWithScopedIncorrectlySuppressedNonProvid...
    method compileFailsWithScopeOnInterface (line 152) | @Test public void compileFailsWithScopeOnInterface() {
    method compileFailsWithScopeOnAbstractClass (line 172) | @Test public void compileFailsWithScopeOnAbstractClass() {
    method compileFailsWithScopeOnField (line 192) | @Test public void compileFailsWithScopeOnField() {
    method compileFailsWithScopeOnMethodParameter (line 214) | @Test public void compileFailsWithScopeOnMethodParameter() {
    method compileFailsWithMultipleScopeAnnotations (line 236) | @Test public void compileFailsWithMultipleScopeAnnotations() {
    method compileFailsWithScopeOnConstructor (line 276) | @Test public void compileFailsWithScopeOnConstructor() {

FILE: compiler/src/test/java/dagger/tests/integration/validation/SimpleMissingDependencyTest.java
  class SimpleMissingDependencyTest (line 29) | @RunWith(JUnit4.class)
    method missingDependency (line 32) | @Test public void missingDependency() {

FILE: core/src/main/java/dagger/Lazy.java
  type Lazy (line 147) | public interface Lazy<T> {
    method get (line 152) | T get();

FILE: core/src/main/java/dagger/MembersInjector.java
  type MembersInjector (line 28) | public interface MembersInjector<T> {
    method injectMembers (line 41) | void injectMembers(T instance);

FILE: core/src/main/java/dagger/ObjectGraph.java
  class ObjectGraph (line 65) | public abstract class ObjectGraph {
    method ObjectGraph (line 66) | ObjectGraph() {
    method get (line 75) | public abstract <T> T get(Class<T> type);
    method inject (line 84) | public abstract <T> T inject(T instance);
    method plus (line 99) | public abstract ObjectGraph plus(Object... modules);
    method validate (line 107) | public abstract void validate();
    method injectStatics (line 113) | public abstract void injectStatics();
    method create (line 128) | public static ObjectGraph create(Object... modules) {
    method createWith (line 133) | static ObjectGraph createWith(Loader loader, Object... modules) {
    class DaggerObjectGraph (line 138) | static class DaggerObjectGraph extends ObjectGraph {
      method DaggerObjectGraph (line 146) | DaggerObjectGraph(DaggerObjectGraph base,
      method checkNotNull (line 161) | private static <T> T checkNotNull(T object, String label) {
      method makeGraph (line 166) | static ObjectGraph makeGraph(DaggerObjectGraph base, Loader plugin, ...
      method plus (line 202) | @Override public ObjectGraph plus(Object... modules) {
      method linkStaticInjections (line 207) | private void linkStaticInjections() {
      method linkInjectableTypes (line 218) | private void linkInjectableTypes() {
      method validate (line 225) | @Override public void validate() {
      method linkEverything (line 233) | private Map<String, Binding<?>> linkEverything() {
      method injectStatics (line 248) | @Override public void injectStatics() {
      method get (line 265) | @Override public <T> T get(Class<T> type) {
      method inject (line 275) | @Override public <T> T inject(T instance) {
      method getInjectableTypeBinding (line 294) | private Binding<?> getInjectableTypeBinding(
    class StandardBindings (line 322) | private static final class StandardBindings extends BindingsGroup {
      method StandardBindings (line 325) | public StandardBindings() {
      method StandardBindings (line 329) | public StandardBindings(List<SetBinding<?>> baseSetBindings) {
      method contributeSetBinding (line 339) | @Override public Binding<?> contributeSetBinding(String key, SetBind...
    class OverridesBindings (line 350) | private static final class OverridesBindings extends BindingsGroup {
      method OverridesBindings (line 351) | OverridesBindings() { }
      method contributeSetBinding (line 353) | @Override public Binding<?> contributeSetBinding(String key, SetBind...

FILE: core/src/main/java/dagger/Provides.java
  type Type (line 36) | enum Type {

FILE: core/src/main/java/dagger/internal/ArrayQueue.java
  class ArrayQueue (line 58) | public class ArrayQueue<E> extends AbstractCollection<E>
    method allocateElements (line 98) | private void allocateElements(int numElements) {
    method doubleCapacity (line 121) | private void doubleCapacity() {
    method ArrayQueue (line 141) | public ArrayQueue() {
    method ArrayQueue (line 151) | public ArrayQueue(int numElements) {
    method ArrayQueue (line 165) | public ArrayQueue(Collection<? extends E> c) {
    method add (line 179) | @Override
    method offer (line 196) | @Override
    method remove (line 210) | @Override
    method poll (line 226) | @Override
    method element (line 246) | @Override
    method peek (line 261) | @Override
    method delete (line 278) | private boolean delete(int i) {
    method size (line 324) | @Override
    method isEmpty (line 334) | @Override
    method iterator (line 347) | @Override
    class QueueIterator (line 353) | private class QueueIterator implements Iterator<E> {
      method hasNext (line 371) | @Override
      method next (line 376) | @Override
      method remove (line 390) | @Override
    method contains (line 410) | @Override
    method remove (line 436) | @Override
    method clear (line 457) | @Override
    method toArray (line 485) | @Override
    method toArray (line 526) | @Override
    method clone (line 551) | @Override
    method writeObject (line 577) | private void writeObject(java.io.ObjectOutputStream s)
    method readObject (line 593) | private void readObject(java.io.ObjectInputStream s)

FILE: core/src/main/java/dagger/internal/Binding.java
  class Binding (line 25) | public abstract class Binding<T> implements Provider<T>, MembersInjector...
    method get (line 27) | @Override public Object get() {
    method injectMembers (line 30) | @Override public void injectMembers(Object t) {
    method Binding (line 64) | protected Binding(String provideKey, String membersKey, boolean single...
    method attach (line 78) | public void attach(Linker linker) {
    method injectMembers (line 81) | @Override public void injectMembers(T t) {
    method get (line 86) | @Override public T get() {
    method getDependencies (line 101) | public void getDependencies(Set<Binding<?>> getBindings, Set<Binding<?...
    method setLinked (line 105) | void setLinked() {
    method isLinked (line 109) | public boolean isLinked() {
    method isSingleton (line 113) | boolean isSingleton() {
    method isVisiting (line 117) | public boolean isVisiting() {
    method setVisiting (line 121) | public void setVisiting(boolean visiting) {
    method isCycleFree (line 125) | public boolean isCycleFree() {
    method setCycleFree (line 129) | public void setCycleFree(boolean cycleFree) {
    method setLibrary (line 133) | public void setLibrary(boolean library) {
    method library (line 137) | public boolean library() {
    method setDependedOn (line 141) | public void setDependedOn(boolean dependedOn) {
    method dependedOn (line 145) | public boolean dependedOn() {
    method toString (line 149) | @Override public String toString() {
    class InvalidBindingException (line 155) | public static class InvalidBindingException extends RuntimeException {
      method InvalidBindingException (line 158) | public InvalidBindingException(String type, String error) {

FILE: core/src/main/java/dagger/internal/BindingsGroup.java
  class BindingsGroup (line 28) | public abstract class BindingsGroup {
    method contributeSetBinding (line 31) | public abstract Binding<?> contributeSetBinding(String key, SetBinding...
    method contributeProvidesBinding (line 33) | public Binding<?> contributeProvidesBinding(String key, ProvidesBindin...
    method put (line 37) | protected Binding<?> put(String key, Binding<?> value) {
    method get (line 46) | public Binding<?> get(String key) {
    method entrySet (line 50) | public final Set<Entry<String, Binding<?>>> entrySet() {
    method toString (line 54) | @Override public String toString() {

FILE: core/src/main/java/dagger/internal/BuiltInBinding.java
  class BuiltInBinding (line 22) | final class BuiltInBinding<T> extends Binding<T> {
    method BuiltInBinding (line 27) | public BuiltInBinding(
    method attach (line 34) | @Override public void attach(Linker linker) {
    method injectMembers (line 38) | @Override public void injectMembers(T t) {
    method get (line 42) | @SuppressWarnings("unchecked") // At runtime we know 'T' is a Provider...
    method getDelegate (line 47) | public Binding<?> getDelegate() {

FILE: core/src/main/java/dagger/internal/FailoverLoader.java
  class FailoverLoader (line 32) | public final class FailoverLoader extends Loader {
    method create (line 41) | @Override protected ModuleAdapter<?> create(Class<?> type) {
    method getModuleAdapter (line 55) | @SuppressWarnings("unchecked") // cache ensures types match
    method getAtInjectBinding (line 60) | @Override public Binding<?> getAtInjectBinding(
    method getStaticInjection (line 77) | @Override public StaticInjection getStaticInjection(Class<?> injectedC...

FILE: core/src/main/java/dagger/internal/Keys.java
  class Keys (line 42) | public final class Keys {
    method create (line 51) | @Override protected Boolean create(Class<? extends Annotation> annotat...
    method Keys (line 56) | Keys() {
    method get (line 60) | public static String get(Type type) {
    method getMembersKey (line 65) | public static String getMembersKey(Class<?> key) {
    method get (line 71) | private static String get(Type type, Annotation annotation) {
    method getSetKey (line 91) | public static String getSetKey(Type type, Annotation[] annotations, Ob...
    method get (line 111) | public static String get(Type type, Annotation[] annotations, Object s...
    method extractQualifier (line 119) | private static Annotation extractQualifier(Annotation[] annotations,
    method typeToString (line 139) | private static void typeToString(Type type, StringBuilder result, bool...
    method getBuiltInBindingsKey (line 180) | static String getBuiltInBindingsKey(String key) {
    method getLazyKey (line 196) | static String getLazyKey(String key) {
    method startOfType (line 209) | private static int startOfType(String key) {
    method extractKey (line 227) | private static String extractKey(String key, int start, String delegat...
    method substringStartsWith (line 232) | private static boolean substringStartsWith(String string, int offset, ...
    method isAnnotated (line 237) | public static boolean isAnnotated(String key) {
    method getClassName (line 246) | public static String getClassName(String key) {
    method isPlatformType (line 257) | public static boolean isPlatformType(String name) {
    method boxIfPrimitive (line 261) | private static Type boxIfPrimitive(Type type) {

FILE: core/src/main/java/dagger/internal/LazyBinding.java
  class LazyBinding (line 24) | final class LazyBinding<T> extends Binding<Lazy<T>> {
    method LazyBinding (line 32) | LazyBinding(String key, Object requiredBy, ClassLoader loader, String ...
    method attach (line 38) | @SuppressWarnings("unchecked") // At runtime we know it's a Binding<La...
    method injectMembers (line 44) | @Override public void injectMembers(Lazy<T> t) {
    method get (line 48) | @Override

FILE: core/src/main/java/dagger/internal/Linker.java
  class Linker (line 30) | public final class Linker {
    method Linker (line 64) | public Linker(Linker base, Loader plugin, ErrorHandler errorHandler) {
    method installBindings (line 81) | public void installBindings(BindingsGroup toInstall) {
    method linkAll (line 99) | public Map<String, Binding<?>> linkAll() {
    method fullyLinkedBindings (line 118) | public Map<String, Binding<?>> fullyLinkedBindings() {
    method linkRequested (line 129) | public void linkRequested() {
    method assertLockHeld (line 193) | private void assertLockHeld() {
    method createBinding (line 208) | private Binding<?> createBinding(String key, Object requiredBy, ClassL...
    method requestBinding (line 238) | @Deprecated
    method requestBinding (line 249) | public Binding<?> requestBinding(String key, Object requiredBy, ClassL...
    method requestBinding (line 254) | @Deprecated
    method requestBinding (line 272) | public Binding<?> requestBinding(String key, Object requiredBy, ClassL...
    method putBinding (line 305) | private <T> void putBinding(final Binding<T> binding) {
    method scope (line 321) | static <T> Binding<T> scope(final Binding<T> binding) {
    method putIfAbsent (line 332) | private <K, V> void putIfAbsent(Map<K, V> map, K key, V value) {
    method addError (line 340) | private void addError(String message) {
    class SingletonBinding (line 347) | private static class SingletonBinding<T> extends Binding<T> {
      method SingletonBinding (line 351) | SingletonBinding(Binding<T> binding) {
      method attach (line 356) | @Override public void attach(Linker linker) {
      method injectMembers (line 360) | @Override public void injectMembers(T t) {
      method get (line 364) | @SuppressWarnings("unchecked") // onlyInstance is either 'UNINITIALI...
      method getDependencies (line 376) | @Override public void getDependencies(Set<Binding<?>> get, Set<Bindi...
      method isCycleFree (line 380) | @Override public boolean isCycleFree() {
      method isLinked (line 384) | @Override public boolean isLinked() {
      method isVisiting (line 388) | @Override public boolean isVisiting() {
      method library (line 392) | @Override public boolean library() {
      method dependedOn (line 396) | @Override public boolean dependedOn() {
      method setCycleFree (line 400) | @Override public void setCycleFree(final boolean cycleFree) {
      method setVisiting (line 404) | @Override public void setVisiting(final boolean visiting) {
      method setLibrary (line 408) | @Override public void setLibrary(boolean library) {
      method setDependedOn (line 412) | @Override public void setDependedOn(boolean dependedOn) {
      method isSingleton (line 416) | @Override protected boolean isSingleton() {
      method setLinked (line 420) | @Override protected void setLinked() {
      method toString (line 424) | @Override public String toString() {
    type ErrorHandler (line 430) | public interface ErrorHandler {
      method handleErrors (line 432) | @Override public void handleErrors(List<String> errors) {
      method handleErrors (line 443) | void handleErrors(List<String> errors);
    class DeferredBinding (line 446) | private static class DeferredBinding extends Binding<Object> {
      method DeferredBinding (line 452) | DeferredBinding(String deferredKey, ClassLoader classLoader, Object ...
      method injectMembers (line 460) | @Override public void injectMembers(Object t) {
      method getDependencies (line 464) | @Override public void getDependencies(Set<Binding<?>> get, Set<Bindi...
      method toString (line 468) | @Override public String toString() {

FILE: core/src/main/java/dagger/internal/Loader.java
  class Loader (line 27) | public abstract class Loader {
    method create (line 30) | @Override protected Memoizer<String, Class<?>> create(final ClassLoade...
    method getAtInjectBinding (line 47) | public abstract Binding<?> getAtInjectBinding(
    method getModuleAdapter (line 54) | public abstract <T> ModuleAdapter<T> getModuleAdapter(Class<T> moduleC...
    method getStaticInjection (line 59) | public abstract StaticInjection getStaticInjection(Class<?> injectedCl...
    method loadClass (line 67) | protected Class<?> loadClass(ClassLoader classLoader, String name) {
    method instantiate (line 77) | protected <T> T instantiate(String name, ClassLoader classLoader) {

FILE: core/src/main/java/dagger/internal/Memoizer.java
  class Memoizer (line 29) | abstract class Memoizer<K, V> {
    method Memoizer (line 34) | public Memoizer() {
    method get (line 41) | public final V get(K key) {
    method create (line 73) | protected abstract V create(K key);
    method toString (line 75) | @Override public final String toString() {

FILE: core/src/main/java/dagger/internal/ModuleAdapter.java
  class ModuleAdapter (line 23) | public abstract class ModuleAdapter<T> {
    method ModuleAdapter (line 32) | protected ModuleAdapter(Class<T> moduleClass, String[] injectableTypes,
    method getBindings (line 48) | @SuppressWarnings("unused")
    method newModule (line 57) | protected T newModule() {
    method equals (line 61) | @Override
    method hashCode (line 73) | @Override

FILE: core/src/main/java/dagger/internal/Modules.java
  class Modules (line 26) | public final class Modules {
    method Modules (line 28) | private Modules() { }
    method loadModules (line 34) | public static Map<ModuleAdapter<?>, Object> loadModules(Loader loader,
    method collectIncludedModulesRecursively (line 72) | private static void collectIncludedModulesRecursively(Loader plugin, M...

FILE: core/src/main/java/dagger/internal/ProblemDetector.java
  class ProblemDetector (line 27) | public final class ProblemDetector {
    method detectCircularDependencies (line 28) | public void detectCircularDependencies(Collection<Binding<?>> bindings) {
    method detectUnusedBinding (line 32) | public void detectUnusedBinding(Collection<Binding<?>> bindings) {
    method detectCircularDependencies (line 51) | private static void detectCircularDependencies(Collection<Binding<?>> ...
    method detectProblems (line 84) | public void detectProblems(Collection<Binding<?>> values) {
    class ArraySet (line 89) | static class ArraySet<T> extends AbstractSet<T> {
      method add (line 92) | @Override public boolean add(T t) {
      method iterator (line 97) | @Override public Iterator<T> iterator() {
      method size (line 101) | @Override public int size() {

FILE: core/src/main/java/dagger/internal/ProvidesBinding.java
  class ProvidesBinding (line 22) | public abstract class ProvidesBinding<T> extends Binding<T> {
    method ProvidesBinding (line 31) | public ProvidesBinding(String key, boolean singleton, String moduleCla...
    method get (line 42) | @Override
    method toString (line 45) | @Override public String toString() {

FILE: core/src/main/java/dagger/internal/SetBinding.java
  class SetBinding (line 30) | public final class SetBinding<T> extends Binding<Set<T>> {
    method add (line 32) | public static <T> void add(BindingsGroup bindings, String setKey, Bind...
    method prepareSetBinding (line 36) | @SuppressWarnings("unchecked")
    method SetBinding (line 70) | public SetBinding(String key, Object requiredBy) {
    method SetBinding (line 80) | public SetBinding(SetBinding<T> original) {
    method attach (line 88) | @Override public void attach(Linker linker) {
    method size (line 94) | public int size() {
    method get (line 102) | @SuppressWarnings("unchecked") // Only Binding<T> and Set<T> are added...
    method getDependencies (line 119) | @Override public void getDependencies(
    method injectMembers (line 126) | @Override public void injectMembers(Set<T> t) {
    method toString (line 130) | @Override public String toString() {

FILE: core/src/main/java/dagger/internal/StaticInjection.java
  class StaticInjection (line 23) | public abstract class StaticInjection {
    method attach (line 25) | public abstract void attach(Linker linker);
    method inject (line 27) | public abstract void inject();

FILE: core/src/main/java/dagger/internal/ThrowingErrorHandler.java
  class ThrowingErrorHandler (line 23) | public final class ThrowingErrorHandler implements Linker.ErrorHandler {
    method handleErrors (line 25) | @Override public void handleErrors(List<String> errors) {

FILE: core/src/main/java/dagger/internal/loaders/GeneratedAdapters.java
  class GeneratedAdapters (line 23) | public final class GeneratedAdapters {
    method GeneratedAdapters (line 29) | private GeneratedAdapters() { }

FILE: core/src/main/java/dagger/internal/loaders/ReflectiveAtInjectBinding.java
  class ReflectiveAtInjectBinding (line 38) | public final class ReflectiveAtInjectBinding<T> extends Binding<T> {
    method ReflectiveAtInjectBinding (line 56) | private ReflectiveAtInjectBinding(String provideKey, String membersKey...
    method attach (line 69) | @SuppressWarnings("unchecked") // We're careful to make keys and bindi...
    method get (line 92) | @Override public T get() {
    method injectMembers (line 117) | @Override public void injectMembers(T t) {
    method getDependencies (line 130) | @Override public void getDependencies(Set<Binding<?>> get, Set<Binding...
    method toString (line 140) | @Override public String toString() {
    method create (line 144) | public static <T> Binding<T> create(Class<T> type, boolean mustHaveInj...
    method getConstructorsForType (line 230) | @SuppressWarnings("unchecked") // Class.getDeclaredConstructors is an ...

FILE: core/src/main/java/dagger/internal/loaders/ReflectiveStaticInjection.java
  class ReflectiveStaticInjection (line 31) | public final class ReflectiveStaticInjection extends StaticInjection {
    method ReflectiveStaticInjection (line 36) | private ReflectiveStaticInjection(ClassLoader loader, Field[] fields) {
    method attach (line 41) | @Override public void attach(Linker linker) {
    method inject (line 50) | @Override public void inject() {
    method create (line 60) | public static StaticInjection create(Class<?> injectedClass) {

FILE: core/src/test/java/dagger/ExtensionTest.java
  class ExtensionTest (line 30) | @RunWith(JUnit4.class)
    class A (line 32) | @Singleton
      method A (line 34) | @Inject A() {}
    class B (line 37) | static class B {
    class C (line 41) | @Singleton
    class D (line 47) | static class D {
    class RootModule (line 53) | @Module(injects = { A.class, B.class }) static class RootModule { }
    class ExtensionModule (line 55) | @Module(addsTo = RootModule.class, injects = { C.class, D.class })
    method basicExtension (line 58) | @Test public void basicExtension() {
    method basicInjection (line 63) | @Test public void basicInjection() {
    method scopedGraphs (line 81) | @Test public void scopedGraphs() {
    method assertFailInjectNotRegistered (line 106) | private void assertFailInjectNotRegistered(ObjectGraph graph, Class<?>...

FILE: core/src/test/java/dagger/ExtensionWithSetBindingsTest.java
  class ExtensionWithSetBindingsTest (line 34) | @RunWith(JUnit4.class)
    class RealSingleton (line 38) | @Singleton
    class Main (line 43) | @Singleton
    class RootModule (line 48) | @Module(injects = RealSingleton.class)
      method provideA (line 50) | @Provides(type=SET) @Singleton Integer provideA() { return counter.g...
      method provideB (line 51) | @Provides(type=SET) @Singleton Integer provideB() { return counter.g...
    class ExtensionModule (line 54) | @Module(addsTo = RootModule.class, injects = Main.class )
      method provideC (line 56) | @Provides(type=SET) @Singleton Integer provideC() { return counter.g...
      method provideD (line 57) | @Provides(type=SET) @Singleton Integer provideD() { return counter.g...
    class EmptyModule (line 60) | @Module
    class DuplicateModule (line 64) | @Module(library = true)
      method provideFoo (line 66) | @Provides @Singleton String provideFoo() { return "foo"; }
      method provideBar (line 67) | @Provides @Singleton String provideBar() { return "bar"; }
    method basicInjectionWithExtension (line 70) | @Test public void basicInjectionWithExtension() {
    class TestModule (line 85) | @Module(includes = ExtensionModule.class, overrides = true)
      method provide9999 (line 87) | @Provides(type=SET) @Singleton Integer provide9999() { return 9999; }
    method basicInjectionWithExtensionAndOverrides (line 90) | @Test public void basicInjectionWithExtensionAndOverrides() {
    method duplicateBindingsInSecondaryModule (line 99) | @Test public void duplicateBindingsInSecondaryModule() {

FILE: core/src/test/java/dagger/ExtensionWithStateTest.java
  class ExtensionWithStateTest (line 27) | @RunWith(JUnit4.class)
    class A (line 29) | static class A { }
    class B (line 31) | static class B {
    class RootModule (line 35) | @Module(
      method RootModule (line 41) | RootModule(A a) {
      method provideA (line 44) | @Provides A provideA() { return a; }
    class ExtensionModule (line 47) | @Module(addsTo = RootModule.class, injects = { B.class })
    method basicInjectionWithExtension (line 50) | @Test public void basicInjectionWithExtension() {

FILE: core/src/test/java/dagger/InjectStaticsTest.java
  class InjectStaticsTest (line 27) | @RunWith(JUnit4.class)
    method setUp (line 29) | @Before public void setUp() {
    class InjectsOneField (line 34) | public static class InjectsOneField {
    class InjectsStaticAndNonStatic (line 38) | public static class InjectsStaticAndNonStatic {
    method injectStatics (line 43) | @Test public void injectStatics() {
    method instanceFieldsNotInjectedByInjectStatics (line 57) | @Test public void instanceFieldsNotInjectedByInjectStatics() {
    method staticFieldsNotInjectedByInjectMembers (line 76) | @Test public void staticFieldsNotInjectedByInjectMembers() {

FILE: core/src/test/java/dagger/InjectionOfLazyTest.java
  class InjectionOfLazyTest (line 33) | @RunWith(JUnit4.class)
    method lazyValueCreation (line 35) | @Test public void lazyValueCreation() {
    method lazyNullCreation (line 58) | @Test public void lazyNullCreation() {
    method providerOfLazyOfSomething (line 79) | @Test public void providerOfLazyOfSomething() {
    method sideBySideLazyVsProvider (line 104) | @Test public void sideBySideLazyVsProvider() {
    method injectWithModule (line 130) | private <T> T injectWithModule(T ep, Object ... modules) {

FILE: core/src/test/java/dagger/InjectionTest.java
  class InjectionTest (line 40) | @RunWith(JUnit4.class)
    method basicInjection (line 42) | @Test public void basicInjection() {
    class A (line 68) | static class A {
      method A (line 69) | @Inject A() {}
    class B (line 72) | static class B {
      method B (line 73) | @Inject B() {}
    class C (line 76) | @Singleton
      method C (line 78) | @Inject C() {}
    class D (line 81) | @Singleton
      method D (line 83) | @Inject D() {}
    class E (line 86) | static class E {
      method E (line 88) | E(F f) {
    class F (line 93) | static class F {}
    class G (line 95) | static class G {
      method G (line 101) | @Inject G(C c, D d) {
    method providerInjection (line 107) | @Test public void providerInjection() {
    method singletons (line 125) | @Test public void singletons() {
    class I (line 144) | @Singleton
      method I (line 146) | @Inject I() {}
    method bindingAnnotations (line 149) | @Test public void bindingAnnotations() {
    method singletonBindingAnnotationAndProvider (line 176) | @Test public void singletonBindingAnnotationAndProvider() {
    class L (line 204) | @Singleton
    method singletonInGraph (line 210) | @Test public void singletonInGraph() {
    class N (line 237) | public static class N {
    method noJitBindingsForAnnotations (line 243) | @Test public void noJitBindingsForAnnotations() {
    method injectableSupertypes (line 260) | @Test public void injectableSupertypes() {
    method uninjectableSupertypes (line 277) | @Test public void uninjectableSupertypes() {
    class P (line 291) | public static class P {
    class Q (line 295) | public static class Q extends P {
      method Q (line 296) | @Inject Q() {}
    class S (line 299) | static class S {
    class T (line 302) | public static class T extends S {
      method T (line 303) | @Inject T() {}
    method singletonsAreNotEager (line 306) | @Test public void singletonsAreNotEager() {
    class R (line 334) | @Singleton
      method R (line 337) | @Inject R() {
    method providesSet (line 342) | @Test public void providesSet() {
    method providesSetValues (line 363) | @Test public void providesSetValues() {
    method providerMethodsConflict (line 386) | @Test public void providerMethodsConflict() {
    method providesSetConflictsWithProvidesTypeSet (line 404) | @Test public void providesSetConflictsWithProvidesTypeSet() {
    method providesSetConflictsWithProvidesTypeSetValues (line 422) | @Test public void providesSetConflictsWithProvidesTypeSetValues() {
    method providesSetOfProvidersIsDifferentThanProvidesTypeSetValues (line 440) | @Test public void providesSetOfProvidersIsDifferentThanProvidesTypeSet...
    method singletonsInjectedOnlyIntoProviders (line 469) | @Test public void singletonsInjectedOnlyIntoProviders() {
    method moduleOverrides (line 486) | @Test public void moduleOverrides() {
    method noJitBindingsForInterfaces (line 515) | @Test public void noJitBindingsForInterfaces() {
    method objectGraphGetInterface (line 532) | @Test public void objectGraphGetInterface() {
    method noProvideBindingsForAbstractClasses (line 550) | @Test public void noProvideBindingsForAbstractClasses() {
    class ExtendsParameterizedType (line 567) | static class ExtendsParameterizedType extends AbstractList<Integer> {
      method get (line 569) | @Override public Integer get(int i) {
      method size (line 572) | @Override public int size() {
    method extendsParameterizedType (line 581) | @Test public void extendsParameterizedType() {
    method injectParameterizedType (line 598) | @Test public void injectParameterizedType() {
    method injectWildcardType (line 615) | @Test public void injectWildcardType() {
    class Parameterized (line 634) | static class Parameterized<T> {
    method noConstructorInjectionsForClassesWithTypeParameters (line 638) | @Test public void noConstructorInjectionsForClassesWithTypeParameters() {
    method moduleWithNoProvidesMethods (line 659) | @Test public void moduleWithNoProvidesMethods() {
    method getInstance (line 667) | @Test public void getInstance() {
    method getInstanceRequiresEntryPoint (line 682) | @Test public void getInstanceRequiresEntryPoint() {
    method getInstanceOfPrimitive (line 698) | @Test public void getInstanceOfPrimitive() {
    method getInstanceOfArray (line 710) | @Test public void getInstanceOfArray() {
    method getInstanceAndInjectMembersUseDifferentKeys (line 722) | @Test public void getInstanceAndInjectMembersUseDifferentKeys() {
    class NoInjections (line 750) | static class NoInjections {
      method NoInjections (line 751) | NoInjections(Void noDefaultConstructorEither) {
    method entryPointNeedsNoInjectAnnotation (line 755) | @Test public void entryPointNeedsNoInjectAnnotation() {
    class InjectMembersOnly (line 763) | static class InjectMembersOnly {
      method InjectMembersOnly (line 764) | InjectMembersOnly(Void noInjectableConstructor) {
    method cannotGetOnMembersOnlyInjectionPoint (line 769) | @Test public void cannotGetOnMembersOnlyInjectionPoint() {
    method nonEntryPointNeedsInjectAnnotation (line 789) | @Test public void nonEntryPointNeedsInjectAnnotation() {
    class TwoAtInjectConstructors (line 805) | static class TwoAtInjectConstructors {
      method TwoAtInjectConstructors (line 806) | @Inject TwoAtInjectConstructors() {
      method TwoAtInjectConstructors (line 808) | @Inject TwoAtInjectConstructors(String s) {
    method twoAtInjectConstructorsIsRejected (line 812) | @Test public void twoAtInjectConstructorsIsRejected() {
    method runtimeProvidesMethodsExceptionsAreNotWrapped (line 828) | @Test public void runtimeProvidesMethodsExceptionsAreNotWrapped() {
    class ThrowsOnConstruction (line 848) | static class ThrowsOnConstruction {
      method ThrowsOnConstruction (line 849) | @Inject ThrowsOnConstruction() {
    method runtimeConstructorExceptionsAreNotWrapped (line 854) | @Test public void runtimeConstructorExceptionsAreNotWrapped() {
    class SingletonLinkedFromExtension (line 867) | static class SingletonLinkedFromExtension {
    class RootModule (line 871) | @Module(complete = false, injects = C.class)
    class ExtensionModule (line 874) | @Module(addsTo = RootModule.class, injects = SingletonLinkedFromExtens...
    method testSingletonLinkingThroughExtensionGraph (line 877) | @Test public void testSingletonLinkingThroughExtensionGraph() {
    method privateFieldsFail (line 884) | @Test public void privateFieldsFail() {
    method privateConstructorsFail (line 904) | @Test public void privateConstructorsFail() {
    method atInjectAlwaysRequiredForConstruction (line 923) | @Test public void atInjectAlwaysRequiredForConstruction() {

FILE: core/src/test/java/dagger/LazyInjectionTest.java
  class LazyInjectionTest (line 26) | @RunWith(JUnit4.class)
    method getLazyDoesNotCauseInjectedTypesToBeLoaded (line 28) | @Test public void getLazyDoesNotCauseInjectedTypesToBeLoaded() {
    class LazyEntryPoint (line 38) | static class LazyEntryPoint {
    method getLazyDoesNotCauseProvidesParametersToBeLoaded (line 44) | @Test public void getLazyDoesNotCauseProvidesParametersToBeLoaded() {
    class LazyProvidesParameter (line 57) | static class LazyProvidesParameter {
    method getLazyDoesNotCauseProvidesResultToBeLoaded (line 63) | @Test public void getLazyDoesNotCauseProvidesResultToBeLoaded() {
    class LazyProvidesResult (line 76) | static class LazyProvidesResult {
    method getLazyDoesNotCauseStaticsToBeLoaded (line 82) | @Test public void getLazyDoesNotCauseStaticsToBeLoaded() {
    class LazyInjectStatics (line 92) | static class LazyInjectStatics {
    method lazyInjectionRequiresProvidesMethod (line 98) | @Test public void lazyInjectionRequiresProvidesMethod() {

FILE: core/src/test/java/dagger/MembersInjectorTest.java
  class MembersInjectorTest (line 33) | @RunWith(JUnit4.class)
    method injectMembers (line 35) | @Test public void injectMembers() {
    class Injectable (line 54) | static class Injectable {
    class Unconstructable (line 58) | static class Unconstructable {
      method Unconstructable (line 61) | Unconstructable(String constructor) {
    method membersInjectorOfUnconstructableIsOkay (line 66) | @Test public void membersInjectorOfUnconstructableIsOkay() {
    method injectionOfUnconstructableFails (line 87) | @Test public void injectionOfUnconstructableFails() {
    method instanceInjectionOfMembersOnlyType (line 104) | @Test public void instanceInjectionOfMembersOnlyType() {
    method rejectUnconstructableSingleton (line 121) | @Test public void rejectUnconstructableSingleton() {
    class UnconstructableSingleton (line 138) | @Singleton
      method UnconstructableSingleton (line 142) | UnconstructableSingleton(String constructor) {
    class NonStaticInner (line 147) | class NonStaticInner {
    method membersInjectorOfNonStaticInnerIsOkay (line 151) | @Test public void membersInjectorOfNonStaticInnerIsOkay() {
    method instanceInjectionOfNonStaticInnerFailsEarly (line 170) | @Test public void instanceInjectionOfNonStaticInnerFailsEarly() {
    method providesMethodsAndMembersInjectionDoNotConflict (line 187) | @Test public void providesMethodsAndMembersInjectionDoNotConflict() {

FILE: core/src/test/java/dagger/ModuleTest.java
  class ModuleTest (line 30) | @RunWith(JUnit4.class)
    class TestEntryPoint (line 32) | static class TestEntryPoint {
    class ModuleWithEntryPoint (line 36) | @Module(injects = TestEntryPoint.class)
    method childModuleWithEntryPoint (line 40) | @Test public void childModuleWithEntryPoint() {
    class TestStaticInjection (line 53) | static class TestStaticInjection {
    class ModuleWithStaticInjection (line 57) | @Module(staticInjections = TestStaticInjection.class)
    method childModuleWithStaticInjection (line 61) | @Test public void childModuleWithStaticInjection() {
    class ModuleWithBinding (line 75) | @Module
      method provideString (line 77) | @Provides String provideString() {
    method childModuleWithBinding (line 82) | @Test public void childModuleWithBinding() {
    class ModuleWithChildModule (line 97) | @Module(includes = ModuleWithBinding.class)
    method childModuleWithChildModule (line 101) | @Test public void childModuleWithChildModule() {
    class ModuleWithConstructor (line 116) | @Module
      method ModuleWithConstructor (line 120) | ModuleWithConstructor(String value) {
      method provideString (line 124) | @Provides String provideString() {
    method childModuleMissingManualConstruction (line 129) | @Test public void childModuleMissingManualConstruction() {
    method childModuleWithManualConstruction (line 141) | @Test public void childModuleWithManualConstruction() {
    class A (line 156) | static class A {}
    class B (line 158) | static class B { @Inject A a; }
    class TestModuleA (line 160) | @Module(injects = A.class) public static class TestModuleA {
      method a (line 161) | @Provides A a() { return new A(); }
    class TestModuleB (line 164) | @Module(includes = TestModuleA.class, injects = B.class) public static...
    method autoInstantiationOfModules (line 166) | @Test public void autoInstantiationOfModules() {
    method autoInstantiationOfIncludedModules (line 172) | @Test public void autoInstantiationOfIncludedModules() {
    class ModuleMissingModuleAnnotation (line 179) | static class ModuleMissingModuleAnnotation {}
    class ChildModuleMissingModuleAnnotation (line 181) | @Module(includes = ModuleMissingModuleAnnotation.class)
    method childModuleMissingModuleAnnotation (line 184) | @Test
    class ThreadModule (line 194) | @Module
    method moduleExtendingClassThrowsException (line 197) | @Test public void moduleExtendingClassThrowsException() {
    method provideProviderFails (line 206) | @Test public void provideProviderFails() {
    method provideRawProviderFails (line 222) | @Test public void provideRawProviderFails() {
    method provideLazyFails (line 238) | @Test public void provideLazyFails() {
    method provideRawLazyFails (line 254) | @Test public void provideRawLazyFails() {

FILE: core/src/test/java/dagger/ProblemDetectorTest.java
  class ProblemDetectorTest (line 26) | @RunWith(JUnit4.class)
    method atInjectCircularDependenciesDetected (line 28) | @Test public void atInjectCircularDependenciesDetected() {
    method providesCircularDependenciesDetected (line 45) | @Test public void providesCircularDependenciesDetected() {
    method validateLazy (line 64) | @Test public void validateLazy() {
    class Rock (line 79) | static class Rock {
    class Scissors (line 83) | static class Scissors {
    class Paper (line 87) | static class Paper {

FILE: core/src/test/java/dagger/SetBindingTest.java
  class SetBindingTest (line 43) | @RunWith(JUnit4.class)
    method multiValueBindings_SingleModule (line 45) | @Test public void multiValueBindings_SingleModule() {
    method multiValueBindings_MultiModule (line 60) | @Test public void multiValueBindings_MultiModule() {
    method multiValueBindings_MultiModule_NestedSet (line 84) | @Test public void multiValueBindings_MultiModule_NestedSet() {
    method multiValueBindings_WithSingletonAndDefaultValues (line 108) | @Test public void multiValueBindings_WithSingletonAndDefaultValues() {
    method multiValueBindings_WithSingletonsAcrossMultipleInjectableTypes (line 127) | @Test public void multiValueBindings_WithSingletonsAcrossMultipleInjec...
    method multiValueBindings_WithQualifiers (line 151) | @Test public void multiValueBindings_WithQualifiers() {
    method sampleMultiBindingLogger (line 175) | @Test public void sampleMultiBindingLogger() {
    method duplicateValuesContributed (line 212) | @Test public void duplicateValuesContributed() {
    method validateSetBinding (line 228) | @Test public void validateSetBinding() {
    method validateEmptySetBinding (line 243) | @Test public void validateEmptySetBinding() {
    method validateLibraryModules (line 259) | @Test public void validateLibraryModules() {
    method validateLibraryModules_nonLibraryContributors (line 278) | @Test public void validateLibraryModules_nonLibraryContributors() {
    class Logger (line 308) | static class Logger {
      method log (line 310) | public void log(String text, Throwable error) {
    class LogMessage (line 318) | static class LogMessage {
      method LogMessage (line 321) | public LogMessage (String message, Throwable error) {
    type LogSink (line 327) | static interface LogSink {
      method log (line 328) | void log(LogMessage message);
    method injectWithModule (line 331) | private <T> T injectWithModule(T ep, Object ... modules) {
    method set (line 335) | private <T> Set<T> set(T... ts) {

FILE: core/src/test/java/dagger/ThreadSafetyTest.java
  class ThreadSafetyTest (line 40) | @RunWith(JUnit4.class)
    class LazyEntryPoint (line 49) | static class LazyEntryPoint {
    class LatchingModule (line 53) | @Module(injects = { Long.class, LazyEntryPoint.class })
      method LatchingModule (line 57) | LatchingModule(CountDownLatch latch) {
      method provideLong (line 61) | @Provides @Singleton Long provideLong() {
      method provideInteger (line 65) | @Provides Integer provideInteger() {
    method concurrentSingletonAccess (line 75) | @Test public void concurrentSingletonAccess() throws Exception {
    method concurrentLazyAccess (line 95) | @Test public void concurrentLazyAccess() throws Exception {

FILE: core/src/test/java/dagger/UnusedProviderTest.java
  class UnusedProviderTest (line 27) | @RunWith(JUnit4.class)
    method unusedProvidesMethod_whenModuleLibrary_passes (line 30) | @Test public void unusedProvidesMethod_whenModuleLibrary_passes() thro...
    method unusedProviderMethod_whenNotLibraryModule_fails (line 45) | @Test public void unusedProviderMethod_whenNotLibraryModule_fails() th...
    method whenLibraryModulePlussedToNecessaryModule_shouldNotFailOnUnusedLibraryModule (line 65) | @Test public void whenLibraryModulePlussedToNecessaryModule_shouldNotF...
    method unusedSetBinding (line 86) | @Test public void unusedSetBinding() throws Exception {
    method unusedSetValuesBinding (line 102) | @Test public void unusedSetValuesBinding() throws Exception {

FILE: core/src/test/java/dagger/internal/FailoverLoaderTest.java
  class FailoverLoaderTest (line 33) | @RunWith(JUnit4.class)
    class TestModule (line 36) | @Module(injects = Entry$Point.class)
      method aString (line 38) | @Provides String aString() { return "a"; }
    class TestModule$$ModuleAdapter (line 42) | static final class TestModule$$ModuleAdapter extends TestingModuleAdap...
      method TestModule$$ModuleAdapter (line 43) | public TestModule$$ModuleAdapter() {
    class Entry$Point (line 48) | static class Entry$Point {
    method simpleInjectionWithUnGeneratedCode (line 52) | @Test public void simpleInjectionWithUnGeneratedCode() {

FILE: core/src/test/java/dagger/internal/KeysTest.java
  class KeysTest (line 34) | @RunWith(JUnit4.class)
    method lonePrimitiveGetsBoxed (line 37) | @Test public void lonePrimitiveGetsBoxed() throws NoSuchFieldException {
    method parameterizedTypes (line 43) | @Test public void parameterizedTypes() throws NoSuchFieldException {
    method parameterizedTypeOfPrimitiveArray (line 49) | @Test public void parameterizedTypeOfPrimitiveArray() throws NoSuchFie...
    method annotatedType (line 55) | @Test public void annotatedType() throws NoSuchFieldException {
    method testGetClassName (line 61) | @Test public void testGetClassName() throws NoSuchFieldException {
    method testGetClassNameWithoutAnnotation (line 67) | @Test public void testGetClassNameWithoutAnnotation() throws NoSuchFie...
    method testGetClassNameArray (line 73) | @Test public void testGetClassNameArray() throws NoSuchFieldException {
    method testGetClassParameterized (line 78) | @Test public void testGetClassParameterized() throws NoSuchFieldExcept...
    method testAnnotated (line 83) | @Test public void testAnnotated() throws NoSuchFieldException {
    method testIsAnnotatedFalse (line 89) | @Test public void testIsAnnotatedFalse() throws NoSuchFieldException {
    method testGetDelegateKey (line 95) | @Test public void testGetDelegateKey() throws NoSuchFieldException {
    method testGetDelegateKeyWithAnnotation (line 102) | @Test public void testGetDelegateKeyWithAnnotation() throws NoSuchFiel...
    method testGetDelegateKeyWithMembersInjector (line 109) | @Test public void testGetDelegateKeyWithMembersInjector() throws NoSuc...
    method testAnnotatedGetLazyKey (line 116) | @Test public void testAnnotatedGetLazyKey() throws NoSuchFieldException {
    method testGetLazyKey (line 123) | @Test public void testGetLazyKey() throws NoSuchFieldException {
    method testGetLazyKey_WrongKeyType (line 127) | @Test public void testGetLazyKey_WrongKeyType() throws NoSuchFieldExce...
    method elementProvides (line 131) | @Provides(type=SET) String elementProvides() { return "foo"; }
    method testGetElementKey_NoQualifier (line 133) | @Test public void testGetElementKey_NoQualifier() throws NoSuchMethodE...
    method qualifiedElementProvides (line 139) | @Named("foo")
    method testGetElementKey_WithQualifier (line 142) | @Test public void testGetElementKey_WithQualifier() throws NoSuchMetho...
    method fieldKey (line 148) | private String fieldKey(String fieldName) throws NoSuchFieldException {

FILE: core/src/test/java/dagger/internal/SingletonBindingTest.java
  class SingletonBindingTest (line 26) | @RunWith(JUnit4.class)
    method setUp (line 31) | @Before public void setUp() {
    method testSingletonBindingIsSingleton (line 36) | @Test public void testSingletonBindingIsSingleton() {
    method testSingletonBindingDelegatesSetLinked (line 41) | @Test public void testSingletonBindingDelegatesSetLinked() {
    method testSingletonBindingDelegatesIsLinked (line 46) | @Test public void testSingletonBindingDelegatesIsLinked() {
    method testSingletonBindingDelegatesSetVisiting (line 51) | @Test public void testSingletonBindingDelegatesSetVisiting() {
    method testSingletonBindingDelegatesIsVisiting (line 56) | @Test public void testSingletonBindingDelegatesIsVisiting() {
    method testSingletonBindingDelegatesSetCycleFree (line 61) | @Test public void testSingletonBindingDelegatesSetCycleFree() {
    method testSingletonBindingDelegatesIsCycleFree (line 66) | @Test public void testSingletonBindingDelegatesIsCycleFree() {
    class StringBinding (line 71) | private static class StringBinding extends Binding<String> {
      method StringBinding (line 72) | private StringBinding() {

FILE: core/src/test/java/dagger/internal/TestingLoader.java
  class TestingLoader (line 26) | public final class TestingLoader extends Loader {
    method getModuleAdapter (line 28) | @Override public <T> ModuleAdapter<T> getModuleAdapter(Class<T> type) {
    method getAtInjectBinding (line 33) | @Override public Binding<?> getAtInjectBinding(String key, String clas...
    method getStaticInjection (line 47) | @Override public StaticInjection getStaticInjection(Class<?> injectedC...

FILE: core/src/test/java/dagger/internal/TestingModuleAdapter.java
  class TestingModuleAdapter (line 32) | public class TestingModuleAdapter<M> extends ModuleAdapter<M> {
    method TestingModuleAdapter (line 33) | public TestingModuleAdapter(Class<M> moduleClass, Module annotation) {
    method injectableTypesToKeys (line 44) | private static String[] injectableTypesToKeys(Class<?>[] injectableTyp...
    method getBindings (line 55) | @Override public void getBindings(BindingsGroup bindings, M module) {
    method handleBindings (line 100) | private void handleBindings(BindingsGroup bindings, M module, Method m...
    method handleSetBindings (line 106) | private void handleSetBindings(BindingsGroup bindings, M module, Metho...
    method newModule (line 113) | @Override public M newModule() {
    method toString (line 131) | @Override public String toString() {
    method create (line 138) | public static <M> ModuleAdapter<M> create(Class<M> moduleClass) {
    class ReflectiveProvidesBinding (line 153) | private static final class ReflectiveProvidesBinding<T> extends Provid...
      method ReflectiveProvidesBinding (line 158) | public ReflectiveProvidesBinding(Method method, String key, String m...
      method attach (line 167) | @Override public void attach(Linker linker) {
      method get (line 177) | @Override public T get() {
      method getDependencies (line 194) | @Override public void getDependencies(Set<Binding<?>> get, Set<Bindi...
      method injectMembers (line 200) | @Override public void injectMembers(T t) {

FILE: examples/android-activity-graphs/src/main/java/com/example/dagger/activitygraphs/ActivityModule.java
  class ActivityModule (line 31) | @Module(
    method ActivityModule (line 42) | public ActivityModule(DemoBaseActivity activity) {
    method provideActivityContext (line 50) | @Provides @Singleton @ForActivity Context provideActivityContext() {
    method provideTitleController (line 54) | @Provides @Singleton ActivityTitleController provideTitleController() {

FILE: examples/android-activity-graphs/src/main/java/com/example/dagger/activitygraphs/AndroidModule.java
  class AndroidModule (line 30) | @Module(library = true)
    method AndroidModule (line 34) | public AndroidModule(DemoApplication application) {
    method provideApplicationContext (line 42) | @Provides @Singleton @ForApplication Context provideApplicationContext...
    method provideLocationManager (line 46) | @Provides @Singleton LocationManager provideLocationManager() {

FILE: examples/android-activity-graphs/src/main/java/com/example/dagger/activitygraphs/DemoApplication.java
  class DemoApplication (line 23) | public class DemoApplication extends Application {
    method onCreate (line 26) | @Override public void onCreate() {
    method getModules (line 36) | protected List<Object> getModules() {
    method getApplicationGraph (line 40) | ObjectGraph getApplicationGraph() {

FILE: examples/android-activity-graphs/src/main/java/com/example/dagger/activitygraphs/DemoBaseActivity.java
  class DemoBaseActivity (line 25) | public abstract class DemoBaseActivity extends FragmentActivity {
    method onCreate (line 28) | @Override protected void onCreate(Bundle savedInstanceState) {
    method onDestroy (line 39) | @Override protected void onDestroy() {
    method getModules (line 52) | protected List<Object> getModules() {
    method inject (line 57) | public void inject(Object object) {

FILE: examples/android-activity-graphs/src/main/java/com/example/dagger/activitygraphs/DemoBaseFragment.java
  class DemoBaseFragment (line 22) | public class DemoBaseFragment extends Fragment {
    method onActivityCreated (line 23) | @Override public void onActivityCreated(Bundle savedInstanceState) {

FILE: examples/android-activity-graphs/src/main/java/com/example/dagger/activitygraphs/ui/ActivityTitleController.java
  class ActivityTitleController (line 28) | public class ActivityTitleController {
    method ActivityTitleController (line 31) | public ActivityTitleController(Activity activity) {
    method setTitle (line 35) | public void setTitle(CharSequence title) {

FILE: examples/android-activity-graphs/src/main/java/com/example/dagger/activitygraphs/ui/HomeActivity.java
  class HomeActivity (line 23) | public class HomeActivity extends DemoBaseActivity {
    method onCreate (line 26) | @Override protected void onCreate(Bundle savedInstanceState) {

FILE: examples/android-activity-graphs/src/main/java/com/example/dagger/activitygraphs/ui/HomeFragment.java
  class HomeFragment (line 28) | public class HomeFragment extends DemoBaseFragment {
    method newInstance (line 29) | public static HomeFragment newInstance() {
    method onCreateView (line 35) | @Override public View onCreateView(LayoutInflater inflater, ViewGroup ...
    method onResume (line 43) | @Override public void onResume() {

FILE: examples/android-simple/src/main/java/com/example/dagger/simple/AndroidModule.java
  class AndroidModule (line 30) | @Module(library = true)
    method AndroidModule (line 34) | public AndroidModule(DemoApplication application) {
    method provideApplicationContext (line 42) | @Provides @Singleton @ForApplication Context provideApplicationContext...
    method provideLocationManager (line 46) | @Provides @Singleton LocationManager provideLocationManager() {

FILE: examples/android-simple/src/main/java/com/example/dagger/simple/DemoApplication.java
  class DemoApplication (line 23) | public class DemoApplication extends Application {
    method onCreate (line 26) | @Override public void onCreate() {
    method getModules (line 32) | protected List<Object> getModules() {
    method inject (line 39) | public void inject(Object object) {

FILE: examples/android-simple/src/main/java/com/example/dagger/simple/DemoBaseActivity.java
  class DemoBaseActivity (line 21) | public abstract class DemoBaseActivity extends Activity {
    method onCreate (line 22) | @Override protected void onCreate(Bundle savedInstanceState) {

FILE: examples/android-simple/src/main/java/com/example/dagger/simple/DemoModule.java
  class DemoModule (line 21) | @Module(

FILE: examples/android-simple/src/main/java/com/example/dagger/simple/ui/HomeActivity.java
  class HomeActivity (line 23) | public class HomeActivity extends DemoBaseActivity {
    method onCreate (line 26) | @Override protected void onCreate(Bundle savedInstanceState) {

FILE: examples/simple/src/main/java/coffee/CoffeeApp.java
  class CoffeeApp (line 7) | public class CoffeeApp implements Runnable {
    method run (line 10) | @Override public void run() {
    method main (line 14) | public static void main(String[] args) {

FILE: examples/simple/src/main/java/coffee/CoffeeMaker.java
  class CoffeeMaker (line 6) | class CoffeeMaker {
    method brew (line 10) | public void brew() {

FILE: examples/simple/src/main/java/coffee/DripCoffeeModule.java
  class DripCoffeeModule (line 7) | @Module(
    method provideHeater (line 12) | @Provides @Singleton Heater provideHeater() {

FILE: examples/simple/src/main/java/coffee/ElectricHeater.java
  class ElectricHeater (line 3) | class ElectricHeater implements Heater {
    method on (line 6) | @Override public void on() {
    method off (line 11) | @Override public void off() {
    method isHot (line 15) | @Override public boolean isHot() {

FILE: examples/simple/src/main/java/coffee/Heater.java
  type Heater (line 3) | interface Heater {
    method on (line 4) | void on();
    method off (line 5) | void off();
    method isHot (line 6) | boolean isHot();

FILE: examples/simple/src/main/java/coffee/Pump.java
  type Pump (line 3) | interface Pump {
    method pump (line 4) | void pump();

FILE: examples/simple/src/main/java/coffee/PumpModule.java
  class PumpModule (line 6) | @Module(complete = false, library = true)
    method providePump (line 8) | @Provides Pump providePump(Thermosiphon pump) {

FILE: examples/simple/src/main/java/coffee/Thermosiphon.java
  class Thermosiphon (line 5) | class Thermosiphon implements Pump {
    method Thermosiphon (line 8) | @Inject
    method pump (line 13) | @Override public void pump() {

FILE: examples/simple/src/test/java/coffee/CoffeeMakerTest.java
  class CoffeeMakerTest (line 29) | public class CoffeeMakerTest {
    method setUp (line 33) | @Before public void setUp() {
    class TestModule (line 37) | @Module(
      method provideHeater (line 43) | @Provides @Singleton Heater provideHeater() {
    method testHeaterIsTurnedOnAndThenOff (line 48) | @Test public void testHeaterIsTurnedOnAndThenOff() {

FILE: website/static/prettify.js
  function S (line 2) | function S(a){function d(e){var b=e.charCodeAt(0);if(b!==92)return b;var...
  function T (line 6) | function T(a,d){function g(a){var c=a.nodeType;if(c==1){if(!b.test(a.cla...
  function H (line 7) | function H(a,d,g,b){d&&(a={a:d,e:a},g(a),b.push.apply(b,a.g))}
  function U (line 7) | function U(a){for(var d=void 0,g=a.firstChild;g;g=g.nextSibling)var b=g....
  function C (line 7) | function C(a,d){function g(a){for(var j=a.e,k=[j,"pln"],c=0,i=a.a.match(...
  function v (line 9) | function v(a){var d=[],g=[];a.tripleQuotedStrings?d.push(["str",/^(?:'''...
  function J (line 13) | function J(a,d,g){function b(a){var c=a.nodeType;if(c==1&&!x.test(a.clas...
  function p (line 15) | function p(a,d){for(var g=d.length;--g>=0;){var b=d[g];F.hasOwnProperty(...
  function I (line 15) | function I(a,d){if(!a||!F.hasOwnProperty(a))a=/^\s*</.test(d)?"default-m...
  function K (line 15) | function K(a){var d=a.h;try{var g=T(a.c,a.i),b=g.a;
  function g (line 27) | function g(){for(var b=D.PR_SHOULD_USE_CONTINUATION?c.now()+250:Infinity...
Condensed preview — 202 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (657K chars).
[
  {
    "path": ".buildscript/deploy_snapshot.sh",
    "chars": 1070,
    "preview": "#!/bin/bash\n#\n# Deploy a jar, source jar, and javadoc jar to Sonatype's snapshot repo.\n#\n# Adapted from https://coderwal"
  },
  {
    "path": ".buildscript/settings.xml",
    "chars": 221,
    "preview": "<settings>\n  <servers>\n    <server>\n      <id>sonatype-nexus-snapshots</id>\n      <username>${env.CI_DEPLOY_USERNAME}</u"
  },
  {
    "path": ".gitignore",
    "chars": 151,
    "preview": ".classpath\n.factorypath\n.project\n.settings\neclipsebin\n\nbin\ngen\nbuild\nout\nlib\n\ntarget\npom.xml.*\nrelease.properties\n\n.idea"
  },
  {
    "path": ".travis.yml",
    "chars": 884,
    "preview": "language: android\n\nandroid:\n  components:\n    - build-tools-20.0.0\n    - android-16\n  licenses:\n    - android-sdk-licens"
  },
  {
    "path": "CHANGELOG.md",
    "chars": 2610,
    "preview": "Change Log\n==========\n\nVersion 1.2.5 *(2016-05-09)*\n----------------------------\n\n * Fix: Correctly emit generated code "
  },
  {
    "path": "CONTRIBUTING.md",
    "chars": 1898,
    "preview": "Contributing\n============\n\nIf you would like to contribute code to Dagger you can do so through GitHub by\nforking the re"
  },
  {
    "path": "LICENSE.txt",
    "chars": 11358,
    "preview": "\n                                 Apache License\n                           Version 2.0, January 2004\n                  "
  },
  {
    "path": "README.md",
    "chars": 2539,
    "preview": "Dagger 1\n========\n\nA fast dependency injector for Android and Java.\n\n\nDeprecated – Please upgrade to Dagger 2\n----------"
  },
  {
    "path": "checkstyle.xml",
    "chars": 5180,
    "preview": "<?xml version=\"1.0\"?>\n<!DOCTYPE module PUBLIC\n    \"-//Puppy Crawl//DTD Check Configuration 1.2//EN\"\n    \"http://www.pupp"
  },
  {
    "path": "compiler/pom.xml",
    "chars": 5186,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n Copyright (C) 2012 Square, Inc.\n Copyright (C) 2012 Google, Inc.\n\n  License"
  },
  {
    "path": "compiler/src/it/default-package-injected-type/pom.xml",
    "chars": 1771,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n Copyright (C) 2012 Square, Inc.\n Copyright (C) 2012 Google, Inc.\n\n  License"
  },
  {
    "path": "compiler/src/it/default-package-injected-type/src/main/java/TestApp.java",
    "chars": 1114,
    "preview": "/*\n * Copyright (C) 2012 Google, Inc.\n * Copyright (C) 2012 Square, Inc.\n *\n * Licensed under the Apache License, Versio"
  },
  {
    "path": "compiler/src/it/extension-graph/pom.xml",
    "chars": 1757,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n Copyright (C) 2012 Square, Inc.\n Copyright (C) 2012 Google, Inc.\n\n  License"
  },
  {
    "path": "compiler/src/it/extension-graph/src/main/java/test/TestApp.java",
    "chars": 1474,
    "preview": "/*\n * Copyright (C) 2012 Google, Inc.\n * Copyright (C) 2012 Square, Inc.\n *\n * Licensed under the Apache License, Versio"
  },
  {
    "path": "compiler/src/it/extension-graph-setvalues/pom.xml",
    "chars": 1767,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n Copyright (C) 2013 Square, Inc.\n Copyright (C) 2013 Google, Inc.\n\n  License"
  },
  {
    "path": "compiler/src/it/extension-graph-setvalues/src/main/java/test/TestApp.java",
    "chars": 1876,
    "preview": "/*\n * Copyright (C) 2013 Google, Inc.\n * Copyright (C) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Versio"
  },
  {
    "path": "compiler/src/it/final-field-inject/invoker.properties",
    "chars": 28,
    "preview": "invoker.buildResult=failure\n"
  },
  {
    "path": "compiler/src/it/final-field-inject/pom.xml",
    "chars": 1717,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  Copyright (C) 2013 Google, Inc.\n  Copyright (C) 2013 Square, Inc.\n\n  Licen"
  },
  {
    "path": "compiler/src/it/final-field-inject/src/main/java/test/TestApp.java",
    "chars": 722,
    "preview": "/*\n * Copyright (C) 2013 Google, Inc.\n * Copyright (C) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Versio"
  },
  {
    "path": "compiler/src/it/final-field-inject/verify.bsh",
    "chars": 231,
    "preview": "import dagger.testing.it.BuildLogValidator;\nimport java.io.File;\n\nFile buildLog = new File(basedir, \"build.log\");\nnew Bu"
  },
  {
    "path": "compiler/src/it/include-non-module/invoker.properties",
    "chars": 27,
    "preview": "invoker.buildResult=failure"
  },
  {
    "path": "compiler/src/it/include-non-module/pom.xml",
    "chars": 1760,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n Copyright (C) 2013 Square, Inc.\n Copyright (C) 2013 Google, Inc.\n\n  License"
  },
  {
    "path": "compiler/src/it/include-non-module/src/main/java/test/TestApp.java",
    "chars": 1069,
    "preview": "/*\n * Copyright (C) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
  },
  {
    "path": "compiler/src/it/inject-on-class/invoker.properties",
    "chars": 27,
    "preview": "invoker.buildResult=failure"
  },
  {
    "path": "compiler/src/it/inject-on-class/pom.xml",
    "chars": 1681,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  Copyright (C) 2013 Square, Inc.\n\n  Licensed under the Apache License, Vers"
  },
  {
    "path": "compiler/src/it/inject-on-class/src/main/java/test/TestApp.java",
    "chars": 666,
    "preview": "/*\n * Copyright (C) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
  },
  {
    "path": "compiler/src/it/inject-on-class/verify.bsh",
    "chars": 231,
    "preview": "import dagger.testing.it.BuildLogValidator;\nimport java.io.File;\n\nFile buildLog = new File(basedir, \"build.log\");\nnew Bu"
  },
  {
    "path": "compiler/src/it/inject-parameterized-type/pom.xml",
    "chars": 1767,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n Copyright (C) 2013 Square, Inc.\n Copyright (C) 2013 Google, Inc.\n\n  License"
  },
  {
    "path": "compiler/src/it/inject-parameterized-type/src/main/java/test/TestApp.java",
    "chars": 1102,
    "preview": "/*\n * Copyright (C) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
  },
  {
    "path": "compiler/src/it/inner-classes-complaint-injection/invoker.properties",
    "chars": 27,
    "preview": "invoker.buildResult=failure"
  },
  {
    "path": "compiler/src/it/inner-classes-complaint-injection/pom.xml",
    "chars": 1743,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  Copyright (C) 2013 Square, Inc.\n\n  Licensed under the Apache License, Vers"
  },
  {
    "path": "compiler/src/it/inner-classes-complaint-injection/src/main/java/test/TestApp.java",
    "chars": 807,
    "preview": "/*\n * Copyright (C) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
  },
  {
    "path": "compiler/src/it/inner-classes-complaint-injection/verify.bsh",
    "chars": 241,
    "preview": "import dagger.testing.it.BuildLogValidator;\nimport java.io.File;\n\nFile buildLog = new File(basedir, \"build.log\");\nnew Bu"
  },
  {
    "path": "compiler/src/it/method-injection/invoker.properties",
    "chars": 27,
    "preview": "invoker.buildResult=failure"
  },
  {
    "path": "compiler/src/it/method-injection/pom.xml",
    "chars": 1681,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  Copyright (C) 2013 Square, Inc.\n\n  Licensed under the Apache License, Vers"
  },
  {
    "path": "compiler/src/it/method-injection/src/main/java/test/TestApp.java",
    "chars": 710,
    "preview": "/*\n * Copyright (C) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
  },
  {
    "path": "compiler/src/it/method-injection/verify.bsh",
    "chars": 242,
    "preview": "import dagger.testing.it.BuildLogValidator;\nimport java.io.File;\n\nFile buildLog = new File(basedir, \"build.log\");\nnew Bu"
  },
  {
    "path": "compiler/src/it/missing-at-inject-constructor/invoker.properties",
    "chars": 27,
    "preview": "invoker.buildResult=failure"
  },
  {
    "path": "compiler/src/it/missing-at-inject-constructor/pom.xml",
    "chars": 1771,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n Copyright (C) 2012 Square, Inc.\n Copyright (C) 2012 Google, Inc.\n\n  License"
  },
  {
    "path": "compiler/src/it/missing-at-inject-constructor/src/main/java/test/TestApp.java",
    "chars": 1228,
    "preview": "/*\n * Copyright (C) 2012 Google, Inc.\n * Copyright (C) 2012 Square, Inc.\n *\n * Licensed under the Apache License, Versio"
  },
  {
    "path": "compiler/src/it/missing-at-inject-constructor/verify.bsh",
    "chars": 293,
    "preview": "import dagger.testing.it.BuildLogValidator;\nimport java.io.File;\n\nFile buildLog = new File(basedir, \"build.log\");\nnew Bu"
  },
  {
    "path": "compiler/src/it/module-type-validation/invoker.properties",
    "chars": 27,
    "preview": "invoker.buildResult=failure"
  },
  {
    "path": "compiler/src/it/module-type-validation/pom.xml",
    "chars": 1687,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  Copyright (C) 2013 Square, Inc.\n\n  Licensed under the Apache License, Vers"
  },
  {
    "path": "compiler/src/it/module-type-validation/src/main/java/test/TestModule.java",
    "chars": 748,
    "preview": "/*\n * Copyright (C) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
  },
  {
    "path": "compiler/src/it/module-type-validation/verify.bsh",
    "chars": 475,
    "preview": "import dagger.testing.it.BuildLogValidator;\nimport java.io.File;\n\nFile buildLog = new File(basedir, \"build.log\");\nnew Bu"
  },
  {
    "path": "compiler/src/it/multiple-modules-setvalues/pom.xml",
    "chars": 1768,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n Copyright (C) 2013 Square, Inc.\n Copyright (C) 2013 Google, Inc.\n\n  License"
  },
  {
    "path": "compiler/src/it/multiple-modules-setvalues/src/main/java/test/TestApp.java",
    "chars": 1829,
    "preview": "/*\n * Copyright (C) 2013 Google, Inc.\n * Copyright (C) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Versio"
  },
  {
    "path": "compiler/src/it/multiple-provides-methods/pom.xml",
    "chars": 1767,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n Copyright (C) 2013 Square, Inc.\n Copyright (C) 2013 Google, Inc.\n\n  License"
  },
  {
    "path": "compiler/src/it/multiple-provides-methods/src/main/java/test/TestApp.java",
    "chars": 1089,
    "preview": "/*\n * Copyright (C) 2013 Square, Inc.\n * Copyright (C) 2013 Google, Inc.\n *\n * Licensed under the Apache License, Versio"
  },
  {
    "path": "compiler/src/it/multiple-provides-methods/verify.bsh",
    "chars": 639,
    "preview": "import java.io.File;\n\nFile classes = new File(basedir, \"target/classes/test/\");\n\nFile moduleAdapter = new File(classes, "
  },
  {
    "path": "compiler/src/it/multiple-qualifiers/invoker.properties",
    "chars": 28,
    "preview": "invoker.buildResult=failure\n"
  },
  {
    "path": "compiler/src/it/multiple-qualifiers/pom.xml",
    "chars": 1718,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  Copyright (C) 2013 Google, Inc.\n  Copyright (C) 2013 Square, Inc.\n\n  Licen"
  },
  {
    "path": "compiler/src/it/multiple-qualifiers/src/main/java/test/TestApp.java",
    "chars": 1491,
    "preview": "/*\n * Copyright (C) 2013 Google, Inc.\n * Copyright (C) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Versio"
  },
  {
    "path": "compiler/src/it/multiple-qualifiers/verify.bsh",
    "chars": 580,
    "preview": "import dagger.testing.it.BuildLogValidator;\nimport java.io.File;\n\nFile buildLog = new File(basedir, \"build.log\");\nnew Bu"
  },
  {
    "path": "compiler/src/it/private-inject/invoker.properties",
    "chars": 27,
    "preview": "invoker.buildResult=failure"
  },
  {
    "path": "compiler/src/it/private-inject/pom.xml",
    "chars": 1679,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  Copyright (C) 2013 Square, Inc.\n\n  Licensed under the Apache License, Vers"
  },
  {
    "path": "compiler/src/it/private-inject/src/main/java/test/TestApp.java",
    "chars": 689,
    "preview": "/*\n * Copyright (C) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
  },
  {
    "path": "compiler/src/it/private-inject/src/main/java/test/TestFoo.java",
    "chars": 692,
    "preview": "/*\n * Copyright (C) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
  },
  {
    "path": "compiler/src/it/private-inject/verify.bsh",
    "chars": 363,
    "preview": "import dagger.testing.it.BuildLogValidator;\nimport java.io.File;\n\nFile buildLog = new File(basedir, \"build.log\");\nnew Bu"
  },
  {
    "path": "compiler/src/it/provide-provider-or-lazy/invoker.properties",
    "chars": 27,
    "preview": "invoker.buildResult=failure"
  },
  {
    "path": "compiler/src/it/provide-provider-or-lazy/pom.xml",
    "chars": 1689,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  Copyright (C) 2013 Square, Inc.\n\n  Licensed under the Apache License, Vers"
  },
  {
    "path": "compiler/src/it/provide-provider-or-lazy/src/main/java/test/TestModule.java",
    "chars": 994,
    "preview": "/*\n * Copyright (C) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
  },
  {
    "path": "compiler/src/it/provide-provider-or-lazy/verify.bsh",
    "chars": 764,
    "preview": "import dagger.testing.it.BuildLogValidator;\nimport java.io.File;\n\nFile buildLog = new File(basedir, \"build.log\");\nnew Bu"
  },
  {
    "path": "compiler/src/it/provides-method-not-in-module/invoker.properties",
    "chars": 28,
    "preview": "invoker.buildResult=failure\n"
  },
  {
    "path": "compiler/src/it/provides-method-not-in-module/pom.xml",
    "chars": 1728,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  Copyright (C) 2013 Google, Inc.\n  Copyright (C) 2013 Square, Inc.\n\n  Licen"
  },
  {
    "path": "compiler/src/it/provides-method-not-in-module/src/main/java/test/TestApp.java",
    "chars": 755,
    "preview": "/*\n * Copyright (C) 2013 Google, Inc.\n * Copyright (C) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Versio"
  },
  {
    "path": "compiler/src/it/provides-method-not-in-module/verify.bsh",
    "chars": 262,
    "preview": "import dagger.testing.it.BuildLogValidator;\nimport java.io.File;\n\nFile buildLog = new File(basedir, \"build.log\");\nnew Bu"
  },
  {
    "path": "compiler/src/it/provides-method-with-throws-clause/invoker.properties",
    "chars": 27,
    "preview": "invoker.buildResult=failure"
  },
  {
    "path": "compiler/src/it/provides-method-with-throws-clause/pom.xml",
    "chars": 1776,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n Copyright (C) 2013 Square, Inc.\n Copyright (C) 2013 Google, Inc.\n\n  License"
  },
  {
    "path": "compiler/src/it/provides-method-with-throws-clause/src/main/java/test/TestApp.java",
    "chars": 1186,
    "preview": "/*\n * Copyright (C) 2013 Google, Inc.\n * Copyright (C) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Versio"
  },
  {
    "path": "compiler/src/it/provides-method-with-throws-clause/verify.bsh",
    "chars": 233,
    "preview": "import dagger.testing.it.BuildLogValidator;\nimport java.io.File;\n\nFile buildLog = new File(basedir, \"build.log\");\nnew Bu"
  },
  {
    "path": "compiler/src/it/qualifiers-on-invalid-elements-errors/invoker.properties",
    "chars": 28,
    "preview": "invoker.buildResult=failure\n"
  },
  {
    "path": "compiler/src/it/qualifiers-on-invalid-elements-errors/pom.xml",
    "chars": 1780,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  Copyright (C) 2013 Google, Inc.\n  Copyright (C) 2013 Square, Inc.\n\n  Licen"
  },
  {
    "path": "compiler/src/it/qualifiers-on-invalid-elements-errors/src/main/java/test/TestApp.java",
    "chars": 1329,
    "preview": "/*\n * Copyright (C) 2013 Google, Inc.\n * Copyright (C) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Versio"
  },
  {
    "path": "compiler/src/it/qualifiers-on-invalid-elements-errors/verify.bsh",
    "chars": 688,
    "preview": "import dagger.testing.it.BuildLogValidator;\nimport java.io.File;\n\nFile buildLog = new File(basedir, \"build.log\");\nnew Bu"
  },
  {
    "path": "compiler/src/it/qualifiers-on-invalid-elements-warnings/pom.xml",
    "chars": 1782,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  Copyright (C) 2013 Google, Inc.\n  Copyright (C) 2013 Square, Inc.\n\n  Licen"
  },
  {
    "path": "compiler/src/it/qualifiers-on-invalid-elements-warnings/src/main/java/test/TestApp.java",
    "chars": 1547,
    "preview": "/*\n * Copyright (C) 2013 Google, Inc.\n * Copyright (C) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Versio"
  },
  {
    "path": "compiler/src/it/qualifiers-on-invalid-elements-warnings/verify.bsh",
    "chars": 1585,
    "preview": "import dagger.testing.it.BuildLogValidator;\nimport java.io.File;\n\nFile buildLog = new File(basedir, \"build.log\");\nnew Bu"
  },
  {
    "path": "compiler/src/it/same-provides-method-name/pom.xml",
    "chars": 1767,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n Copyright (C) 2012 Square, Inc.\n Copyright (C) 2012 Google, Inc.\n\n  License"
  },
  {
    "path": "compiler/src/it/same-provides-method-name/src/main/java/test/TestApp.java",
    "chars": 1274,
    "preview": "/*\n * Copyright (C) 2012 Google, Inc.\n * Copyright (C) 2012 Square, Inc.\n *\n * Licensed under the Apache License, Versio"
  },
  {
    "path": "compiler/src/it/static-injected-binding-doesnt-fail-providers/pom.xml",
    "chars": 1788,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  Copyright (C) 2013 Square, Inc.\n\n  Licensed under the Apache License, Vers"
  },
  {
    "path": "compiler/src/it/static-injected-binding-doesnt-fail-providers/src/main/java/test/Test.java",
    "chars": 1018,
    "preview": "/*\n * Copyright (C) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
  },
  {
    "path": "compiler/src/it/uninjectable-supertype/pom.xml",
    "chars": 1764,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n Copyright (C) 2012 Square, Inc.\n Copyright (C) 2012 Google, Inc.\n\n  License"
  },
  {
    "path": "compiler/src/it/uninjectable-supertype/src/main/java/test/TestApp.java",
    "chars": 976,
    "preview": "/*\n * Copyright (C) 2012 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
  },
  {
    "path": "compiler/src/it/valid-use-of-qualifiers/pom.xml",
    "chars": 1808,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n Copyright (C) 2013 Google, Inc.\n Copyright (C) 2013 Square, Inc.\n\n  License"
  },
  {
    "path": "compiler/src/it/valid-use-of-qualifiers/src/main/java/test/TestApp.java",
    "chars": 1572,
    "preview": "/*\n * Copyright (C) 2013 Google, Inc.\n * Copyright (C) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Versio"
  },
  {
    "path": "compiler/src/main/java/dagger/internal/codegen/AdapterJavadocs.java",
    "chars": 3097,
    "preview": "/*\n * Copyright (C) 2012 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
  },
  {
    "path": "compiler/src/main/java/dagger/internal/codegen/GeneratorKeys.java",
    "chars": 4222,
    "preview": "/*\n * Copyright (C) 2012 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
  },
  {
    "path": "compiler/src/main/java/dagger/internal/codegen/GraphAnalysisErrorHandler.java",
    "chars": 1566,
    "preview": "/*\n * Copyright (C) 2012 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
  },
  {
    "path": "compiler/src/main/java/dagger/internal/codegen/GraphAnalysisInjectBinding.java",
    "chars": 5480,
    "preview": "/*\n * Copyright (C) 2012 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
  },
  {
    "path": "compiler/src/main/java/dagger/internal/codegen/GraphAnalysisLoader.java",
    "chars": 5717,
    "preview": "/*\n * Copyright (C) 2012 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
  },
  {
    "path": "compiler/src/main/java/dagger/internal/codegen/GraphAnalysisProcessor.java",
    "chars": 15745,
    "preview": "/*\n * Copyright (C) 2012 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
  },
  {
    "path": "compiler/src/main/java/dagger/internal/codegen/GraphAnalysisStaticInjection.java",
    "chars": 1664,
    "preview": "/*\n * Copyright (C) 2012 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
  },
  {
    "path": "compiler/src/main/java/dagger/internal/codegen/GraphVisualizer.java",
    "chars": 5010,
    "preview": "/*\n * Copyright (C) 2012 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
  },
  {
    "path": "compiler/src/main/java/dagger/internal/codegen/GraphVizWriter.java",
    "chars": 4240,
    "preview": "/**\n * Copyright (C) 2012 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may "
  },
  {
    "path": "compiler/src/main/java/dagger/internal/codegen/InjectAdapterProcessor.java",
    "chars": 19974,
    "preview": "/*\n * Copyright (C) 2012 Square, Inc.\n * Copyright (C) 2013 Google, Inc.\n *\n * Licensed under the Apache License, Versio"
  },
  {
    "path": "compiler/src/main/java/dagger/internal/codegen/ModuleAdapterProcessor.java",
    "chars": 21707,
    "preview": "/*\n * Copyright (C) 2012 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
  },
  {
    "path": "compiler/src/main/java/dagger/internal/codegen/Util.java",
    "chars": 15848,
    "preview": "/*\n * Copyright (C) 2013 Google, Inc.\n * Copyright (C) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Versio"
  },
  {
    "path": "compiler/src/main/java/dagger/internal/codegen/ValidationProcessor.java",
    "chars": 8759,
    "preview": "/*\n * Copyright (C) 2013 Google, Inc.\n * Copyright (C) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Versio"
  },
  {
    "path": "compiler/src/main/resources/META-INF/services/javax.annotation.processing.Processor",
    "chars": 185,
    "preview": "dagger.internal.codegen.ValidationProcessor\ndagger.internal.codegen.InjectAdapterProcessor\ndagger.internal.codegen.Modul"
  },
  {
    "path": "compiler/src/test/java/dagger/internal/codegen/DotWriterTest.java",
    "chars": 3166,
    "preview": "/**\n * Copyright (C) 2012 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may "
  },
  {
    "path": "compiler/src/test/java/dagger/internal/codegen/GraphAnalysisLoaderTest.java",
    "chars": 3617,
    "preview": "/*\n * Copyright (C) 2015 Square Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may no"
  },
  {
    "path": "compiler/src/test/java/dagger/internal/codegen/GraphVisualizerTest.java",
    "chars": 3064,
    "preview": "/**\n * Copyright (C) 2012 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may "
  },
  {
    "path": "compiler/src/test/java/dagger/testing/it/BuildLogValidator.java",
    "chars": 3477,
    "preview": "/*\n * Copyright (C) 2012 Google, Inc.\n * Copyright (C) 2012 Square, Inc.\n *\n * Licensed under the Apache License, Versio"
  },
  {
    "path": "compiler/src/test/java/dagger/tests/integration/ProcessorTestUtils.java",
    "chars": 1274,
    "preview": "/*\n * Copyright (c) 2013 Google, Inc.\n * Copyright (c) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Versio"
  },
  {
    "path": "compiler/src/test/java/dagger/tests/integration/codegen/GenericInjectAdapterGenerationTest.java",
    "chars": 3994,
    "preview": "/*\n * Copyright (C) 2013 Google Inc.\n * Copyright (C) 2016 Square Inc.\n *\n * Licensed under the Apache License, Version "
  },
  {
    "path": "compiler/src/test/java/dagger/tests/integration/codegen/InjectAdapterGenerationTest.java",
    "chars": 5403,
    "preview": "/*\n * Copyright (C) 2013 Google Inc.\n * Copyright (C) 2013 Square Inc.\n *\n * Licensed under the Apache License, Version "
  },
  {
    "path": "compiler/src/test/java/dagger/tests/integration/codegen/ModuleAdapterGenerationTest.java",
    "chars": 14754,
    "preview": "/*\n * Copyright (C) 2013 Google Inc.\n * Copyright (C) 2013 Square Inc.\n *\n * Licensed under the Apache License, Version "
  },
  {
    "path": "compiler/src/test/java/dagger/tests/integration/operation/FailureModeErrorsTest.java",
    "chars": 2684,
    "preview": "/**\n * Copyright (C) 2014 Google, Inc.\n * Copyright (C) 2014 Square, Inc.\n *\n * Licensed under the Apache License, Versi"
  },
  {
    "path": "compiler/src/test/java/dagger/tests/integration/operation/PrimitiveInjectionTest.java",
    "chars": 2667,
    "preview": "/**\n * Copyright (C) 2013 Google, Inc.\n * Copyright (C) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Versi"
  },
  {
    "path": "compiler/src/test/java/dagger/tests/integration/operation/SimpleInjectionTest.java",
    "chars": 2525,
    "preview": "/**\n * Copyright (C) 2013 Google, Inc.\n * Copyright (C) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Versi"
  },
  {
    "path": "compiler/src/test/java/dagger/tests/integration/validation/CyclicDependencyTest.java",
    "chars": 2954,
    "preview": "/**\n * Copyright (c) 2013 Google, Inc.\n * Copyright (c) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Versi"
  },
  {
    "path": "compiler/src/test/java/dagger/tests/integration/validation/CyclicModuleIncludesTest.java",
    "chars": 3866,
    "preview": "/**\n * Copyright (c) 2013 Google, Inc.\n * Copyright (c) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Versi"
  },
  {
    "path": "compiler/src/test/java/dagger/tests/integration/validation/GeneratedTypesNotReadyTest.java",
    "chars": 8404,
    "preview": "/**\n * Copyright (c) 2013 Google, Inc.\n * Copyright (c) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Versi"
  },
  {
    "path": "compiler/src/test/java/dagger/tests/integration/validation/LibraryModuleTest.java",
    "chars": 4200,
    "preview": "/**\n * Copyright (C) 2013 Google, Inc.\n * Copyright (C) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Versi"
  },
  {
    "path": "compiler/src/test/java/dagger/tests/integration/validation/ScopeAnnotationUseTest.java",
    "chars": 11585,
    "preview": "/**\n * Copyright (c) 2013 Google, Inc.\n * Copyright (c) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Versi"
  },
  {
    "path": "compiler/src/test/java/dagger/tests/integration/validation/SimpleMissingDependencyTest.java",
    "chars": 2059,
    "preview": "/**\n * Copyright (c) 2013 Google, Inc.\n * Copyright (c) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Versi"
  },
  {
    "path": "core/pom.xml",
    "chars": 2657,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n Copyright (C) 2012 Square, Inc.\n\n  Licensed under the Apache License, Versi"
  },
  {
    "path": "core/src/main/java/dagger/Lazy.java",
    "chars": 4732,
    "preview": "/*\n * Copyright (C) 2012 Google, Inc.\n * Copyright (C) 2012 Square, Inc.\n *\n * Licensed under the Apache License, Versio"
  },
  {
    "path": "core/src/main/java/dagger/MembersInjector.java",
    "chars": 1468,
    "preview": "/*\n * Copyright (C) 2012 Square, Inc.\n * Copyright (C) 2009 Google Inc.\n *\n * Licensed under the Apache License, Version"
  },
  {
    "path": "core/src/main/java/dagger/Module.java",
    "chars": 4029,
    "preview": "/*\n * Copyright (C) 2012 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
  },
  {
    "path": "core/src/main/java/dagger/ObjectGraph.java",
    "chars": 13985,
    "preview": "/*\n * Copyright (C) 2012 Square, Inc.\n * Copyright (C) 2012 Google, Inc.\n *\n * Licensed under the Apache License, Versio"
  },
  {
    "path": "core/src/main/java/dagger/Provides.java",
    "chars": 2104,
    "preview": "/*\n * Copyright (C) 2007 Google Inc.\n * Copyright (C) 2012 Square, Inc.\n *\n * Licensed under the Apache License, Version"
  },
  {
    "path": "core/src/main/java/dagger/internal/ArrayQueue.java",
    "chars": 21456,
    "preview": "/*\n * Written by Josh Bloch of Google Inc. and released to the public domain,\n * as explained at http://creativecommons."
  },
  {
    "path": "core/src/main/java/dagger/internal/Binding.java",
    "chars": 5321,
    "preview": "/*\n * Copyright (C) 2012 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
  },
  {
    "path": "core/src/main/java/dagger/internal/BindingsGroup.java",
    "chars": 1877,
    "preview": "/*\n * Copyright (C) 2013 Square, Inc.\n * Copyright (C) 2013 Google, Inc.\n *\n * Licensed under the Apache License, Versio"
  },
  {
    "path": "core/src/main/java/dagger/internal/BuiltInBinding.java",
    "chars": 1644,
    "preview": "/*\n * Copyright (C) 2012 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
  },
  {
    "path": "core/src/main/java/dagger/internal/FailoverLoader.java",
    "chars": 3538,
    "preview": "/*\n * Copyright (C) 2013 Square, Inc.\n * Copyright (C) 2013 Google, Inc.\n *\n * Licensed under the Apache License, Versio"
  },
  {
    "path": "core/src/main/java/dagger/internal/Keys.java",
    "chars": 10204,
    "preview": "/*\n * Copyright (C) 2012 Square, Inc.\n * Copyright (C) 2012 Google, Inc.\n *\n * Licensed under the Apache License, Versio"
  },
  {
    "path": "core/src/main/java/dagger/internal/LazyBinding.java",
    "chars": 2083,
    "preview": "/*\n * Copyright (C) 2012 Google, Inc.\n * Copyright (C) 2012 Square, Inc.\n *\n * Licensed under the Apache License, Versio"
  },
  {
    "path": "core/src/main/java/dagger/internal/Linker.java",
    "chars": 16855,
    "preview": "/*\n * Copyright (C) 2012 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
  },
  {
    "path": "core/src/main/java/dagger/internal/Loader.java",
    "chars": 3571,
    "preview": "/*\n * Copyright (C) 2012 Square, Inc.\n * Copyright (C) 2013 Google, Inc.\n *\n * Licensed under the Apache License, Versio"
  },
  {
    "path": "core/src/main/java/dagger/internal/Memoizer.java",
    "chars": 2347,
    "preview": "/*\n * Copyright (C) 2011 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
  },
  {
    "path": "core/src/main/java/dagger/internal/ModuleAdapter.java",
    "chars": 2429,
    "preview": "/*\n * Copyright (C) 2012 Square, Inc.\n * Copyright (C) 2012 Google, Inc.\n *\n * Licensed under the Apache License, Versio"
  },
  {
    "path": "core/src/main/java/dagger/internal/Modules.java",
    "chars": 3040,
    "preview": "/*\n * Copyright (C) 2012 Square, Inc.\n * Copyright (C) 2012 Google, Inc.\n *\n * Licensed under the Apache License, Versio"
  },
  {
    "path": "core/src/main/java/dagger/internal/ProblemDetector.java",
    "chars": 3450,
    "preview": "/*\n * Copyright (C) 2012 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
  },
  {
    "path": "core/src/main/java/dagger/internal/ProvidesBinding.java",
    "chars": 1734,
    "preview": "/*\n * Copyright (C) 2013 Google, Inc.\n * Copyright (C) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Versio"
  },
  {
    "path": "core/src/main/java/dagger/internal/SetBinding.java",
    "chars": 5096,
    "preview": "/*\n * Copyright (C) 2012 Google, Inc.\n * Copyright (C) 2012 Square, Inc.\n *\n * Licensed under the Apache License, Versio"
  },
  {
    "path": "core/src/main/java/dagger/internal/StaticInjection.java",
    "chars": 829,
    "preview": "/*\n * Copyright (C) 2012 Square Inc.\n * Copyright (C) 2012 Google Inc.\n *\n * Licensed under the Apache License, Version "
  },
  {
    "path": "core/src/main/java/dagger/internal/ThrowingErrorHandler.java",
    "chars": 1165,
    "preview": "/*\n * Copyright (C) 2012 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
  },
  {
    "path": "core/src/main/java/dagger/internal/loaders/GeneratedAdapters.java",
    "chars": 1124,
    "preview": "/*\n * Copyright (C) 2013 Square, Inc.\n * Copyright (C) 2013 Google, Inc.\n *\n * Licensed under the Apache License, Versio"
  },
  {
    "path": "core/src/main/java/dagger/internal/loaders/ReflectiveAtInjectBinding.java",
    "chars": 8527,
    "preview": "/*\n * Copyright (C) 2012 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
  },
  {
    "path": "core/src/main/java/dagger/internal/loaders/ReflectiveStaticInjection.java",
    "chars": 2448,
    "preview": "/*\n * Copyright (C) 2012 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
  },
  {
    "path": "core/src/test/java/dagger/ExtensionTest.java",
    "chars": 4112,
    "preview": "/*\n * Copyright (C) 2012 Google Inc.\n * Copyright (C) 2012 Square Inc.\n *\n * Licensed under the Apache License, Version "
  },
  {
    "path": "core/src/test/java/dagger/ExtensionWithSetBindingsTest.java",
    "chars": 3651,
    "preview": "/*\n * Copyright (C) 2013 Google Inc.\n * Copyright (C) 2013 Square Inc.\n *\n * Licensed under the Apache License, Version "
  },
  {
    "path": "core/src/test/java/dagger/ExtensionWithStateTest.java",
    "chars": 1755,
    "preview": "/*\n * Copyright (C) 2013 Google Inc.\n * Copyright (C) 2013 Square Inc.\n *\n * Licensed under the Apache License, Version "
  },
  {
    "path": "core/src/test/java/dagger/InjectStaticsTest.java",
    "chars": 3066,
    "preview": "/*\n * Copyright (C) 2012 Square Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may no"
  },
  {
    "path": "core/src/test/java/dagger/InjectionOfLazyTest.java",
    "chars": 4418,
    "preview": "/*\n * Copyright (C) 2012 Google Inc.\n * Copyright (C) 2012 Square Inc.\n *\n * Licensed under the Apache License, Version "
  },
  {
    "path": "core/src/test/java/dagger/InjectionTest.java",
    "chars": 24375,
    "preview": "/*\n * Copyright (C) 2010 Google Inc.\n * Copyright (C) 2012 Square Inc.\n *\n * Licensed under the Apache License, Version "
  },
  {
    "path": "core/src/test/java/dagger/LazyInjectionTest.java",
    "chars": 3338,
    "preview": "/*\n * Copyright (C) 2012 Square Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may no"
  },
  {
    "path": "core/src/test/java/dagger/MembersInjectorTest.java",
    "chars": 6349,
    "preview": "/*\n * Copyright (C) 2012 Square Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may no"
  },
  {
    "path": "core/src/test/java/dagger/ModuleTest.java",
    "chars": 8009,
    "preview": "/*\n * Copyright (C) 2012 Square Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may no"
  },
  {
    "path": "core/src/test/java/dagger/ProblemDetectorTest.java",
    "chars": 2304,
    "preview": "/*\n * Copyright (C) 2012 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
  },
  {
    "path": "core/src/test/java/dagger/SetBindingTest.java",
    "chars": 10759,
    "preview": "/*\n * Copyright (C) 2012 Google Inc.\n * Copyright (C) 2012 Square Inc.\n *\n * Licensed under the Apache License, Version "
  },
  {
    "path": "core/src/test/java/dagger/ThreadSafetyTest.java",
    "chars": 3742,
    "preview": "/*\n * Copyright (C) 2013 Google Inc.\n * Copyright (C) 2013 Square Inc.\n *\n * Licensed under the Apache License, Version "
  },
  {
    "path": "core/src/test/java/dagger/UnusedProviderTest.java",
    "chars": 3225,
    "preview": "/*\n * Copyright (C) 2013 Square Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may no"
  },
  {
    "path": "core/src/test/java/dagger/internal/FailoverLoaderTest.java",
    "chars": 1862,
    "preview": "/*\n * Copyright (C) 2013 Google Inc.\n * Copyright (C) 2013 Square Inc.\n *\n * Licensed under the Apache License, Version "
  },
  {
    "path": "core/src/test/java/dagger/internal/KeysTest.java",
    "chars": 5914,
    "preview": "/**\n * Copyright (C) 2012 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may "
  },
  {
    "path": "core/src/test/java/dagger/internal/SingletonBindingTest.java",
    "chars": 2465,
    "preview": "/**\n * Copyright (C) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may "
  },
  {
    "path": "core/src/test/java/dagger/internal/TestingLoader.java",
    "chars": 1822,
    "preview": "/*\n * Copyright (C) 2013 Square, Inc.\n * Copyright (C) 2013 Google, Inc.\n *\n * Licensed under the Apache License, Versio"
  },
  {
    "path": "core/src/test/java/dagger/internal/TestingModuleAdapter.java",
    "chars": 7830,
    "preview": "/*\n * Copyright (C) 2012 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
  },
  {
    "path": "deploy_website.sh",
    "chars": 874,
    "preview": "#!/bin/bash\n#\n# Deploys the current Dagger website to the gh-pages branch of the GitHub\n# repository. To test the site l"
  },
  {
    "path": "examples/android-activity-graphs/README.md",
    "chars": 1050,
    "preview": "Example: Android Activity Graphs\n================================\n\nBuilding on top of the simple Android example, this e"
  },
  {
    "path": "examples/android-activity-graphs/pom.xml",
    "chars": 2074,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n Copyright (C) 2013 Square, Inc.\n\n  Licensed under the Apache License, Versi"
  },
  {
    "path": "examples/android-activity-graphs/src/main/AndroidManifest.xml",
    "chars": 764,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android"
  },
  {
    "path": "examples/android-activity-graphs/src/main/java/com/example/dagger/activitygraphs/ActivityModule.java",
    "chars": 1897,
    "preview": "/*\n * Copyright (C) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
  },
  {
    "path": "examples/android-activity-graphs/src/main/java/com/example/dagger/activitygraphs/AndroidModule.java",
    "chars": 1633,
    "preview": "/*\n * Copyright (C) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
  },
  {
    "path": "examples/android-activity-graphs/src/main/java/com/example/dagger/activitygraphs/DemoApplication.java",
    "chars": 1336,
    "preview": "/*\n * Copyright (C) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
  },
  {
    "path": "examples/android-activity-graphs/src/main/java/com/example/dagger/activitygraphs/DemoBaseActivity.java",
    "chars": 2185,
    "preview": "/*\n * Copyright (C) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
  },
  {
    "path": "examples/android-activity-graphs/src/main/java/com/example/dagger/activitygraphs/DemoBaseFragment.java",
    "chars": 1028,
    "preview": "/*\n * Copyright (C) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
  },
  {
    "path": "examples/android-activity-graphs/src/main/java/com/example/dagger/activitygraphs/ForActivity.java",
    "chars": 837,
    "preview": "/*\n * Copyright (C) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
  },
  {
    "path": "examples/android-activity-graphs/src/main/java/com/example/dagger/activitygraphs/ForApplication.java",
    "chars": 840,
    "preview": "/*\n * Copyright (C) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
  },
  {
    "path": "examples/android-activity-graphs/src/main/java/com/example/dagger/activitygraphs/ui/ActivityTitleController.java",
    "chars": 1410,
    "preview": "/*\n * Copyright (C) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
  },
  {
    "path": "examples/android-activity-graphs/src/main/java/com/example/dagger/activitygraphs/ui/HomeActivity.java",
    "chars": 1346,
    "preview": "/*\n * Copyright (C) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
  },
  {
    "path": "examples/android-activity-graphs/src/main/java/com/example/dagger/activitygraphs/ui/HomeFragment.java",
    "chars": 1613,
    "preview": "/*\n * Copyright (C) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
  },
  {
    "path": "examples/android-activity-graphs/src/main/res/values/strings.xml",
    "chars": 121,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n  <string name=\"app_name\">Dagger Activity Graph</string>\n</resources>"
  },
  {
    "path": "examples/android-simple/README.md",
    "chars": 586,
    "preview": "Example: Android Simple\n=======================\n\nThis example demonstrates how to structure an Android application with "
  },
  {
    "path": "examples/android-simple/pom.xml",
    "chars": 1935,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n Copyright (C) 2013 Square, Inc.\n\n  Licensed under the Apache License, Versi"
  },
  {
    "path": "examples/android-simple/src/main/AndroidManifest.xml",
    "chars": 756,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android"
  },
  {
    "path": "examples/android-simple/src/main/java/com/example/dagger/simple/AndroidModule.java",
    "chars": 1621,
    "preview": "/*\n * Copyright (C) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
  },
  {
    "path": "examples/android-simple/src/main/java/com/example/dagger/simple/DemoApplication.java",
    "chars": 1148,
    "preview": "/*\n * Copyright (C) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
  },
  {
    "path": "examples/android-simple/src/main/java/com/example/dagger/simple/DemoBaseActivity.java",
    "chars": 1013,
    "preview": "/*\n * Copyright (C) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
  },
  {
    "path": "examples/android-simple/src/main/java/com/example/dagger/simple/DemoModule.java",
    "chars": 855,
    "preview": "/*\n * Copyright (C) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
  },
  {
    "path": "examples/android-simple/src/main/java/com/example/dagger/simple/ForApplication.java",
    "chars": 832,
    "preview": "/*\n * Copyright (C) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
  },
  {
    "path": "examples/android-simple/src/main/java/com/example/dagger/simple/ui/HomeActivity.java",
    "chars": 1146,
    "preview": "/*\n * Copyright (C) 2013 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may n"
  },
  {
    "path": "examples/android-simple/src/main/res/values/strings.xml",
    "chars": 113,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n  <string name=\"app_name\">Dagger Simple</string>\n</resources>\n"
  },
  {
    "path": "examples/pom.xml",
    "chars": 2537,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n Copyright (C) 2013 Google, Inc.\n Copyright (C) 2013 Square, Inc.\n\n  License"
  },
  {
    "path": "examples/simple/pom.xml",
    "chars": 1779,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n Copyright (C) 2012 Square, Inc.\n\n  Licensed under the Apache License, Versi"
  },
  {
    "path": "examples/simple/src/main/java/coffee/CoffeeApp.java",
    "chars": 420,
    "preview": "package coffee;\n\nimport javax.inject.Inject;\n\nimport dagger.ObjectGraph;\n\npublic class CoffeeApp implements Runnable {\n "
  },
  {
    "path": "examples/simple/src/main/java/coffee/CoffeeMaker.java",
    "chars": 346,
    "preview": "package coffee;\n\nimport dagger.Lazy;\nimport javax.inject.Inject;\n\nclass CoffeeMaker {\n  @Inject Lazy<Heater> heater; // "
  },
  {
    "path": "examples/simple/src/main/java/coffee/DripCoffeeModule.java",
    "chars": 281,
    "preview": "package coffee;\n\nimport dagger.Module;\nimport dagger.Provides;\nimport javax.inject.Singleton;\n\n@Module(\n    injects = Co"
  },
  {
    "path": "examples/simple/src/main/java/coffee/ElectricHeater.java",
    "chars": 312,
    "preview": "package coffee;\n\nclass ElectricHeater implements Heater {\n  boolean heating;\n\n  @Override public void on() {\n    System."
  },
  {
    "path": "examples/simple/src/main/java/coffee/Heater.java",
    "chars": 84,
    "preview": "package coffee;\n\ninterface Heater {\n  void on();\n  void off();\n  boolean isHot();\n}\n"
  },
  {
    "path": "examples/simple/src/main/java/coffee/Pump.java",
    "chars": 51,
    "preview": "package coffee;\n\ninterface Pump {\n  void pump();\n}\n"
  },
  {
    "path": "examples/simple/src/main/java/coffee/PumpModule.java",
    "chars": 198,
    "preview": "package coffee;\n\nimport dagger.Module;\nimport dagger.Provides;\n\n@Module(complete = false, library = true)\nclass PumpModu"
  },
  {
    "path": "examples/simple/src/main/java/coffee/Thermosiphon.java",
    "chars": 308,
    "preview": "package coffee;\n\nimport javax.inject.Inject;\n\nclass Thermosiphon implements Pump {\n  private final Heater heater;\n\n  @In"
  },
  {
    "path": "examples/simple/src/test/java/coffee/CoffeeMakerTest.java",
    "chars": 1560,
    "preview": "/**\n * Copyright (C) 2015 Square, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may "
  },
  {
    "path": "pom.xml",
    "chars": 6049,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n Copyright (C) 2012 Square, Inc.\n\n  Licensed under the Apache License, Versi"
  },
  {
    "path": "website/index.html",
    "chars": 26708,
    "preview": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\">\n    <title>Dagger</title>\n    <meta name=\"viewport\""
  },
  {
    "path": "website/static/app-theme.css",
    "chars": 977,
    "preview": "/* http://www.colorhexa.com/487fb9 */\n\n/*** Primary ***/\n\nheader,\n#subtitle,\na.dl {\n  background-color: #487fb9;\n}\n\n.con"
  }
]

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

About this extraction

This page contains the full source code of the square/dagger GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 202 files (601.2 KB), approximately 153.0k tokens, and a symbol index with 989 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!