aboutsummaryrefslogtreecommitdiff
path: root/value/src/test/java/com/google/auto/value/processor/SimplifyWithAnnotationsTest.java
diff options
context:
space:
mode:
authoremcmanus <emcmanus@google.com>2018-05-29 23:42:39 -0700
committerRon Shapiro <shapiro.rd@gmail.com>2018-05-31 13:26:22 -0400
commit41d78d29859afa4ab4d6a9650f2fc612d45d6f23 (patch)
tree5110947fdc6d916c80c99735c098cfdb80089987 /value/src/test/java/com/google/auto/value/processor/SimplifyWithAnnotationsTest.java
parent0ffe45c3da9729d04de678f583d0733c82c6a170 (diff)
downloadauto-41d78d29859afa4ab4d6a9650f2fc612d45d6f23.tar.gz
Reformat AutoValue source code using google-java-format. A few of the changes are arguably for the worse, but it's worth having a consistent format.
RELNOTES=Reformatted AutoValue source code using google-java-format. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=198512874
Diffstat (limited to 'value/src/test/java/com/google/auto/value/processor/SimplifyWithAnnotationsTest.java')
-rw-r--r--value/src/test/java/com/google/auto/value/processor/SimplifyWithAnnotationsTest.java100
1 files changed, 51 insertions, 49 deletions
diff --git a/value/src/test/java/com/google/auto/value/processor/SimplifyWithAnnotationsTest.java b/value/src/test/java/com/google/auto/value/processor/SimplifyWithAnnotationsTest.java
index 1d3fa44a..9f7ff337 100644
--- a/value/src/test/java/com/google/auto/value/processor/SimplifyWithAnnotationsTest.java
+++ b/value/src/test/java/com/google/auto/value/processor/SimplifyWithAnnotationsTest.java
@@ -62,48 +62,48 @@ public class SimplifyWithAnnotationsTest {
@Rule public final Expect expect = Expect.create();
/**
- * The types that we will compile and then recreate. They are referenced in a context where
- * {@code Set} is unambiguous but not {@code List}, which allows us to test the placement of
- * annotations in unqualified types like {@code Set<T>} and qualified types like
- * {@code java.util.List<T>}.
+ * The types that we will compile and then recreate. They are referenced in a context where {@code
+ * Set} is unambiguous but not {@code List}, which allows us to test the placement of annotations
+ * in unqualified types like {@code Set<T>} and qualified types like {@code java.util.List<T>}.
*/
- private static final ImmutableList<String> TYPE_SPELLINGS = ImmutableList.of(
- "Object",
- "Set",
- "String",
- "Nullable",
- "@Nullable String",
- "String[]",
- "@Nullable String[]",
- "String @Nullable []",
- "String @Nullable [] @Nullable []",
- "java.awt.List",
- "java.util.List<String>",
- "Set<@Nullable String>",
- "@Nullable Set<String>",
- "int",
- "@Nullable int", // whatever that might mean
- "@Nullable int[]",
- "int @Nullable []",
- "T",
- "@Nullable T",
- "Set<@Nullable T>",
- "Set<? extends @Nullable T>",
- "Set<? extends @Nullable String>",
- "Set<? extends @Nullable String @Nullable []>",
- "java.util.@Nullable List<@Nullable T>",
- "java.util.@Nullable List<java.util.@Nullable List<T>>");
+ private static final ImmutableList<String> TYPE_SPELLINGS =
+ ImmutableList.of(
+ "Object",
+ "Set",
+ "String",
+ "Nullable",
+ "@Nullable String",
+ "String[]",
+ "@Nullable String[]",
+ "String @Nullable []",
+ "String @Nullable [] @Nullable []",
+ "java.awt.List",
+ "java.util.List<String>",
+ "Set<@Nullable String>",
+ "@Nullable Set<String>",
+ "int",
+ "@Nullable int", // whatever that might mean
+ "@Nullable int[]",
+ "int @Nullable []",
+ "T",
+ "@Nullable T",
+ "Set<@Nullable T>",
+ "Set<? extends @Nullable T>",
+ "Set<? extends @Nullable String>",
+ "Set<? extends @Nullable String @Nullable []>",
+ "java.util.@Nullable List<@Nullable T>",
+ "java.util.@Nullable List<java.util.@Nullable List<T>>");
- private static final JavaFileObject NULLABLE_FILE_OBJECT = JavaFileObjects.forSourceLines(
- "pkg.Nullable",
-
- "package pkg;",
- "",
- "import java.lang.annotation.ElementType;",
- "import java.lang.annotation.Target;",
- "",
- "@Target(ElementType.TYPE_USE)",
- "public @interface Nullable {}");
+ private static final JavaFileObject NULLABLE_FILE_OBJECT =
+ JavaFileObjects.forSourceLines(
+ "pkg.Nullable",
+ "package pkg;",
+ "",
+ "import java.lang.annotation.ElementType;",
+ "import java.lang.annotation.Target;",
+ "",
+ "@Target(ElementType.TYPE_USE)",
+ "public @interface Nullable {}");
private static final JavaFileObject TEST_CLASS_FILE_OBJECT =
JavaFileObjects.forSourceLines("pkg.TestClass", buildTestClass());
@@ -131,10 +131,11 @@ public class SimplifyWithAnnotationsTest {
@Test
public void testSimplifyWithAnnotations() {
// The real test happens inside the .compile(...), by virtue of TestProcessor.
- assertThat(javac()
- .withOptions("-proc:only")
- .withProcessors(new TestProcessor())
- .compile(NULLABLE_FILE_OBJECT, TEST_CLASS_FILE_OBJECT))
+ assertThat(
+ javac()
+ .withOptions("-proc:only")
+ .withProcessors(new TestProcessor())
+ .compile(NULLABLE_FILE_OBJECT, TEST_CLASS_FILE_OBJECT))
.succeededWithoutWarnings();
}
@@ -146,8 +147,7 @@ public class SimplifyWithAnnotationsTest {
}
@Override
- public boolean process(
- Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
+ public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
if (roundEnv.processingOver()) {
TypeElement testClass = processingEnv.getElementUtils().getTypeElement("pkg.TestClass");
testTypeSpellings(testClass);
@@ -156,9 +156,11 @@ public class SimplifyWithAnnotationsTest {
}
void testTypeSpellings(TypeElement testClass) {
- ExecutableElement witness = ElementFilter.methodsIn(testClass.getEnclosedElements()).stream()
- .filter(m -> m.getSimpleName().contentEquals("witness"))
- .collect(onlyElement());
+ ExecutableElement witness =
+ ElementFilter.methodsIn(testClass.getEnclosedElements())
+ .stream()
+ .filter(m -> m.getSimpleName().contentEquals("witness"))
+ .collect(onlyElement());
if (witness.getReturnType().getAnnotationMirrors().isEmpty()) {
System.err.println("SKIPPING TEST BECAUSE OF BUGGY COMPILER");
return;