ClassLoader loader = classLoader; if (loader == null) { loader = Thread.currentThread().getContextClassLoader(); } if (loader == null) { loader = XMLInputFactory.class.getClassLoader(); } String className = null; int count = 0; do { className = getFactoryClassName(loader, count++); if (className != null) { try { Class t = (loader != null) ? loader.loadClass(className) : Class.forName(className); return (XMLInputFactory) t.newInstance(); } catch (ClassNotFoundException e) { className = null; } catch (Exception e) { throw new FactoryConfigurationError(e, "error instantiating class " + className); } } } while (className == null && count < 3); return new gnu.xml.stream.XMLInputFactoryImpl();
return newInstance(null, null);
  public static XMLInputFactory newInstance(String factoryId,                                            ClassLoader classLoader)    throws FactoryConfigurationError  {    ClassLoader loader = classLoader;    if (loader == null)      {        loader = Thread.currentThread().getContextClassLoader();      }    if (loader == null)      {        loader = XMLInputFactory.class.getClassLoader();      }    String className = null;    int count = 0;    do      {        className = getFactoryClassName(loader, count++);        if (className != null)          {            try              {                Class t = (loader != null) ? loader.loadClass(className) :                  Class.forName(className);                return (XMLInputFactory) t.newInstance();              }            catch (ClassNotFoundException e)              {                className = null;              }            catch (Exception e)              {                throw new FactoryConfigurationError(e,                     "error instantiating class " + className);              }          }      }    while (className == null && count < 3);    return new gnu.xml.stream.XMLInputFactoryImpl();  }