Skip to content

Commit 582ee94

Browse files
authored
Merge pull request #986 from hazendaz/master
Update logging issues noted in eclipse/sonarlint
2 parents 6173cef + 070b14e commit 582ee94

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

src/main/java/org/apache/ibatis/io/ExternalResources.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2009-2016 the original author or authors.
2+
* Copyright 2009-2017 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -24,12 +24,17 @@
2424
import java.nio.channels.FileChannel;
2525
import java.util.Properties;
2626

27+
import org.apache.ibatis.logging.Log;
28+
import org.apache.ibatis.logging.LogFactory;
29+
2730
/**
2831
* @author Clinton Begin
2932
*/
3033
@Deprecated
3134
public class ExternalResources {
3235

36+
private static final Log log = LogFactory.getLog(ExternalResources.class);
37+
3338
private ExternalResources() {
3439
// do nothing
3540
}
@@ -72,7 +77,7 @@ public static String getConfiguredTemplate(String templatePath, String templateP
7277
} catch (FileNotFoundException e) {
7378
throw e;
7479
} catch (Exception e) {
75-
e.printStackTrace();
80+
log.error("", e);
7681
}
7782

7883
return templateName;

src/test/java/org/apache/ibatis/submitted/blocking_cache/BlockingCacheTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2009-2015 the original author or authors.
2+
* Copyright 2009-2017 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -85,7 +85,7 @@ private void accessDB() {
8585
try {
8686
Thread.sleep(500);
8787
} catch (InterruptedException e) {
88-
e.printStackTrace();
88+
Assert.fail(e.getMessage());
8989
}
9090
} finally {
9191
sqlSession1.close();

src/test/java/org/apache/ibatis/submitted/null_associations/FooMapperTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2009-2015 the original author or authors.
2+
* Copyright 2009-2017 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -42,7 +42,7 @@ public static void setUpBeforeClass() {
4242
Reader reader = Resources.getResourceAsReader("org/apache/ibatis/submitted/null_associations/create-schema-mysql.sql");
4343
runner.runScript(reader);
4444
} catch (Exception ex) {
45-
ex.printStackTrace();
45+
Assert.fail(ex.getMessage());
4646
}
4747
}
4848

src/test/java/org/apache/ibatis/submitted/overwritingproperties/FooMapperTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public static void setUpBeforeClass() {
4343
Reader reader = Resources.getResourceAsReader("org/apache/ibatis/submitted/overwritingproperties/create-schema-mysql.sql");
4444
runner.runScript(reader);
4545
} catch (Exception ex) {
46-
ex.printStackTrace();
46+
Assert.fail(ex.getMessage());
4747
}
4848
}
4949

0 commit comments

Comments
 (0)