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

Add XPathFactoryImpl setProperty and getProperty methods

    XMLWordPrintable

Details

    • CSR
    • Resolution: Withdrawn
    • P4
    • 13-pool, 15-pool
    • xml
    • None
    • source, behavioral
    • minimal
    • None. Adding new methods to the XPathFactoryImpl class changes no existing behaviour.
    • Java API
    • JDK

    Description

      Summary

      Add XPathFactoryImpl setProperty and getProperty methods.

      Problem

      In Java 18, refer to JDK-8276143, the setProperty and getProperty methods have been added to the XPathFactory. The implementation portion of the change needs to be backported since the functionality was a part of a larger JDK change for JDK 17 and earlier.

      Solution

      For JDK 17 and earlier, backport the implementation of the XPathFactory setProperty and getProperty methods, adding them to the JDK XPathFactory implementation class: XPathFactoryImpl. The public API change will not be backported.

      Applications may call the new methods by checking whether the underlying implementation is the JDK default:

      Option 1: create the XPathFactory by calling the newDefaultInstance methods for JDK 9 and later;

      Option 2: check the underlying implementation, e.g. if (xpathFactory instanceof XPathFactoryImpl).

         XPathFactory xf = XPathFactory.newInstance();
      if (xf instanceof XPathFactoryImpl) {
          XPathFactoryImpl xfJDK = (XPathFactoryImpl)xf;
          xpJDK.setProperty(property, value);
      } else {
          return;
      }

      Specification

      The impl changes only were backported to Update Releases. No spec changes

      Attachments

        Issue Links

          Activity

            People

              yan Yuri Nesterenko
              joehw Joe Wang
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: