Uploaded image for project: 'Commons Lang'
  1. Commons Lang
  2. LANG-1228

IllegalAccessException swallowed in indexOfThrowable and indexOfType

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.5
    • Component/s: None
    • Labels:
      None

      Description

      If ExceptionUtils.getCause is provided a throwable whose cause method cannot be interrogated by reflection due to an IllegalAccessError, the cause is not presented to the client.

      In principle this is to be expected from this legacy method. However, indexOfThrowable and indexOfType rely on getCause, and are not marked as deprecated.

      Now that Throwable.getCause has been in the language for quite some time, I'd like to propose that, until ExceptionUtils.getCause is actually removed, that its behavior be modified to first attempt to get the exception cause using normal invocation, falling back to reflection if no cause is found.

      I'll be pushing a GitHub PR to this effect.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                pascalschumacher Pascal Schumacher
                Reporter:
                bdhess Bradley Hess
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: