Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4262625

accessibility.AccessibleRelation.getTarget() throws NPE

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Duplicate
    • Affects Version/s: 1.3.0
    • Fix Version/s: None
    • Component/s: client-libs
    • Labels:
      None

      Description



      Name: asC58863 Date: 08/16/99


      javax.swing.accessibility.AccessibleRelation.getTarget() throws unexpected
      NullPointerException.

      JavaDoc says :
      "public Object[] getTarget()

           Returns the target objects for this relation
           Returns:
               an array containing the target objects for this relation
      "

      According to the shown JavaDoc comments I guess this method should
      return an empty array.

      Here is the example demonstrating the bug:
      ------------------ Test.java -----------------
      import javax.accessibility.AccessibleRelation;

      public class Test {

          public static void main(String[] argv) {
              AccessibleRelation c = new WrapAccessibleRelation("Test");

              try {
                  Object res[] = c.getTarget();
                  System.out.println(" OKAY ");
              } catch (NullPointerException npe) {
                  System.out.println(" NPE has been thrown");
              }
              System.exit(0);
          }
      }

      class WrapAccessibleRelation extends AccessibleRelation {

          public WrapAccessibleRelation(String key) {
              super(key);
          }
      }
      -------------- Output from the test -----------------
       NPE has been thrown
      ------------------------------------------------------

      ======================================================================

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              anssunw Ans Ans (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: