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

JDI: Method.variables() et.al. unspecified for abstract; dubious for native

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.4.0
    • 1.4.0
    • core-svc
    • None
    • beta
    • generic
    • generic
    • Not verified

      Method.variables()
      Method.variablesByName(String name)
      Method.arguments()

      All specify that they throw NativeMethodException for native methods.
      This is odd for four reasons:
        1) Some systems might be able to return argument info for natives.
        2) The exception doesn't provide any interesting information.
        3) It is hard to imagine that an application would want to handle
           NativeMethodException in this case differently than
           AbsentInformationException. And if it did it could call isNative().
        4) NativeMethodException is a RuntimeException.
      What about abstract methods? To be consistent there should be a new
      exception AbstractMethodException - to which all the same counter
      arguments would apply.

      I propose that NativeMethodException not be thrown for these methods
      and that the default implementation instead throw AbsentInformationException.
      With the following documentation:
      throws AbsentInformationException if there is no variable
      information for this method.
      Generally, local variable information is not available for
      native or abstract methods (that is, their argument name
      information is not available), thus they will throw this exception.
      robert.field@Eng 2000-04-11

            rfield Robert Field (Inactive)
            rfield Robert Field (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: