JSR 292 reflective lookup should throw checked exceptions

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 7
    • Affects Version/s: 7
    • Component/s: core-libs
    • b109
    • generic
    • generic
    • Not verified

      JSR 292 contains a set of reflective methods for producing method handles to access fields and methods of loaded classes. The methods are found on java.dyn.MethodHandles.Lookup.

      When any of these methods fails, it throws a java.dyn.NoAccessException. In the JSR 292 EDR, this is an unchecked exception, which makes the demos work nicer, but is not consistent with other reflective operations in Java.

      In fact, java.dyn.NoAccessException should extend java.lang.ReflectiveOperationException, like the other exceptions thrown by reflective operations. This will make it a checked exception.

            Assignee:
            John Rose
            Reporter:
            John Rose
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: