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

when 'factoryId' is null newInstance throws NPE

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Won't Fix
    • Affects Version/s: 1.4.2
    • Fix Version/s: 1.4.2
    • Component/s: xml
    • Labels:
    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description

      when 'factoryId' is null newInstance throws NPE

      In StAX javadocs
      -----------------
      I think javadoc should be updated to include this case also -
       i.e, NullPointerException - when factoryId is null

      or should this be throwing 'FactoryConfigurationError' ? as this is the same case as
      "instance of factory cannot be loaded"

      This applies for all the 3 StAX factory classes !

      ------------------------------------------------------------------------------------------
      newInstance

      public static XMLEventFactory newInstance(java.lang.String factoryId,
                                                java.lang.ClassLoader classLoader)
                                         throws FactoryConfigurationError

          Create a new instance of the factory

          Parameters:
              factoryId - Name of the factory to find, same as a property name
              classLoader - classLoader to use
          Returns:
              the factory implementation
          Throws:
              FactoryConfigurationError - if an instance of this factory cannot be loaded
      ------------------------------------------------------------------------------------------

        Attachments

          Activity

            People

            Assignee:
            nbajajsunw Neeraj Bajaj (Inactive)
            Reporter:
            saksunw Sreejith Ak (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: