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)

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P2 P2
    • 8u20
    • 8
    • xml
    • b01
    • Not verified

        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).

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

                Created:
                Updated:
                Resolved: