Revert the constructor with the cause from AttachNotSupportedException, and add it to AttachOperationFailedException

XMLWordPrintable

    • Type: CSR
    • Resolution: Unresolved
    • Priority: P4
    • 27
    • Component/s: hotspot
    • None
    • svc
    • source
    • low
    • Add a new constructor, and remove a constructor which has not been GA'ed yet.
    • Java API
    • JDK

      Summary

      Revert (Remove) constructor with the cause from AttachNotSupportedException introduced in JDK-8373867, and add it to AttachOperationFailedException.

      Problem

      In review thread on GitHub[1] for JDK-8373867, we reached conclusion we should use AttachOperationFailedException rather than AttachNotSupportedException because AttachNotSupportedException would be thrown when a compatible AttachProvider does not exist.

      [1] https://github.com/openjdk/jdk/pull/28867

      Solution

      Revert the change for AttachNotSupportedException made by JDK-8373867, and add a new constructor with the cause to AttachOperationFailedException.

      Specification

      diff --git a/src/jdk.attach/share/classes/com/sun/tools/attach/AttachNotSupportedException.java b/src/jdk.attach/share/classes/com/sun/tools/attach/AttachNotSupportedException.java
      index 725db3e7732..050c1030bf6 100644
      --- a/src/jdk.attach/share/classes/com/sun/tools/attach/AttachNotSupportedException.java
      +++ b/src/jdk.attach/share/classes/com/sun/tools/attach/AttachNotSupportedException.java
      @@ -62,17 +62,4 @@ public AttachNotSupportedException(String s) {
               super(s);
           }
      
      -    /**
      -     * Constructs an <code>AttachNotSupportedException</code> with
      -     * the specified cause.
      -     *
      -     * @param   message the detail message.
      -     * @param   cause   the cause of this exception.
      -     *
      -     * @since 27
      -     */
      
      diff --git a/src/jdk.attach/share/classes/com/sun/tools/attach/AttachOperationFailedException.java b/src/jdk.attach/share/classes/com/sun/tools/attach/AttachOperationFailedException.java
      index cbc4410907c..3f26c02c304 100644
      --- a/src/jdk.attach/share/classes/com/sun/tools/attach/AttachOperationFailedException.java
      +++ b/src/jdk.attach/share/classes/com/sun/tools/attach/AttachOperationFailedException.java
      @@ -50,4 +50,18 @@ public class AttachOperationFailedException extends IOException {
           public AttachOperationFailedException(String message) {
               super(message);
           }
      +
      +    /**
      +     * Constructs an <code>AttachOperationFailedException</code> with
      +     * the specified cause.
      +     *
      +     * @param   message the detail message.
      +     * @param   cause   the cause of this exception.
      +     *
      +     * @since 27
      +     */
      

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

              Created:
              Updated: