Skip to content

Commit

Permalink
Merge pull request #568 from google/sync-master-2017/12/15
Browse files Browse the repository at this point in the history
Moe sync
  • Loading branch information
eamonnmcmanus authored Dec 16, 2017
2 parents 033e44f + f04406c commit b896bf4
Show file tree
Hide file tree
Showing 40 changed files with 1,157 additions and 1,022 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package com.google.auto.factory.processor;

import static com.google.auto.common.GeneratedAnnotationSpecs.generatedAnnotationSpec;
import static com.google.auto.factory.processor.Mirrors.isProvider;
import static com.squareup.javapoet.MethodSpec.constructorBuilder;
import static com.squareup.javapoet.MethodSpec.methodBuilder;
Expand Down Expand Up @@ -45,7 +46,6 @@
import javax.inject.Inject;
import javax.inject.Provider;
import javax.lang.model.element.AnnotationMirror;
import javax.lang.model.element.TypeElement;
import javax.lang.model.type.TypeMirror;
import javax.lang.model.util.Elements;

Expand All @@ -65,16 +65,11 @@ void writeFactory(final FactoryDescriptor descriptor)
throws IOException {
String factoryName = getSimpleName(descriptor.name()).toString();
TypeSpec.Builder factory = classBuilder(factoryName);
// TODO(ronshapiro): use javax.annotation.processing.Generated if it's available?
TypeElement generatedAnnotation = elements.getTypeElement("javax.annotation.Generated");
if (generatedAnnotation != null) {
factory.addAnnotation(
AnnotationSpec.builder(ClassName.get(generatedAnnotation))
.addMember("value", "$S", AutoFactoryProcessor.class.getName())
.addMember(
"comments", "$S", "https://github.com/google/auto/tree/master/factory")
.build());
}
generatedAnnotationSpec(
elements,
AutoFactoryProcessor.class,
"https://github.com/google/auto/tree/master/factory")
.ifPresent(factory::addAnnotation);
if (!descriptor.allowSubclasses()) {
factory.addModifiers(FINAL);
}
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package tests;

import javax.annotation.Generated;
import javax.annotation.processing.Generated;
import javax.inject.Inject;
import javax.inject.Provider;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package tests;

import javax.annotation.Generated;
import javax.annotation.processing.Generated;
import javax.inject.Inject;
import javax.inject.Provider;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package tests;

import javax.annotation.Generated;
import javax.annotation.processing.Generated;
import javax.inject.Inject;
import javax.inject.Provider;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package tests;

import javax.annotation.Generated;
import javax.annotation.processing.Generated;
import javax.inject.Inject;

@Generated(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package tests;

import javax.annotation.Generated;
import javax.annotation.processing.Generated;
import javax.inject.Inject;
import javax.inject.Provider;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package tests;

import javax.annotation.Generated;
import javax.annotation.processing.Generated;
import javax.inject.Inject;

@Generated(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
package tests;

import java.util.List;
import javax.annotation.Generated;
import javax.annotation.processing.Generated;
import javax.inject.Inject;

@Generated(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package tests;

import javax.annotation.Generated;
import javax.annotation.processing.Generated;
import javax.inject.Inject;
import javax.inject.Provider;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package tests;

import javax.annotation.Generated;
import javax.annotation.processing.Generated;
import javax.inject.Inject;
import javax.inject.Provider;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package tests;

import javax.annotation.Generated;
import javax.annotation.processing.Generated;
import javax.inject.Inject;
import javax.inject.Provider;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package tests;

import javax.annotation.Generated;
import javax.annotation.processing.Generated;
import javax.inject.Inject;

@Generated(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package tests;

import javax.annotation.Generated;
import javax.annotation.processing.Generated;
import javax.inject.Inject;

@Generated(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package tests;

import javax.annotation.Generated;
import javax.annotation.processing.Generated;
import javax.inject.Inject;
import javax.inject.Provider;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package tests;

import javax.annotation.Generated;
import javax.annotation.processing.Generated;
import javax.inject.Inject;

@Generated(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package tests;

import javax.annotation.Generated;
import javax.annotation.processing.Generated;
import javax.inject.Inject;

@Generated(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package tests;

import javax.annotation.Generated;
import javax.annotation.processing.Generated;
import javax.inject.Inject;

@Generated(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package tests;

import javax.annotation.Generated;
import javax.annotation.processing.Generated;
import javax.inject.Inject;
import javax.inject.Provider;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package tests;

import javax.annotation.Generated;
import javax.annotation.processing.Generated;
import javax.inject.Inject;

@Generated(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package tests;

import javax.annotation.Generated;
import javax.annotation.processing.Generated;
import javax.inject.Inject;

@Generated(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
package tests;

import java.util.RandomAccess;
import javax.annotation.Generated;
import javax.annotation.processing.Generated;
import javax.inject.Inject;

@Generated(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package tests;

import javax.annotation.Generated;
import javax.annotation.processing.Generated;
import javax.inject.Inject;

@Generated(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package tests;

import javax.annotation.Generated;
import javax.annotation.processing.Generated;
import javax.inject.Inject;
import javax.inject.Provider;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package tests;

import javax.annotation.Generated;
import javax.annotation.processing.Generated;
import javax.inject.Inject;

@Generated(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
*/
package tests;

import javax.annotation.Generated;
import javax.annotation.Nullable;
import javax.annotation.processing.Generated;
import javax.inject.Inject;
import javax.inject.Provider;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package tests;

import javax.annotation.Generated;
import javax.annotation.processing.Generated;
import javax.inject.Inject;

@Generated(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package tests;

import javax.annotation.Generated;
import javax.annotation.processing.Generated;
import javax.inject.Inject;
import javax.inject.Provider;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package tests;

import javax.annotation.Generated;
import javax.annotation.processing.Generated;
import javax.inject.Inject;
import javax.inject.Provider;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package tests;

import javax.annotation.Generated;
import javax.annotation.processing.Generated;
import javax.inject.Inject;

@Generated(
Expand Down
Loading

0 comments on commit b896bf4

Please sign in to comment.