Add the constructor with the cause to AttachNotSupportedException

XMLWordPrintable

    • Type: CSR
    • Resolution: Unresolved
    • Priority: P4
    • 27
    • Component/s: hotspot
    • None
    • svc
    • source
    • minimal
    • Just adds a new constructor only. It is already available on `Exception` (parent class of `AttachNotSupportedException`.
    • Java API
    • SE

      Summary

      Add constructor which can be specified both the exception message and caused Throwable into com.sun.tools.attach.AttachNotSupportedException.

      Problem

      JDK-8373867 improves the logic to find tmp directory used for attach mechanism. It needs to fallback to find /tmp on the system even if the exception is thrown when Attach API attempt to access /proc/<PID>/root due to lack of permission. If fallback code failed with exception (e.g. lack of permission), it should be reported with root cause.

      For such situation, Exception has a constructor with exception message and the cause, but it is not implemented in AttachNotSupportedException.

      Solution

      Add new constructor to com.sun.tools.attach.AttachNotSupportedException to specify root cause.

      Specification

          /**
           * Constructs an <code>AttachNotSupportedException</code> with
           * the specified cause.
           *
           * @param   message the detail message.
           * @param   cause   the cause of this exception.
           */
          public AttachNotSupportedException(String message, Throwable cause)
      

            Assignee:
            Yasumasa Suenaga
            Reporter:
            Yasumasa Suenaga
            Chen Liang
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: