@@ -116,19 +116,19 @@ private void parseConfiguration(XNode root) {
116
116
// issue #117 read properties first
117
117
propertiesElement (root .evalNode ("properties" ));
118
118
Properties settings = settingsAsProperties (root .evalNode ("settings" ));
119
- loadCustomVfs (settings );
119
+ loadCustomVfsImpl (settings );
120
120
loadCustomLogImpl (settings );
121
121
typeAliasesElement (root .evalNode ("typeAliases" ));
122
- pluginElement (root .evalNode ("plugins" ));
122
+ pluginsElement (root .evalNode ("plugins" ));
123
123
objectFactoryElement (root .evalNode ("objectFactory" ));
124
124
objectWrapperFactoryElement (root .evalNode ("objectWrapperFactory" ));
125
125
reflectorFactoryElement (root .evalNode ("reflectorFactory" ));
126
126
settingsElement (settings );
127
127
// read it after objectFactory and objectWrapperFactory issue #631
128
128
environmentsElement (root .evalNode ("environments" ));
129
129
databaseIdProviderElement (root .evalNode ("databaseIdProvider" ));
130
- typeHandlerElement (root .evalNode ("typeHandlers" ));
131
- mapperElement (root .evalNode ("mappers" ));
130
+ typeHandlersElement (root .evalNode ("typeHandlers" ));
131
+ mappersElement (root .evalNode ("mappers" ));
132
132
} catch (Exception e ) {
133
133
throw new BuilderException ("Error parsing SQL Mapper Configuration. Cause: " + e , e );
134
134
}
@@ -150,7 +150,7 @@ private Properties settingsAsProperties(XNode context) {
150
150
return props ;
151
151
}
152
152
153
- private void loadCustomVfs (Properties props ) throws ClassNotFoundException {
153
+ private void loadCustomVfsImpl (Properties props ) throws ClassNotFoundException {
154
154
String value = props .getProperty ("vfsImpl" );
155
155
if (value == null ) {
156
156
return ;
@@ -195,7 +195,7 @@ private void typeAliasesElement(XNode context) {
195
195
}
196
196
}
197
197
198
- private void pluginElement (XNode context ) throws Exception {
198
+ private void pluginsElement (XNode context ) throws Exception {
199
199
if (context != null ) {
200
200
for (XNode child : context .getChildren ()) {
201
201
String interceptor = child .getStringAttribute ("interceptor" );
@@ -317,19 +317,20 @@ private void environmentsElement(XNode context) throws Exception {
317
317
}
318
318
319
319
private void databaseIdProviderElement (XNode context ) throws Exception {
320
- DatabaseIdProvider databaseIdProvider = null ;
321
- if (context != null ) {
322
- String type = context .getStringAttribute ("type" );
323
- // awful patch to keep backward compatibility
324
- if ("VENDOR" .equals (type )) {
325
- type = "DB_VENDOR" ;
326
- }
327
- Properties properties = context .getChildrenAsProperties ();
328
- databaseIdProvider = (DatabaseIdProvider ) resolveClass (type ).getDeclaredConstructor ().newInstance ();
329
- databaseIdProvider .setProperties (properties );
320
+ if (context == null ) {
321
+ return ;
322
+ }
323
+ String type = context .getStringAttribute ("type" );
324
+ // awful patch to keep backward compatibility
325
+ if ("VENDOR" .equals (type )) {
326
+ type = "DB_VENDOR" ;
330
327
}
328
+ Properties properties = context .getChildrenAsProperties ();
329
+ DatabaseIdProvider databaseIdProvider = (DatabaseIdProvider ) resolveClass (type ).getDeclaredConstructor ()
330
+ .newInstance ();
331
+ databaseIdProvider .setProperties (properties );
331
332
Environment environment = configuration .getEnvironment ();
332
- if (environment != null && databaseIdProvider != null ) {
333
+ if (environment != null ) {
333
334
String databaseId = databaseIdProvider .getDatabaseId (environment .getDataSource ());
334
335
configuration .setDatabaseId (databaseId );
335
336
}
@@ -357,7 +358,7 @@ private DataSourceFactory dataSourceElement(XNode context) throws Exception {
357
358
throw new BuilderException ("Environment declaration requires a DataSourceFactory." );
358
359
}
359
360
360
- private void typeHandlerElement (XNode context ) {
361
+ private void typeHandlersElement (XNode context ) {
361
362
if (context == null ) {
362
363
return ;
363
364
}
@@ -385,7 +386,7 @@ private void typeHandlerElement(XNode context) {
385
386
}
386
387
}
387
388
388
- private void mapperElement (XNode context ) throws Exception {
389
+ private void mappersElement (XNode context ) throws Exception {
389
390
if (context == null ) {
390
391
return ;
391
392
}
0 commit comments