You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tamaya.apache.org by an...@apache.org on 2016/01/22 02:59:37 UTC
incubator-tamaya git commit: Fixed quality issues and excluded
banner.txt from rat check.
Repository: incubator-tamaya
Updated Branches:
refs/heads/master 7ce90f6cf -> e1a011729
Fixed quality issues and excluded banner.txt from rat check.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/commit/e1a01172
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/tree/e1a01172
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/diff/e1a01172
Branch: refs/heads/master
Commit: e1a0117296caddfcc14187903e0ad8e24dced121
Parents: 7ce90f6
Author: anatole <an...@apache.org>
Authored: Fri Jan 22 02:59:30 2016 +0100
Committer: anatole <an...@apache.org>
Committed: Fri Jan 22 02:59:30 2016 +0100
----------------------------------------------------------------------
.../java/org/apache/tamaya/ConfigurationProvider.java | 13 ++++++++++++-
pom.xml | 1 +
2 files changed, 13 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/e1a01172/code/api/src/main/java/org/apache/tamaya/ConfigurationProvider.java
----------------------------------------------------------------------
diff --git a/code/api/src/main/java/org/apache/tamaya/ConfigurationProvider.java b/code/api/src/main/java/org/apache/tamaya/ConfigurationProvider.java
index 5787941..3bf42e2 100644
--- a/code/api/src/main/java/org/apache/tamaya/ConfigurationProvider.java
+++ b/code/api/src/main/java/org/apache/tamaya/ConfigurationProvider.java
@@ -24,6 +24,7 @@ import org.apache.tamaya.spi.ConfigurationProviderSpi;
import org.apache.tamaya.spi.ServiceContextManager;
import java.io.BufferedReader;
+import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
@@ -40,10 +41,11 @@ public final class ConfigurationProvider {
if(spi==null){
throw new IllegalStateException("ConfigurationProviderSpi not available.");
}
+ BufferedReader reader = null;
try{
URL url = ConfigurationProvider.class.getResource("/banner.txt");
if(url!=null){
- BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream()));
+ reader = new BufferedReader(new InputStreamReader(url.openStream(), "UTF-8"));
StringBuilder b = new StringBuilder();
String line = reader.readLine();
while(line != null){
@@ -56,6 +58,15 @@ public final class ConfigurationProvider {
catch(Exception e){
System.out.println("************ TAMAYA CONFIG ************");
}
+ finally{
+ if(reader!=null){
+ try {
+ reader.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
return spi;
}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/e1a01172/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index eb7511c..6d5b386 100644
--- a/pom.xml
+++ b/pom.xml
@@ -664,6 +664,7 @@ under the License.
<include>pom.xml</include>
</includes>
<excludes>
+ <exclude>banner.txt</exclude>
<exclude>.git</exclude>
<exclude>derby.log</exclude>
<exclude>**/bootstrap-*</exclude>