Update names used for androidx keep annotations

Mainly replace Class with Type in places where not only reference types
can be used.

Bug: b/392865072
Change-Id: Iac46b30560c20bbb70f748370b480c70c8e1fc89
diff --git a/src/keepanno/java/androidx/annotation/keep/UsesReflectionToAccessField.kt b/src/keepanno/java/androidx/annotation/keep/UsesReflectionToAccessField.kt
index d80fb81..b02671c 100644
--- a/src/keepanno/java/androidx/annotation/keep/UsesReflectionToAccessField.kt
+++ b/src/keepanno/java/androidx/annotation/keep/UsesReflectionToAccessField.kt
@@ -54,30 +54,30 @@
     val classConstant: KClass<*> = Unspecified::class,
 
     /**
-     * Class name (or pattern) containing the field accessed by reflection.
+     * Class name (or class name pattern) containing the field accessed by reflection.
      *
      * Mutually exclusive with [classConstant].
      */
     val className: String = "",
 
-    /** Field name (or pattern) accessed by reflection. */
+    /** Name (or name pattern) of field accessed by reflection. */
     val fieldName: String,
 
     /**
-     * Class of field accessed by reflection.
+     * Type of field accessed by reflection.
      *
      * Ignored if not specified.
      *
-     * Mutually exclusive with [fieldClassName].
+     * Mutually exclusive with [fieldTypeName].
      */
-    val fieldClass: KClass<*> = Unspecified::class,
+    val fieldType: KClass<*> = Unspecified::class,
 
     /**
-     * Class (or class pattern) of field accessed by reflection.
+     * Type (or type pattern) of field accessed by reflection.
      *
      * Ignored if not specified.
      *
-     * Mutually exclusive with [fieldClass].
+     * Mutually exclusive with [fieldType].
      */
-    val fieldClassName: String = "",
+    val fieldTypeName: String = "",
 )
diff --git a/src/keepanno/java/androidx/annotation/keep/UsesReflectionToAccessMethod.kt b/src/keepanno/java/androidx/annotation/keep/UsesReflectionToAccessMethod.kt
index ad67456..60b4e71 100644
--- a/src/keepanno/java/androidx/annotation/keep/UsesReflectionToAccessMethod.kt
+++ b/src/keepanno/java/androidx/annotation/keep/UsesReflectionToAccessMethod.kt
@@ -54,50 +54,50 @@
     val classConstant: KClass<*> = Unspecified::class,
 
     /**
-     * Class name (or pattern) containing the method accessed by reflection.
+     * Class name (or class name pattern) containing the method accessed by reflection.
      *
      * Mutually exclusive with [classConstant].
      */
     val className: String = "",
 
-    /** Method name (or pattern) accessed by reflection. */
+    /** Name (or name pattern) of method accessed by reflection. */
     val methodName: String,
 
     /**
      * Defines which method to keep by specifying set of parameter classes passed.
      *
-     * If neither `param` nor `paramClassNames` is specified then methods with all parameter lists
+     * If neither `param` nor `paramTypeNames` is specified then methods with all parameter lists
      * are kept.
      *
-     * Mutually exclusive with [paramClassNames].
+     * Mutually exclusive with [paramTypeNames].
      */
     val params: Array<KClass<*>> = [Unspecified::class],
 
     /**
      * Defines which method to keep by specifying set of parameter classes passed.
      *
-     * If neither `param` nor `paramClassNames` is specified then methods with all parameter lists
+     * If neither `param` nor `paramTypeNames` is specified then methods with all parameter lists
      * are kept.
      *
      * Mutually exclusive with [params].
      */
-    val paramClassNames: Array<String> = [""],
+    val paramTypeNames: Array<String> = [""],
 
     /**
      * Return type of the method accessed by reflection.
      *
      * Ignored if not specified.
      *
-     * Mutually exclusive with [returnClassName].
+     * Mutually exclusive with [returnTypeName].
      */
-    val returnClass: KClass<*> = Unspecified::class,
+    val returnType: KClass<*> = Unspecified::class,
 
     /**
      * Return type (or type pattern) of the method accessed by reflection.
      *
      * Ignored if not specified.
      *
-     * Mutually exclusive with [returnClass].
+     * Mutually exclusive with [returnType].
      */
-    val returnClassName: String = "",
+    val returnTypeName: String = "",
 )
diff --git a/src/keepanno/java/androidx/annotation/keep/UsesReflectionToConstruct.kt b/src/keepanno/java/androidx/annotation/keep/UsesReflectionToConstruct.kt
index 0741c2f..75f4d07 100644
--- a/src/keepanno/java/androidx/annotation/keep/UsesReflectionToConstruct.kt
+++ b/src/keepanno/java/androidx/annotation/keep/UsesReflectionToConstruct.kt
@@ -66,20 +66,20 @@
     /**
      * Defines which constructor to keep by specifying the parameter list types.
      *
-     * If neither `param` nor `paramClassNames` is specified then constructors with all parameter
+     * If neither `param` nor `paramTypeNames` is specified then constructors with all parameter
      * lists are kept.
      *
-     * Mutually exclusive with [paramClassNames].
+     * Mutually exclusive with [paramTypeNames].
      */
     val params: Array<KClass<*>> = [Unspecified::class],
 
     /**
      * Defines which constructor to keep by specifying the parameter list types.
      *
-     * If neither `param` nor `paramClassNames` is specified then constructors with all parameter
+     * If neither `param` nor `paramTypeNames` is specified then constructors with all parameter
      * lists are kept.
      *
      * Mutually exclusive with [params].
      */
-    val paramClassNames: Array<String> = [""],
+    val paramTypeNames: Array<String> = [""],
 )
diff --git a/src/keepanno/java/com/android/tools/r8/keepanno/asm/KeepEdgeReader.java b/src/keepanno/java/com/android/tools/r8/keepanno/asm/KeepEdgeReader.java
index 919adbf..d251880 100644
--- a/src/keepanno/java/com/android/tools/r8/keepanno/asm/KeepEdgeReader.java
+++ b/src/keepanno/java/com/android/tools/r8/keepanno/asm/KeepEdgeReader.java
@@ -1548,7 +1548,7 @@
         return new ParametersClassVisitor(
             propertyParsingContext, parameters -> this.parameters = parameters);
       }
-      if (name.equals(UsesReflectionToConstruct.paramClassNames)) {
+      if (name.equals(UsesReflectionToConstruct.paramTypeNames)) {
         return new ParametersClassNamesVisitor(
             propertyParsingContext, parameters -> this.parameters = parameters);
       }
diff --git a/src/keepanno/java/com/android/tools/r8/keepanno/ast/AnnotationConstants.java b/src/keepanno/java/com/android/tools/r8/keepanno/ast/AnnotationConstants.java
index 59bd281..73077b7 100644
--- a/src/keepanno/java/com/android/tools/r8/keepanno/ast/AnnotationConstants.java
+++ b/src/keepanno/java/com/android/tools/r8/keepanno/ast/AnnotationConstants.java
@@ -155,7 +155,7 @@
     public static final String className = "className";
     public static final String constructorParametersGroup = "constructor-parameters";
     public static final String params = "params";
-    public static final String paramClassNames = "paramClassNames";
+    public static final String paramTypeNames = "paramTypeNames";
   }
 
   public static final class UsesReflectionToAccessMethod {
@@ -181,9 +181,13 @@
     public static final String classSelectionGroup = "class-selection";
     public static final String classConstant = "classConstant";
     public static final String className = "className";
+    public static final String methodName = "methodName";
     public static final String constructorParametersGroup = "constructor-parameters";
     public static final String params = "params";
-    public static final String paramClassNames = "paramClassNames";
+    public static final String paramTypeNames = "paramTypeNames";
+    public static final String returnSelectionGroup = "return-selection";
+    public static final String returnType = "returnType";
+    public static final String returnTypeName = "returnTypeName";
   }
 
   public static final class UsesReflectionToAccessField {
@@ -209,9 +213,10 @@
     public static final String classSelectionGroup = "class-selection";
     public static final String classConstant = "classConstant";
     public static final String className = "className";
-    public static final String constructorParametersGroup = "constructor-parameters";
-    public static final String params = "params";
-    public static final String paramClassNames = "paramClassNames";
+    public static final String fieldName = "fieldName";
+    public static final String fieldTypeSelectionGroup = "field-type-selection";
+    public static final String fieldType = "fieldType";
+    public static final String fieldTypeName = "fieldTypeName";
   }
 
   /** Item properties common to binding items, conditions and targets. */
diff --git a/src/test/java/com/android/tools/r8/keepanno/utils/KeepItemAnnotationGenerator.java b/src/test/java/com/android/tools/r8/keepanno/utils/KeepItemAnnotationGenerator.java
index 17ab6c3..3ff6678 100644
--- a/src/test/java/com/android/tools/r8/keepanno/utils/KeepItemAnnotationGenerator.java
+++ b/src/test/java/com/android/tools/r8/keepanno/utils/KeepItemAnnotationGenerator.java
@@ -1860,24 +1860,24 @@
     }
 
     private Group createAndroidXParameterSelection(
-        Consumer<GroupMember> paramsConsumer, Consumer<GroupMember> paramClassNamesConsumer) {
+        Consumer<GroupMember> paramsConsumer, Consumer<GroupMember> paramTypeNamesConsumer) {
       GroupMember params = new GroupMember("params").defaultUnspecifiedArray();
       paramsConsumer.accept(params);
-      GroupMember paramClassNames =
-          new GroupMember("paramClassNames")
+      GroupMember paramTypeNames =
+          new GroupMember("paramTypeNames")
               .defaultArrayValue(Reference.classFromClass(String.class), "\"\"");
-      paramClassNamesConsumer.accept(paramClassNames);
+      paramTypeNamesConsumer.accept(paramTypeNames);
       return new Group("constructor-parameters")
           .forAndroidX()
           .addMember(params)
-          .addMember(paramClassNames);
+          .addMember(paramTypeNames);
     }
 
     private Group createMethodNameSelection() {
       return new Group("method-name")
           .addMember(
               new GroupMember("methodName")
-                  .setDocTitle("Method name (or pattern) accessed by reflection.")
+                  .setDocTitle("Name (or name pattern) of method accessed by reflection.")
                   .requiredStringValue());
     }
 
@@ -1885,14 +1885,14 @@
       return new Group("return-selection")
           .forAndroidX()
           .addMember(
-              new GroupMember("returnClass")
+              new GroupMember("returnType")
                   .setDocTitle("Return type of the method accessed by reflection.")
                   .addSection("Ignored if not specified.")
                   .defaultUnspecifiedClass())
           .addMember(
-              new GroupMember("returnClassName")
+              new GroupMember("returnTypeName")
                   .setDocTitle(
-                      "Return type (or type pattern) of the method accessed by" + " reflection.")
+                      "Return type (or type pattern) of the method accessed by reflection.")
                   .addSection("Ignored if not specified.")
                   .defaultEmptyString());
     }
@@ -1901,7 +1901,7 @@
       return new Group("field-name")
           .addMember(
               new GroupMember("fieldName")
-                  .setDocTitle("Field name (or pattern) accessed by reflection.")
+                  .setDocTitle("Name (or name pattern) of field accessed by reflection.")
                   .requiredStringValue());
     }
 
@@ -1909,13 +1909,13 @@
       return new Group("field-type-selection")
           .forAndroidX()
           .addMember(
-              new GroupMember("fieldClass")
-                  .setDocTitle("Class of field accessed by reflection.")
+              new GroupMember("fieldType")
+                  .setDocTitle("Type of field accessed by reflection.")
                   .addSection("Ignored if not specified.")
                   .defaultUnspecifiedClass())
           .addMember(
-              new GroupMember("fieldClassName")
-                  .setDocTitle("Class (or class pattern) of field accessed by reflection.")
+              new GroupMember("fieldTypeName")
+                  .setDocTitle("Type (or type pattern) of field accessed by reflection.")
                   .addSection("Ignored if not specified.")
                   .defaultEmptyString());
     }
@@ -1958,14 +1958,14 @@
                                 "Defines which constructor to keep by specifying the parameter list"
                                     + " types.")
                             .addSection(
-                                "If neither `param` nor `paramClassNames` is specified then"
+                                "If neither `param` nor `paramTypeNames` is specified then"
                                     + " constructors with all parameter lists are kept."),
                     g ->
                         g.setDocTitle(
                                 "Defines which constructor to keep by specifying the parameter list"
                                     + " types.")
                             .addSection(
-                                "If neither `param` nor `paramClassNames` is specified then"
+                                "If neither `param` nor `paramTypeNames` is specified then"
                                     + " constructors with all parameter lists are kept."))
                 .generate(this);
           });
@@ -2000,7 +2000,7 @@
                     g -> g.setDocTitle("Class containing the method accessed by reflection."),
                     g ->
                         g.setDocTitle(
-                            "Class name (or pattern) containing the method accessed by"
+                            "Class name (or class name pattern) containing the method accessed by"
                                 + " reflection."))
                 .generate(this);
             println();
@@ -2012,14 +2012,14 @@
                                 "Defines which method to keep by specifying set of parameter"
                                     + " classes passed.")
                             .addSection(
-                                "If neither `param` nor `paramClassNames` is specified then"
+                                "If neither `param` nor `paramTypeNames` is specified then"
                                     + " methods with all parameter lists are kept."),
                     g ->
                         g.setDocTitle(
                                 "Defines which method to keep by specifying set of parameter"
                                     + " classes passed.")
                             .addSection(
-                                "If neither `param` nor `paramClassNames` is specified then"
+                                "If neither `param` nor `paramTypeNames` is specified then"
                                     + " methods with all parameter lists are kept."))
                 .generate(this);
             println();
@@ -2054,7 +2054,7 @@
                     g -> g.setDocTitle("Class containing the field accessed by reflection."),
                     g ->
                         g.setDocTitle(
-                            "Class name (or pattern) containing the field accessed by"
+                            "Class name (or class name pattern) containing the field accessed by"
                                 + " reflection."))
                 .generate(this);
             println();
@@ -2414,7 +2414,7 @@
       withIndent(
           () -> {
             generateAnnotationConstants(USES_REFLECTION_TO_ACCESS_METHOD);
-            forEachUsesReflectionToConstructGroup(g -> g.generateConstants(this));
+            forEachUsesReflectionToAccessMethodGroup(g -> g.generateConstants(this));
           });
       println("}");
       println();
@@ -2425,7 +2425,7 @@
       withIndent(
           () -> {
             generateAnnotationConstants(USES_REFLECTION_TO_ACCESS_FIELD);
-            forEachUsesReflectionToConstructGroup(g -> g.generateConstants(this));
+            forEachUsesReflectionToAccessFieldGroup(g -> g.generateConstants(this));
           });
       println("}");
       println();