JDK 16 RFR of JDK-8250640: Address reliance on default constructors in jdk.jdi

Joe Darcy joe.darcy at oracle.com
Mon Jul 27 20:42:58 UTC 2020


Hello,

Another module, another set of default constructors to replace with 
explicit ones. Please review the code changes and CSR to address:

     JDK-8250640: Address reliance on default constructors in jdk.jdi
     webrev: http://cr.openjdk.java.net/~darcy/8250640.0/
     CSR: https://bugs.openjdk.java.net/browse/JDK-8250642

Patch below; I'll update copyrights before pushing. In the Bootstrap 
class, since it doesn't define any non-static methods, it looks like it 
doesn't need a constructor in its API at all so I terminally deprecated 
the constructor.

Thanks,

-Joe

--- old/src/jdk.jdi/share/classes/com/sun/jdi/Bootstrap.java 2020-07-27 
13:24:06.454000000 -0700
+++ new/src/jdk.jdi/share/classes/com/sun/jdi/Bootstrap.java 2020-07-27 
13:24:05.842000000 -0700
@@ -38,6 +38,11 @@
   */

  public class Bootstrap extends Object {
+    /**
+     * Do not call.
+     */
+    @Deprecated(since="16", forRemoval=true)
+    public Bootstrap() {}

      /**
       * Returns the virtual machine manager.
--- 
old/src/jdk.jdi/share/classes/com/sun/jdi/connect/spi/Connection.java 
2020-07-27 13:24:07.506000000 -0700
+++ 
new/src/jdk.jdi/share/classes/com/sun/jdi/connect/spi/Connection.java 
2020-07-27 13:24:06.878000000 -0700
@@ -55,6 +55,10 @@
   * @since 1.5
   */
  public abstract class Connection {
+    /**
+     * Constructor for subclasses to call.
+     */
+    public Connection() {}

      /**
       * Reads a packet from the target VM.
--- 
old/src/jdk.jdi/share/classes/com/sun/jdi/connect/spi/TransportService.java 
2020-07-27 13:24:08.570000000 -0700
+++ 
new/src/jdk.jdi/share/classes/com/sun/jdi/connect/spi/TransportService.java 
2020-07-27 13:24:07.934000000 -0700
@@ -79,6 +79,10 @@
   * @since 1.5
   */
  public abstract class TransportService {
+    /**
+     * Constructor for subclasses to call.
+     */
+    public TransportService() {}

      /**
       * Returns a name to identify the transport service.
@@ -98,6 +102,10 @@
       * The transport service capabilities.
       */
      public static abstract class Capabilities {
+    /**
+     * Constructor for subclasses to call.
+     */
+    public Capabilities() {}

          /**
           * Tells whether or not this transport service can support
@@ -229,6 +237,10 @@
       * service from listening on an address.
       */
      public static abstract class ListenKey {
+    /**
+     * Constructor for subclasses to call.
+     */
+    public ListenKey() {}

          /**
           * Returns a string representation of the listen key.



More information about the serviceability-dev mailing list