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

when 'factoryId' is null newInstance throws NPE

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P3 P3
    • 1.4.2
    • 1.4.2
    • xml
    • generic
    • generic

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

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: