Repository: square/AssistedInject (kotlin)

Issue:
Request not to mandate same names for assisted parameters
Request not to mandate same names for assisted parameters. In my case, changing params to workerParameters fixed it but would be nice not to force same names.

InternalWorkerFactory.java:9: error: Factory method parameters do not match constructor @Assisted parameters.
    public abstract T create(@org.jetbrains.annotations.NotNull()
                      ^
  Missing:
   * androidx.work.WorkerParameters params
  Unknown:
   * androidx.work.WorkerParameters workerParameters

Pull request description:
This is a manual revert of
12cfeac1fa03282b59f56522b2c2649da7066f27. Some files have
diverged too much making automated revert hard.

Closes #81. Closes #121. Closes #140.

Patch:
diff --git a/assisted-inject-processor/src/main/java/com/squareup/inject/assisted/processor/AssistedInjectProcessor.kt b/assisted-inject-processor/src/main/java/com/squareup/inject/assisted/processor/AssistedInjectProcessor.kt
index ae652d5..0aadf04 100644
--- a/assisted-inject-processor/src/main/java/com/squareup/inject/assisted/processor/AssistedInjectProcessor.kt
+++ b/assisted-inject-processor/src/main/java/com/squareup/inject/assisted/processor/AssistedInjectProcessor.kt
@@ -229,6 +229,14 @@ class AssistedInjectProcessor : AbstractProcessor() {
     if (assistedRequests.isEmpty()) {
       warn("Assisted injection without at least one @Assisted parameter can use @Inject",
           targetConstructor)
+    } else {
+      val assistedDuplicates = assistedRequests.groupBy { it.key }.filterValues { it.size > 1 }
+      if (assistedDuplicates.isNotEmpty()) {
+        error("Duplicate @Assisted parameters declared. Forget a qualifier annotation?"
+            + assistedDuplicates.values.flatten().joinToString("\n * ", prefix = "\n * "),
+          targetConstructor)
+        valid = false
+      }
     }
     if (providedRequests.isEmpty()) {
       warn("Assisted injection without at least one non-@Assisted parameter doesn't need a factory",
@@ -240,10 +248,10 @@ class AssistedInjectProcessor : AbstractProcessor() {
     val factoryExecutable = types.asMemberOf(factoryType.asType() as DeclaredType,
         factoryMethod) as ExecutableType
 
-    val expectedKeys = assistedRequests.map { it.namedKey }.sorted()
+    val expectedKeys = assistedRequests.map { it.key }.toSet()
     val factoryKeys = factoryMethod.parameters
-        .zip(factoryExecutable.parameterTypes) { element, mirror -> element.asNamedKey(mirror) }
-    val keys = factoryKeys.sorted()
+        .zip(factoryExecutable.parameterTypes) { element, mirror -> element.asKey(mirror) }
+    val keys = factoryKeys.toSet()
     if (keys != expectedKeys) {
       val message = buildString {
         append("Factory method parameters do not match constructor @Assisted parameters. ")
diff --git a/assisted-inject-processor/src/main/java/com/squareup/inject/assisted/processor/AssistedInjection.kt b/assisted-inject-processor/src/main/java/com/squareup/inject/assisted/processor/AssistedInjection.kt
index e67adb1..23f5834 100644
--- a/assisted-inject-processor/src/main/java/com/squareup/inject/assisted/processor/AssistedInjection.kt
+++ b/assisted-inject-processor/src/main/java/com/squareup/inject/assisted/processor/AssistedInjection.kt
@@ -35,20 +35,20 @@ data class AssistedInjection(
    * The factory method keys. These default to the keys of the assisted [dependencyRequests]
    * and when supplied must always match them, but the order is allowed to be different.
    */
-  val assistedKeys: List<NamedKey> = dependencyRequests.filter { it.isAssisted }.map { it.namedKey },
+  val assistedKeys: List<Key> = dependencyRequests.filter { it.isAssisted }.map { it.key },
   /** An optional `@Generated` annotation marker. */
   val generatedAnnotation: AnnotationSpec? = null
 ) {
+  private val keyToRequest = dependencyRequests.filter { it.isAssisted }.associateBy { it.key }
   init {
-    val requestKeys = dependencyRequests.filter { it.isAssisted }.map { it.namedKey }
-    check(requestKeys.sorted() == assistedKeys.sorted()) {
+    check(keyToRequest.keys == assistedKeys.toSet()) {
       """
         assistedKeys must contain the same elements as the assisted dependencyRequests.
 
         * assistedKeys:
             $assistedKeys
         * assisted dependencyRequests:
-            $requestKeys
+            ${keyToRequest.keys}
       """.trimIndent()
     }
   }
@@ -87,8 +87,9 @@ data class AssistedInjection(
                 addTypeVariables(targetType.typeArguments.filterIsInstance<TypeVariableName>())
               }
             }
-            .applyEach(assistedKeys) { namedKey ->
-              addParameter(namedKey.key.type, namedKey.name)
+            .applyEach(assistedKeys) { key ->
+              val parameterName = keyToRequest.getValue(key).name
+              addParameter(key.type, parameterName)
             }
             .addStatement("return new \$T(\n\$L)", targetType,
                 dependencyRequests.map { it.argumentProvider }.joinToCode(",\n"))
diff --git a/assisted-inject-processor/src/main/java/com/squareup/inject/assisted/processor/DependencyRequest.kt b/assisted-inject-processor/src/main/java/com/squareup/inject/assisted/processor/DependencyRequest.kt
index 54239a8..c3b85c3 100644
--- a/assisted-inject-processor/src/main/java/com/squareup/inject/assisted/processor/DependencyRequest.kt
+++ b/assisted-inject-processor/src/main/java/com/squareup/inject/assisted/processor/DependencyRequest.kt
@@ -21,15 +21,13 @@ import javax.lang.model.element.VariableElement
 
 /** Associates a [Key] with its desired use as assisted or not. */
 data class DependencyRequest(
-  val namedKey: NamedKey,
+  val key: Key,
   /** True when fulfilled by the caller. Otherwise fulfilled by a JSR 330 provider. */
-  val isAssisted: Boolean
+  val isAssisted: Boolean,
+  val name: String
 ) {
-  val key get() = namedKey.key
-  val name get() = namedKey.name
-
   override fun toString() = (if (isAssisted) "@Assisted " else "") + "$key $name"
 }
 
 fun VariableElement.asDependencyRequest() =
-    DependencyRequest(asNamedKey(), hasAnnotation<Assisted>())
+    DependencyRequest(asKey(), hasAnnotation<Assisted>(), simpleName.toString())
diff --git a/assisted-inject-processor/src/main/java/com/squareup/inject/assisted/processor/Key.kt b/assisted-inject-processor/src/main/java/com/squareup/inject/assisted/processor/Key.kt
index 6f0e441..3d26092 100644
--- a/assisted-inject-processor/src/main/java/com/squareup/inject/assisted/processor/Key.kt
+++ b/assisted-inject-processor/src/main/java/com/squareup/inject/assisted/processor/Key.kt
@@ -22,15 +22,12 @@ import com.squareup.javapoet.TypeName
 import javax.lang.model.element.VariableElement
 import javax.lang.model.type.TypeMirror
 
-private val keyComparator = compareBy<Key>({ it.type.toString() }, { it.qualifier == null })
-
 /** Represents a type and an optional qualifier annotation for a binding. */
 data class Key(
   val type: TypeName,
   val qualifier: AnnotationSpec? = null
-) : Comparable<Key> {
+) {
   override fun toString() = qualifier?.let { "$it $type" } ?: type.toString()
-  override fun compareTo(other: Key) = keyComparator.compare(this, other)
 }
 
 /** Create a [Key] from this type and any qualifier annotation. */
diff --git a/assisted-inject-processor/src/main/java/com/squareup/inject/assisted/processor/NamedKey.kt b/assisted-inject-processor/src/main/java/com/squareup/inject/assisted/processor/NamedKey.kt
deleted file mode 100644
index f3c6730..0000000
--- a/assisted-inject-processor/src/main/java/com/squareup/inject/assisted/processor/NamedKey.kt
+++ /dev/null
@@ -1,18 +0,0 @@
-package com.squareup.inject.assisted.processor
-
-import javax.lang.model.element.VariableElement
-import javax.lang.model.type.TypeMirror
-
-private val namedKeyComparator = compareBy<NamedKey>({ it.key }, { it.name })
-
-/** Represents a [Key] associated with a name. */
-data class NamedKey(
-  val key: Key,
-  val name: String
-) : Comparable<NamedKey> {
-  override fun toString() = "$key $name"
-  override fun compareTo(other: NamedKey) = namedKeyComparator.compare(this, other)
-}
-
-/** Create a [NamedKey] from this type, any qualifier annotation, and the name. */
-fun VariableElement.asNamedKey(mirror: TypeMirror = asType()) = NamedKey(asKey(mirror), simpleName.toString())
diff --git a/inflation-inject-processor/src/main/java/com/squareup/inject/inflation/processor/InflationInjectProcessor.kt b/inflation-inject-processor/src/main/java/com/squareup/inject/inflation/processor/InflationInjectProcessor.kt
index 3c71024..57650f3 100644
--- a/inflation-inject-processor/src/main/java/com/squareup/inject/inflation/processor/InflationInjectProcessor.kt
+++ b/inflation-inject-processor/src/main/java/com/squareup/inject/inflation/processor/InflationInjectProcessor.kt
@@ -3,7 +3,6 @@ package com.squareup.inject.inflation.processor
 import com.google.auto.service.AutoService
 import com.squareup.inject.assisted.processor.AssistedInjection
 import com.squareup.inject.assisted.processor.Key
-import com.squareup.inject.assisted.processor.NamedKey
 import com.squareup.inject.assisted.processor.asDependencyRequest
 import com.squareup.inject.assisted.processor.internal.MirrorValue
 import com.squareup.inject.assisted.processor.internal.applyEach
@@ -194,7 +193,7 @@ class InflationInjectProcessor : AbstractProcessor() {
 
     val requests = targetConstructor.parameters.map { it.asDependencyRequest() }
     val (assistedRequests, providedRequests) = requests.partition { it.isAssisted }
-    val assistedKeys = assistedRequests.map { it.namedKey }
+    val assistedKeys = assistedRequests.map { it.key }
     if (assistedKeys.toSet() != FACTORY_KEYS.toSet()) {
       error("""
         Inflation injection requires Context and AttributeSet @Assisted parameters.
@@ -311,5 +310,5 @@ class InflationInjectProcessor : AbstractProcessor() {
 private val VIEW = ClassName.get("android.view", "View")
 private val FACTORY = ViewFactory::class.toClassName()
 private val FACTORY_KEYS = listOf(
-    NamedKey(Key(ClassName.get("android.content", "Context")), "context"),
-    NamedKey(Key(ClassName.get("android.util", "AttributeSet")), "attrs"))
+    Key(ClassName.get("android.content", "Context")),
+    Key(ClassName.get("android.util", "AttributeSet")))


Test patch:
diff --git a/assisted-inject-processor/src/test/java/com/squareup/inject/assisted/processor/AssistedInjectProcessorTest.kt b/assisted-inject-processor/src/test/java/com/squareup/inject/assisted/processor/AssistedInjectProcessorTest.kt
index 07a6af2..9958009 100644
--- a/assisted-inject-processor/src/test/java/com/squareup/inject/assisted/processor/AssistedInjectProcessorTest.kt
+++ b/assisted-inject-processor/src/test/java/com/squareup/inject/assisted/processor/AssistedInjectProcessorTest.kt
@@ -188,7 +188,7 @@ class AssistedInjectProcessorTest {
         .generatesSources(expected)
   }
 
-  @Test fun providedAndAssistedSameType() {
+  @Test fun factoryParameterNameIsNotUsedInTheImpl() {
     val input = JavaFileObjects.forSourceString("test.Test", """
       package test;
 
@@ -197,11 +197,11 @@ class AssistedInjectProcessorTest {
 
       class Test {
         @AssistedInject
-        Test(String foo, @Assisted String bar) {}
+        Test(Long foo, @Assisted String bar) {}
 
         @AssistedInject.Factory
         interface Factory {
-          Test create(String bar);
+          Test create(String blah);
         }
       }
     """)
@@ -209,6 +209,7 @@ class AssistedInjectProcessorTest {
     val expected = JavaFileObjects.forSourceString("test.Test_AssistedFactory", """
       package test;
 
+      import java.lang.Long;
       import java.lang.Override;
       import java.lang.String;
       import $GENERATED_TYPE;
@@ -217,9 +218,9 @@ class AssistedInjectProcessorTest {
 
       $GENERATED_ANNOTATION
       public final class Test_AssistedFactory implements Test.Factory {
-        private final Provider<String> foo;
+        private final Provider<Long> foo;
 
-        @Inject public Test_AssistedFactory(Provider<String> foo) {
+        @Inject public Test_AssistedFactory(Provider<Long> foo) {
           this.foo = foo;
         }
 
@@ -237,7 +238,7 @@ class AssistedInjectProcessorTest {
         .generatesSources(expected)
   }
 
-  @Test fun duplicateProvided() {
+  @Test fun providedAndAssistedSameType() {
     val input = JavaFileObjects.forSourceString("test.Test", """
       package test;
 
@@ -246,7 +247,7 @@ class AssistedInjectProcessorTest {
 
       class Test {
         @AssistedInject
-        Test(String foo, @Assisted String bar, String baz) {}
+        Test(String foo, @Assisted String bar) {}
 
         @AssistedInject.Factory
         interface Factory {
@@ -267,64 +268,13 @@ class AssistedInjectProcessorTest {
       $GENERATED_ANNOTATION
       public final class Test_AssistedFactory implements Test.Factory {
         private final Provider<String> foo;
-        private final Provider<String> baz;
 
-        @Inject public Test_AssistedFactory(Provider<String> foo, Provider<String> baz) {
+        @Inject public Test_AssistedFactory(Provider<String> foo) {
           this.foo = foo;
-          this.baz = baz;
         }
 
         @Override public Test create(String bar) {
-          return new Test(foo.get(), bar, baz.get());
-        }
-      }
-    """)
-
-    assertAbout(javaSource())
-        .that(input)
-        .processedWith(AssistedInjectProcessor())
-        .compilesWithoutError()
-        .and()
-        .generatesSources(expected)
-  }
-
-  @Test fun duplicateAssisted() {
-    val input = JavaFileObjects.forSourceString("test.Test", """
-      package test;
-
-      import com.squareup.inject.assisted.Assisted;
-      import com.squareup.inject.assisted.AssistedInject;
-
-      class Test {
-        @AssistedInject
-        Test(@Assisted String foo, String bar, @Assisted String baz) {}
-
-        @AssistedInject.Factory
-        interface Factory {
-          Test create(String foo, String baz);
-        }
-      }
-    """)
-
-    val expected = JavaFileObjects.forSourceString("test.Test_AssistedFactory", """
-      package test;
-
-      import java.lang.Override;
-      import java.lang.String;
-      import $GENERATED_TYPE;
-      import javax.inject.Inject;
-      import javax.inject.Provider;
-
-      $GENERATED_ANNOTATION
-      public final class Test_AssistedFactory implements Test.Factory {
-        private final Provider<String> bar;
-
-        @Inject public Test_AssistedFactory(Provider<String> bar) {
-          this.bar = bar;
-        }
-
-        @Override public Test create(String foo, String baz) {
-          return new Test(foo, bar.get(), baz);
+          return new Test(foo.get(), bar);
         }
       }
     """)
@@ -337,7 +287,7 @@ class AssistedInjectProcessorTest {
         .generatesSources(expected)
   }
 
-  @Test fun duplicateAssistedOutOfOrder() {
+  @Test fun duplicateProvided() {
     val input = JavaFileObjects.forSourceString("test.Test", """
       package test;
 
@@ -346,11 +296,11 @@ class AssistedInjectProcessorTest {
 
       class Test {
         @AssistedInject
-        Test(@Assisted String foo, String bar, @Assisted String baz) {}
+        Test(String foo, @Assisted String bar, String baz) {}
 
         @AssistedInject.Factory
         interface Factory {
-          Test create(String baz, String foo);
+          Test create(String bar);
         }
       }
     """)
@@ -366,14 +316,16 @@ class AssistedInjectProcessorTest {
 
       $GENERATED_ANNOTATION
       public final class Test_AssistedFactory implements Test.Factory {
-        private final Provider<String> bar;
+        private final Provider<String> foo;
+        private final Provider<String> baz;
 
-        @Inject public Test_AssistedFactory(Provider<String> bar) {
-          this.bar = bar;
+        @Inject public Test_AssistedFactory(Provider<String> foo, Provider<String> baz) {
+          this.foo = foo;
+          this.baz = baz;
         }
 
-        @Override public Test create(String baz, String foo) {
-          return new Test(foo, bar.get(), baz);
+        @Override public Test create(String bar) {
+          return new Test(foo.get(), bar, baz.get());
         }
       }
     """)
@@ -386,7 +338,7 @@ class AssistedInjectProcessorTest {
         .generatesSources(expected)
   }
 
-  @Test fun duplicateAssistedNameMismatch() {
+  @Test fun duplicateAssisted() {
     val input = JavaFileObjects.forSourceString("test.Test", """
       package test;
 
@@ -399,39 +351,7 @@ class AssistedInjectProcessorTest {
 
         @AssistedInject.Factory
         interface Factory {
-          Test create(String foo, String fizz);
-        }
-      }
-    """)
-
-    assertAbout(javaSource())
-        .that(input)
-        .processedWith(AssistedInjectProcessor())
-        .failsToCompile()
-        .withErrorContaining("""
-          Factory method parameters do not match constructor @Assisted parameters. Both parameter type and name must match.
-            Declared by constructor, unmatched in factory method:
-             * java.lang.String baz
-            Declared by factory method, unmatched in constructor:
-             * java.lang.String fizz
-        """.trimIndent())
-        .`in`(input).onLine(13)
-  }
-
-  @Test fun nameMismatch() {
-    val input = JavaFileObjects.forSourceString("test.Test", """
-      package test;
-
-      import com.squareup.inject.assisted.Assisted;
-      import com.squareup.inject.assisted.AssistedInject;
-
-      class Test {
-        @AssistedInject
-        Test(@Assisted String foo, String bar) {}
-
-        @AssistedInject.Factory
-        interface Factory {
-          Test create(String baz);
+          Test create(String foo, String baz);
         }
       }
     """)
@@ -441,16 +361,13 @@ class AssistedInjectProcessorTest {
         .processedWith(AssistedInjectProcessor())
         .failsToCompile()
         .withErrorContaining("""
-          Factory method parameters do not match constructor @Assisted parameters. Both parameter type and name must match.
-            Declared by constructor, unmatched in factory method:
-             * java.lang.String foo
-            Declared by factory method, unmatched in constructor:
-             * java.lang.String baz
+          Duplicate @Assisted parameters declared. Forget a qualifier annotation?
+             * @Assisted java.lang.String foo
+             * @Assisted java.lang.String baz
         """.trimIndent())
-        .`in`(input).onLine(13)
+        .`in`(input).onLine(9)
   }
 
-
   @Test fun providedQualifier() {
     val input = JavaFileObjects.forSourceString("test.Test", """
       package test;
@@ -866,9 +783,9 @@ class AssistedInjectProcessorTest {
         .withErrorContaining("""
           Factory method parameters do not match constructor @Assisted parameters. Both parameter type and name must match.
             Declared by constructor, unmatched in factory method:
-             * java.lang.String bar
+             * java.lang.String
             Declared by factory method, unmatched in constructor:
-             * java.lang.Long bar
+             * java.lang.Long
         """.trimIndent())
         .`in`(input).onLine(13)
   }
@@ -901,9 +818,9 @@ class AssistedInjectProcessorTest {
         .withErrorContaining("""
           Factory method parameters do not match constructor @Assisted parameters. Both parameter type and name must match.
             Declared by constructor, unmatched in factory method:
-             * java.lang.String bar
+             * java.lang.String
             Declared by factory method, unmatched in constructor:
-             * java.lang.Long bar
+             * java.lang.Long
         """.trimIndent())
         .`in`(input).onLine(9)
   }
@@ -937,9 +854,9 @@ class AssistedInjectProcessorTest {
         .withErrorContaining("""
           Factory method parameters do not match constructor @Assisted parameters. Both parameter type and name must match.
             Declared by constructor, unmatched in factory method:
-             * java.lang.String bar
+             * java.lang.String
             Declared by factory method, unmatched in constructor:
-             * @test.Id java.lang.String bar
+             * @test.Id java.lang.String
         """.trimIndent())
         .`in`(input).onLine(14)
   }
@@ -973,9 +890,9 @@ class AssistedInjectProcessorTest {
         .withErrorContaining("""
           Factory method parameters do not match constructor @Assisted parameters. Both parameter type and name must match.
             Declared by constructor, unmatched in factory method:
-             * @test.Id java.lang.String bar
+             * @test.Id java.lang.String
             Declared by factory method, unmatched in constructor:
-             * java.lang.String bar
+             * java.lang.String
         """.trimIndent())
         .`in`(input).onLine(14)
   }
diff --git a/inflation-inject-processor/src/test/java/com/squareup/inject/inflation/processor/InflationInjectProcessorTest.kt b/inflation-inject-processor/src/test/java/com/squareup/inject/inflation/processor/InflationInjectProcessorTest.kt
index 1263919..02f4149 100644
--- a/inflation-inject-processor/src/test/java/com/squareup/inject/inflation/processor/InflationInjectProcessorTest.kt
+++ b/inflation-inject-processor/src/test/java/com/squareup/inject/inflation/processor/InflationInjectProcessorTest.kt
@@ -389,70 +389,6 @@ class InflationInjectProcessorTest {
         .generatesSources(expectedFactory)
   }
 
-  @Test fun differentNameContext() {
-    val inputView = JavaFileObjects.forSourceString("test.TestView", """
-      package test;
-
-      import android.content.Context;
-      import android.util.AttributeSet;
-      import android.view.View;
-      import com.squareup.inject.assisted.Assisted;
-      import com.squareup.inject.inflation.InflationInject;
-
-      class TestView extends View {
-        @InflationInject
-        TestView(@Assisted Context c, @Assisted AttributeSet attrs, Long foo) {
-          super(context, attrs);
-        }
-      }
-    """)
-
-    assertAbout(javaSource())
-        .that(inputView)
-        .processedWith(InflationInjectProcessor())
-        .failsToCompile()
-        .withErrorContaining("""
-          Inflation injection requires Context and AttributeSet @Assisted parameters.
-              Found:
-                [android.content.Context c, android.util.AttributeSet attrs]
-              Expected:
-                [android.content.Context context, android.util.AttributeSet attrs]
-          """.trimIndent())
-        .`in`(inputView).onLine(12)
-  }
-
-  @Test fun differentNameAttributeSet() {
-    val inputView = JavaFileObjects.forSourceString("test.TestView", """
-      package test;
-
-      import android.content.Context;
-      import android.util.AttributeSet;
-      import android.view.View;
-      import com.squareup.inject.assisted.Assisted;
-      import com.squareup.inject.inflation.InflationInject;
-
-      class TestView extends View {
-        @InflationInject
-        TestView(@Assisted Context context, @Assisted AttributeSet a, Long foo) {
-          super(context, attrs);
-        }
-      }
-    """)
-
-    assertAbout(javaSource())
-        .that(inputView)
-        .processedWith(InflationInjectProcessor())
-        .failsToCompile()
-        .withErrorContaining("""
-          Inflation injection requires Context and AttributeSet @Assisted parameters.
-              Found:
-                [android.content.Context context, android.util.AttributeSet a]
-              Expected:
-                [android.content.Context context, android.util.AttributeSet attrs]
-          """.trimIndent())
-        .`in`(inputView).onLine(12)
-  }
-
   @Test fun contextAndAttributeSetSwapped() {
     val inputView = JavaFileObjects.forSourceString("test.TestView", """
       package test;
@@ -704,7 +640,7 @@ class InflationInjectProcessorTest {
               Found:
                 []
               Expected:
-                [android.content.Context context, android.util.AttributeSet attrs]
+                [android.content.Context, android.util.AttributeSet]
           """.trimIndent())
         .`in`(inputView).onLine(9)
   }
@@ -734,9 +670,9 @@ class InflationInjectProcessorTest {
         .withErrorContaining("""
           Inflation injection requires Context and AttributeSet @Assisted parameters.
               Found:
-                [android.content.Context context, android.util.AttributeSet attrs, java.lang.String hey]
+                [android.content.Context, android.util.AttributeSet, java.lang.String]
               Expected:
-                [android.content.Context context, android.util.AttributeSet attrs]
+                [android.content.Context, android.util.AttributeSet]
           """.trimIndent())
         .`in`(inputView).onLine(12)
   }
@@ -765,9 +701,9 @@ class InflationInjectProcessorTest {
         .withErrorContaining("""
           Inflation injection requires Context and AttributeSet @Assisted parameters.
               Found:
-                [android.util.AttributeSet attrs]
+                [android.util.AttributeSet]
               Expected:
-                [android.content.Context context, android.util.AttributeSet attrs]
+                [android.content.Context, android.util.AttributeSet]
           """.trimIndent())
         .`in`(inputView).onLine(11)
   }
@@ -796,9 +732,9 @@ class InflationInjectProcessorTest {
         .withErrorContaining("""
           Inflation injection requires Context and AttributeSet @Assisted parameters.
               Found:
-                [android.content.Context context]
+                [android.content.Context]
               Expected:
-                [android.content.Context context, android.util.AttributeSet attrs]
+                [android.content.Context, android.util.AttributeSet]
           """.trimIndent())
         .`in`(inputView).onLine(11)
   }