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

Spec: javax.xml.stream.XMLEventFactory/XMLOutputFactory/XMLInputFactory.newFactory(String, ClassLoader) referring to ServiceLoader.load(Class, ClassLoader)

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: 8
    • Fix Version/s: 8u20
    • Component/s: xml
    • Subcomponent:
    • Resolved In Build:
      b01
    • Verification:
      Not verified

      Backports

        Description

        Let's consider XMLEventFactory.newFactory(String factoryId, ClassLoader classLoader) spec excerpt:

           * If {@code factoryId} is "javax.xml.stream.XMLEventFactory",
           * use the service-provider loading facilities, defined by the
           * {@link java.util.ServiceLoader} class, to attempt to locate and load an
           * implementation of the service using the specified {@code ClassLoader}.
           * If {@code classLoader} is null, the {@linkplain
           * java.util.ServiceLoader#load(java.lang.Class) default loading mechanism} will apply:

        Above excerpt refers to java.util.ServiceLoader#load(java.lang.Class) method for null classLoader case.

        Similarly java.util.ServiceLoader#load(java.lang.Class, ClassLoader) should be referred for the case of non null classLoader; for instance like it's presented below:

           * If {@code factoryId} is "javax.xml.stream.XMLEventFactory",
           * use the service-provider loading facilities, defined by the
           * {@link java.util.ServiceLoader} class, to attempt to {@linkplain java.util.ServiceLoader#load(java.lang.Class, java.lang.ClassLoader) locate and load} an
           * implementation of the service using the specified {@code ClassLoader}.

        The similar change should be applied:
        to XMLInputFactory.newFactory(String factoryId, ClassLoader classLoader)
        and to XMLOutputFactory.newFactory(String factoryId, ClassLoader classLoader).

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  joehw Joe Wang
                  Reporter:
                  grakov Georgiy Rakov (Inactive)
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  5 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: