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

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P2
    • 8u20
    • Affects Version/s: 8
    • Component/s: 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).

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

                Created:
                Updated:
                Resolved: