src/java.xml/share/classes/com/sun/org/apache/xalan/internal/utils/ObjectFactory.java
equal
deleted
inserted
replaced
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) { |