src/java.xml/share/classes/com/sun/org/apache/xalan/internal/utils/ObjectFactory.java
changeset 47359 e1a6c0168741
parent 47312 d4f959806fe9
child 48409 5ab69533994b
equal deleted inserted replaced
47358:d07d5f7cab35 47359:e1a6c0168741
     1 /*
     1 /*
     2  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
     3  * @LastModified: Sep 2017
     3  * @LastModified: Oct 2017
     4  */
     4  */
     5 /*
     5 /*
     6  * Licensed to the Apache Software Foundation (ASF) under one or more
     6  * Licensed to the Apache Software Foundation (ASF) under one or more
     7  * contributor license agreements.  See the NOTICE file distributed with
     7  * contributor license agreements.  See the NOTICE file distributed with
     8  * this work for additional information regarding copyright ownership.
     8  * this work for additional information regarding copyright ownership.
   122     public static Object newInstance(String className, boolean doFallback)
   122     public static Object newInstance(String className, boolean doFallback)
   123         throws ConfigurationError
   123         throws ConfigurationError
   124     {
   124     {
   125         ClassLoader cl = System.getSecurityManager()!=null ? null : findClassLoader();
   125         ClassLoader cl = System.getSecurityManager()!=null ? null : findClassLoader();
   126         try{
   126         try{
   127             Class providerClass = findProviderClass(className, cl, doFallback);
   127             Class<?> providerClass = findProviderClass(className, cl, doFallback);
   128             Object instance = providerClass.getConstructor().newInstance();
   128             Object instance = providerClass.getConstructor().newInstance();
   129             debugPrintln(()->"created new instance of " + providerClass +
   129             debugPrintln(()->"created new instance of " + providerClass +
   130                              " using ClassLoader: " + cl);
   130                              " using ClassLoader: " + cl);
   131             return instance;
   131             return instance;
   132         } catch (ClassNotFoundException x) {
   132         } catch (ClassNotFoundException x) {