Add notes for Error handling in Method.invoke and Constructor.newInstance

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Unresolved
    • Priority: P4
    • tbd
    • Affects Version/s: 24
    • Component/s: core-libs

      Method.invoke and Constructor.newInstance wrap Error instances from the calls into InvocationTargetException instances. If the Error is OutOfMemoryError or StackOverflowError, attempts to wrap the ITE into other exceptions may fail with secondary Error, which will hide the original Error.

      Changing the API to propagate any Error is out-of-spec, and is not considered.

      We should add notes in these 2 methods about the potential risks of swallowing errors.

            Assignee:
            Chen Liang
            Reporter:
            Chen Liang
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: