@@ -116,19 +116,19 @@ private void parseConfiguration(XNode root) {
116116 // issue #117 read properties first
117117 propertiesElement (root .evalNode ("properties" ));
118118 Properties settings = settingsAsProperties (root .evalNode ("settings" ));
119- loadCustomVfs (settings );
119+ loadCustomVfsImpl (settings );
120120 loadCustomLogImpl (settings );
121121 typeAliasesElement (root .evalNode ("typeAliases" ));
122- pluginElement (root .evalNode ("plugins" ));
122+ pluginsElement (root .evalNode ("plugins" ));
123123 objectFactoryElement (root .evalNode ("objectFactory" ));
124124 objectWrapperFactoryElement (root .evalNode ("objectWrapperFactory" ));
125125 reflectorFactoryElement (root .evalNode ("reflectorFactory" ));
126126 settingsElement (settings );
127127 // read it after objectFactory and objectWrapperFactory issue #631
128128 environmentsElement (root .evalNode ("environments" ));
129129 databaseIdProviderElement (root .evalNode ("databaseIdProvider" ));
130- typeHandlerElement (root .evalNode ("typeHandlers" ));
131- mapperElement (root .evalNode ("mappers" ));
130+ typeHandlersElement (root .evalNode ("typeHandlers" ));
131+ mappersElement (root .evalNode ("mappers" ));
132132 } catch (Exception e ) {
133133 throw new BuilderException ("Error parsing SQL Mapper Configuration. Cause: " + e , e );
134134 }
@@ -150,7 +150,7 @@ private Properties settingsAsProperties(XNode context) {
150150 return props ;
151151 }
152152
153- private void loadCustomVfs (Properties props ) throws ClassNotFoundException {
153+ private void loadCustomVfsImpl (Properties props ) throws ClassNotFoundException {
154154 String value = props .getProperty ("vfsImpl" );
155155 if (value == null ) {
156156 return ;
@@ -195,7 +195,7 @@ private void typeAliasesElement(XNode context) {
195195 }
196196 }
197197
198- private void pluginElement (XNode context ) throws Exception {
198+ private void pluginsElement (XNode context ) throws Exception {
199199 if (context != null ) {
200200 for (XNode child : context .getChildren ()) {
201201 String interceptor = child .getStringAttribute ("interceptor" );
@@ -317,19 +317,20 @@ private void environmentsElement(XNode context) throws Exception {
317317 }
318318
319319 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" ;
330327 }
328+ Properties properties = context .getChildrenAsProperties ();
329+ DatabaseIdProvider databaseIdProvider = (DatabaseIdProvider ) resolveClass (type ).getDeclaredConstructor ()
330+ .newInstance ();
331+ databaseIdProvider .setProperties (properties );
331332 Environment environment = configuration .getEnvironment ();
332- if (environment != null && databaseIdProvider != null ) {
333+ if (environment != null ) {
333334 String databaseId = databaseIdProvider .getDatabaseId (environment .getDataSource ());
334335 configuration .setDatabaseId (databaseId );
335336 }
@@ -357,7 +358,7 @@ private DataSourceFactory dataSourceElement(XNode context) throws Exception {
357358 throw new BuilderException ("Environment declaration requires a DataSourceFactory." );
358359 }
359360
360- private void typeHandlerElement (XNode context ) {
361+ private void typeHandlersElement (XNode context ) {
361362 if (context == null ) {
362363 return ;
363364 }
@@ -385,7 +386,7 @@ private void typeHandlerElement(XNode context) {
385386 }
386387 }
387388
388- private void mapperElement (XNode context ) throws Exception {
389+ private void mappersElement (XNode context ) throws Exception {
389390 if (context == null ) {
390391 return ;
391392 }
0 commit comments