CAccessibility roleKey and AWTAccessor.AccessibleBundleAccessor are Redundant

XMLWordPrintable

    • Type: Task
    • Resolution: Unresolved
    • Priority: P4
    • tbd
    • Affects Version/s: 26, 27
    • Component/s: client-libs

      This is a minor maintenance task: CAccessibility.java appears to access the `AccessibleRole.key` field in two different ways.

      In JavaAccessibilityUtilities we define the method `roleKey` as:

      /*
       * Class: sun_lwawt_macosx_CAccessibility
       * Method: roleKey
       * Signature: (Ljavax/accessibility/AccessibleRole;)Ljava/lang/String;
       */
      JNIEXPORT jstring JNICALL Java_sun_lwawt_macosx_CAccessibility_roleKey
      (JNIEnv *env, jclass clz, jobject axRole)
      {
          DECLARE_CLASS_RETURN(sjc_AccessibleRole, "javax/accessibility/AccessibleRole", NULL);
          DECLARE_FIELD_RETURN(sjf_key, sjc_AccessibleRole, "key", "Ljava/lang/String;", NULL);
          return (*env)->GetObjectField(env, axRole, sjf_key);
      }

      And in AWTAccessor the `getAccessibleBundleAccessor` is defined as:

          static {
              AWTAccessor.setAccessibleBundleAccessor(
                      new AWTAccessor.AccessibleBundleAccessor() {

                          @Override
                          public String getKey(AccessibleBundle accessibleBundle) {
                              return accessibleBundle.key;
                          }
                      });
          }

      These look redundant to me; I suggest one of them be removed.

            Assignee:
            Jeremy Wood
            Reporter:
            Jeremy Wood
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: