Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8250800

Address reliance on default constructors in java.xml

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P4
    • Resolution: Approved
    • Fix Version/s: 16
    • Component/s: xml
    • Labels:
      None
    • Subcomponent:
    • Compatibility Risk:
      minimal
    • Compatibility Risk Description:
      Explicit constructors are equivalent to the previous implicit ones.
    • Interface Kind:
      Java API
    • Scope:
      SE

      Description

      Summary

      Add explicit constructors to two classes in java.xml using default constructors.

      Problem

      Missing default constructors in org.xml.sax.HandlerBase and org.xml.sax.helpers/DefaultHandler.

      Solution

      Add explicit default constructors to the two classes.

      Specification

      --- a/src/java.xml/share/classes/org/xml/sax/HandlerBase.java
      +++ b/src/java.xml/share/classes/org/xml/sax/HandlerBase.java
      @@ -58,7 +58,10 @@
       public class HandlerBase
           implements EntityResolver, DTDHandler, DocumentHandler, ErrorHandler
       {
      -
      +    /**
      +     * Constructs a {@code HandlerBase}.
      +     */
      +    public HandlerBase() {}
      
           ////////////////////////////////////////////////////////////////////
           // Default implementation of the EntityResolver interface.
      
      --- a/src/java.xml/share/classes/org/xml/sax/helpers/DefaultHandler.java
      +++ b/src/java.xml/share/classes/org/xml/sax/helpers/DefaultHandler.java
      @@ -1,5 +1,5 @@
       /*
      - * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
      + * Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
        * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
        *
        * This code is free software; you can redistribute it and/or modify it
      @@ -70,7 +70,10 @@
       public class DefaultHandler
           implements EntityResolver, DTDHandler, ContentHandler, ErrorHandler
       {
      -
      +    /**
      +     * Constructs a {@code DefaultHandler}.
      +     */
      +    public DefaultHandler() {}
      
           ////////////////////////////////////////////////////////////////////
           // Default implementation of the EntityResolver interface.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                joehw Joe Wang
                Reporter:
                darcy Joe Darcy
                Reviewed By:
                Joe Darcy, Lance Andersen
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: