@@ -185,7 +185,7 @@ private void pluginElement(XNode parent) throws Exception {
185
185
for (XNode child : parent .getChildren ()) {
186
186
String interceptor = child .getStringAttribute ("interceptor" );
187
187
Properties properties = child .getChildrenAsProperties ();
188
- Interceptor interceptorInstance = (Interceptor ) resolveClass (interceptor ).newInstance ();
188
+ Interceptor interceptorInstance = (Interceptor ) resolveClass (interceptor ).getDeclaredConstructor (). newInstance ();
189
189
interceptorInstance .setProperties (properties );
190
190
configuration .addInterceptor (interceptorInstance );
191
191
}
@@ -196,7 +196,7 @@ private void objectFactoryElement(XNode context) throws Exception {
196
196
if (context != null ) {
197
197
String type = context .getStringAttribute ("type" );
198
198
Properties properties = context .getChildrenAsProperties ();
199
- ObjectFactory factory = (ObjectFactory ) resolveClass (type ).newInstance ();
199
+ ObjectFactory factory = (ObjectFactory ) resolveClass (type ).getDeclaredConstructor (). newInstance ();
200
200
factory .setProperties (properties );
201
201
configuration .setObjectFactory (factory );
202
202
}
@@ -205,15 +205,15 @@ private void objectFactoryElement(XNode context) throws Exception {
205
205
private void objectWrapperFactoryElement (XNode context ) throws Exception {
206
206
if (context != null ) {
207
207
String type = context .getStringAttribute ("type" );
208
- ObjectWrapperFactory factory = (ObjectWrapperFactory ) resolveClass (type ).newInstance ();
208
+ ObjectWrapperFactory factory = (ObjectWrapperFactory ) resolveClass (type ).getDeclaredConstructor (). newInstance ();
209
209
configuration .setObjectWrapperFactory (factory );
210
210
}
211
211
}
212
212
213
213
private void reflectorFactoryElement (XNode context ) throws Exception {
214
214
if (context != null ) {
215
215
String type = context .getStringAttribute ("type" );
216
- ReflectorFactory factory = (ReflectorFactory ) resolveClass (type ).newInstance ();
216
+ ReflectorFactory factory = (ReflectorFactory ) resolveClass (type ).getDeclaredConstructor (). newInstance ();
217
217
configuration .setReflectorFactory (factory );
218
218
}
219
219
}
@@ -298,7 +298,7 @@ private void databaseIdProviderElement(XNode context) throws Exception {
298
298
type = "DB_VENDOR" ;
299
299
}
300
300
Properties properties = context .getChildrenAsProperties ();
301
- databaseIdProvider = (DatabaseIdProvider ) resolveClass (type ).newInstance ();
301
+ databaseIdProvider = (DatabaseIdProvider ) resolveClass (type ).getDeclaredConstructor (). newInstance ();
302
302
databaseIdProvider .setProperties (properties );
303
303
}
304
304
Environment environment = configuration .getEnvironment ();
@@ -312,7 +312,7 @@ private TransactionFactory transactionManagerElement(XNode context) throws Excep
312
312
if (context != null ) {
313
313
String type = context .getStringAttribute ("type" );
314
314
Properties props = context .getChildrenAsProperties ();
315
- TransactionFactory factory = (TransactionFactory ) resolveClass (type ).newInstance ();
315
+ TransactionFactory factory = (TransactionFactory ) resolveClass (type ).getDeclaredConstructor (). newInstance ();
316
316
factory .setProperties (props );
317
317
return factory ;
318
318
}
@@ -323,7 +323,7 @@ private DataSourceFactory dataSourceElement(XNode context) throws Exception {
323
323
if (context != null ) {
324
324
String type = context .getStringAttribute ("type" );
325
325
Properties props = context .getChildrenAsProperties ();
326
- DataSourceFactory factory = (DataSourceFactory ) resolveClass (type ).newInstance ();
326
+ DataSourceFactory factory = (DataSourceFactory ) resolveClass (type ).getDeclaredConstructor (). newInstance ();
327
327
factory .setProperties (props );
328
328
return factory ;
329
329
}
0 commit comments