Skip to content

Commit e816fcc

Browse files
committed
removing this. to access the static logger property
1 parent 93ccfe4 commit e816fcc

File tree

2 files changed

+24
-24
lines changed

2 files changed

+24
-24
lines changed

src/main/java/org/mybatis/spring/SqlSessionFactoryBean.java

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -354,8 +354,8 @@ protected SqlSessionFactory buildSqlSessionFactory() throws IOException {
354354
xmlConfigBuilder = new XMLConfigBuilder(this.configLocation.getInputStream(), null, this.configurationProperties);
355355
configuration = xmlConfigBuilder.getConfiguration();
356356
} else {
357-
if (this.logger.isDebugEnabled()) {
358-
this.logger.debug("Property 'configLocation' not specified, using default MyBatis Configuration");
357+
if (logger.isDebugEnabled()) {
358+
logger.debug("Property 'configLocation' not specified, using default MyBatis Configuration");
359359
}
360360
configuration = new Configuration();
361361
configuration.setVariables(this.configurationProperties);
@@ -375,26 +375,26 @@ protected SqlSessionFactory buildSqlSessionFactory() throws IOException {
375375
for (String packageToScan : typeAliasPackageArray) {
376376
configuration.getTypeAliasRegistry().registerAliases(packageToScan,
377377
typeAliasesSuperType == null ? Object.class : typeAliasesSuperType);
378-
if (this.logger.isDebugEnabled()) {
379-
this.logger.debug("Scanned package: '" + packageToScan + "' for aliases");
378+
if (logger.isDebugEnabled()) {
379+
logger.debug("Scanned package: '" + packageToScan + "' for aliases");
380380
}
381381
}
382382
}
383383

384384
if (!isEmpty(this.typeAliases)) {
385385
for (Class<?> typeAlias : this.typeAliases) {
386386
configuration.getTypeAliasRegistry().registerAlias(typeAlias);
387-
if (this.logger.isDebugEnabled()) {
388-
this.logger.debug("Registered type alias: '" + typeAlias + "'");
387+
if (logger.isDebugEnabled()) {
388+
logger.debug("Registered type alias: '" + typeAlias + "'");
389389
}
390390
}
391391
}
392392

393393
if (!isEmpty(this.plugins)) {
394394
for (Interceptor plugin : this.plugins) {
395395
configuration.addInterceptor(plugin);
396-
if (this.logger.isDebugEnabled()) {
397-
this.logger.debug("Registered plugin: '" + plugin + "'");
396+
if (logger.isDebugEnabled()) {
397+
logger.debug("Registered plugin: '" + plugin + "'");
398398
}
399399
}
400400
}
@@ -404,17 +404,17 @@ protected SqlSessionFactory buildSqlSessionFactory() throws IOException {
404404
ConfigurableApplicationContext.CONFIG_LOCATION_DELIMITERS);
405405
for (String packageToScan : typeHandlersPackageArray) {
406406
configuration.getTypeHandlerRegistry().register(packageToScan);
407-
if (this.logger.isDebugEnabled()) {
408-
this.logger.debug("Scanned package: '" + packageToScan + "' for type handlers");
407+
if (logger.isDebugEnabled()) {
408+
logger.debug("Scanned package: '" + packageToScan + "' for type handlers");
409409
}
410410
}
411411
}
412412

413413
if (!isEmpty(this.typeHandlers)) {
414414
for (TypeHandler<?> typeHandler : this.typeHandlers) {
415415
configuration.getTypeHandlerRegistry().register(typeHandler);
416-
if (this.logger.isDebugEnabled()) {
417-
this.logger.debug("Registered type handler: '" + typeHandler + "'");
416+
if (logger.isDebugEnabled()) {
417+
logger.debug("Registered type handler: '" + typeHandler + "'");
418418
}
419419
}
420420
}
@@ -423,8 +423,8 @@ protected SqlSessionFactory buildSqlSessionFactory() throws IOException {
423423
try {
424424
xmlConfigBuilder.parse();
425425

426-
if (this.logger.isDebugEnabled()) {
427-
this.logger.debug("Parsed configuration file: '" + this.configLocation + "'");
426+
if (logger.isDebugEnabled()) {
427+
logger.debug("Parsed configuration file: '" + this.configLocation + "'");
428428
}
429429
} catch (Exception ex) {
430430
throw new NestedIOException("Failed to parse config resource: " + this.configLocation, ex);
@@ -464,13 +464,13 @@ protected SqlSessionFactory buildSqlSessionFactory() throws IOException {
464464
ErrorContext.instance().reset();
465465
}
466466

467-
if (this.logger.isDebugEnabled()) {
468-
this.logger.debug("Parsed mapper file: '" + mapperLocation + "'");
467+
if (logger.isDebugEnabled()) {
468+
logger.debug("Parsed mapper file: '" + mapperLocation + "'");
469469
}
470470
}
471471
} else {
472-
if (this.logger.isDebugEnabled()) {
473-
this.logger.debug("Property 'mapperLocations' was not specified or no matching resources found");
472+
if (logger.isDebugEnabled()) {
473+
logger.debug("Property 'mapperLocations' was not specified or no matching resources found");
474474
}
475475
}
476476

src/main/java/org/mybatis/spring/transaction/SpringManagedTransaction.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ private void openConnection() throws SQLException {
8181
this.autoCommit = this.connection.getAutoCommit();
8282
this.isConnectionTransactional = isConnectionTransactional(this.connection, this.dataSource);
8383

84-
if (this.logger.isDebugEnabled()) {
85-
this.logger.debug(
84+
if (logger.isDebugEnabled()) {
85+
logger.debug(
8686
"JDBC Connection ["
8787
+ this.connection
8888
+ "] will"
@@ -96,8 +96,8 @@ private void openConnection() throws SQLException {
9696
*/
9797
public void commit() throws SQLException {
9898
if (this.connection != null && !this.isConnectionTransactional && !this.autoCommit) {
99-
if (this.logger.isDebugEnabled()) {
100-
this.logger.debug("Committing JDBC Connection [" + this.connection + "]");
99+
if (logger.isDebugEnabled()) {
100+
logger.debug("Committing JDBC Connection [" + this.connection + "]");
101101
}
102102
this.connection.commit();
103103
}
@@ -108,8 +108,8 @@ public void commit() throws SQLException {
108108
*/
109109
public void rollback() throws SQLException {
110110
if (this.connection != null && !this.isConnectionTransactional && !this.autoCommit) {
111-
if (this.logger.isDebugEnabled()) {
112-
this.logger.debug("Rolling back JDBC Connection [" + this.connection + "]");
111+
if (logger.isDebugEnabled()) {
112+
logger.debug("Rolling back JDBC Connection [" + this.connection + "]");
113113
}
114114
this.connection.rollback();
115115
}

0 commit comments

Comments
 (0)