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
+ */
- csr of
-
JDK-8376052 Use AttachOperationFailedException rather than AttachNotSupportedException in findTargetProcessTmpDirectory()
-
- New
-
- relates to
-
JDK-8375582 Add the constructor with the cause to AttachNotSupportedException
-
- Closed
-