tamaya-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anat...@apache.org
Subject [2/2] incubator-tamaya git commit: Fixed checkstyle issues.
Date Mon, 26 Jan 2015 11:14:10 GMT
Fixed checkstyle issues.


Project: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/commit/de354a1e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/tree/de354a1e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/diff/de354a1e

Branch: refs/heads/master
Commit: de354a1ebef601d7f4392b0a0b69835cf982ad01
Parents: 3e8d8de
Author: anatole <anatole@apache.org>
Authored: Mon Jan 26 12:13:38 2015 +0100
Committer: anatole <anatole@apache.org>
Committed: Mon Jan 26 12:13:57 2015 +0100

----------------------------------------------------------------------
 .../internal/converters/CurrencyConverter.java  | 25 +++++++++-----------
 .../internal/converters/CurrencyConverter.java  | 25 +++++++++-----------
 2 files changed, 22 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/de354a1e/java7/core/src/main/java/org/apache/tamaya/core/internal/converters/CurrencyConverter.java
----------------------------------------------------------------------
diff --git a/java7/core/src/main/java/org/apache/tamaya/core/internal/converters/CurrencyConverter.java
b/java7/core/src/main/java/org/apache/tamaya/core/internal/converters/CurrencyConverter.java
index c0920b8..4e3248d 100644
--- a/java7/core/src/main/java/org/apache/tamaya/core/internal/converters/CurrencyConverter.java
+++ b/java7/core/src/main/java/org/apache/tamaya/core/internal/converters/CurrencyConverter.java
@@ -29,18 +29,17 @@ import java.util.logging.Logger;
 /**
  * Converter, converting from String to Currency.
  */
-public class CurrencyConverter implements PropertyConverter<Currency>{
+public class CurrencyConverter implements PropertyConverter<Currency> {
 
     private static final Logger LOG = Logger.getLogger(CurrencyConverter.class.getName());
 
     @Override
     public Currency convert(String value) {
         String trimmed = Objects.requireNonNull(value).trim();
-        try{
+        try {
             return Currency.getInstance(trimmed.toUpperCase(Locale.ENGLISH));
-        }
-        catch(Exception e){
-            LOG.log(Level.INFO, "Not a valid textual currency code: " + trimmed +", checking
for numeric...", e);
+        } catch (Exception e) {
+            LOG.log(Level.INFO, "Not a valid textual currency code: " + trimmed + ", checking
for numeric...", e);
         }
         try {
             // Check for numeric code
@@ -50,15 +49,14 @@ public class CurrencyConverter implements PropertyConverter<Currency>{
                     return currency;
                 }
             }
-        }
-        catch(Exception e){
-            LOG.log(Level.INFO, "Not a valid numeric currency code: " + trimmed +", checking
for locale...", e);
+        } catch (Exception e) {
+            LOG.log(Level.INFO, "Not a valid numeric currency code: " + trimmed + ", checking
for locale...", e);
         }
         try {
             // Check for numeric code
             String[] parts = trimmed.split("\\_");
             Locale locale;
-            switch(parts.length){
+            switch (parts.length) {
                 case 1:
                     locale = new Locale("", parts[0]);
                     break;
@@ -71,13 +69,12 @@ public class CurrencyConverter implements PropertyConverter<Currency>{
                 default:
                     locale = null;
             }
-            if(locale!=null){
+            if (locale != null) {
                 return Currency.getInstance(locale);
             }
-            LOG.info("Not a valid currency: " + trimmed +", giving up...");
-        }
-        catch(Exception e){
-            LOG.log(Level.INFO, "Not a valid country locale for currency: " + trimmed +",
giving up...", e);
+            LOG.info("Not a valid currency: " + trimmed + ", giving up...");
+        } catch (Exception e) {
+            LOG.log(Level.INFO, "Not a valid country locale for currency: " + trimmed + ",
giving up...", e);
         }
         return null;
     }

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/de354a1e/java8/core/src/main/java/org/apache/tamaya/core/internal/converters/CurrencyConverter.java
----------------------------------------------------------------------
diff --git a/java8/core/src/main/java/org/apache/tamaya/core/internal/converters/CurrencyConverter.java
b/java8/core/src/main/java/org/apache/tamaya/core/internal/converters/CurrencyConverter.java
index 59f9358..05d460d 100644
--- a/java8/core/src/main/java/org/apache/tamaya/core/internal/converters/CurrencyConverter.java
+++ b/java8/core/src/main/java/org/apache/tamaya/core/internal/converters/CurrencyConverter.java
@@ -29,18 +29,17 @@ import java.util.logging.Logger;
 /**
  * Converter, converting from String to Currency.
  */
-public class CurrencyConverter implements PropertyConverter<Currency>{
+public class CurrencyConverter implements PropertyConverter<Currency> {
 
     private static final Logger LOG = Logger.getLogger(CurrencyConverter.class.getName());
 
     @Override
     public Currency convert(String value) {
         String trimmed = Objects.requireNonNull(value).trim();
-        try{
+        try {
             return Currency.getInstance(trimmed.toUpperCase(Locale.ENGLISH));
-        }
-        catch(Exception e){
-            LOG.log(Level.INFO, e, () -> "Not a valid textual currency code: " + trimmed
+", checking for numeric...");
+        } catch (Exception e) {
+            LOG.log(Level.INFO, e, () -> "Not a valid textual currency code: " + trimmed
+ ", checking for numeric...");
         }
         try {
             // Check for numeric code
@@ -50,15 +49,14 @@ public class CurrencyConverter implements PropertyConverter<Currency>{
                     return currency;
                 }
             }
-        }
-        catch(Exception e){
-            LOG.log(Level.INFO, e, () -> "Not a valid numeric currency code: " + trimmed
+", checking for locale...");
+        } catch (Exception e) {
+            LOG.log(Level.INFO, e, () -> "Not a valid numeric currency code: " + trimmed
+ ", checking for locale...");
         }
         try {
             // Check for numeric code
             String[] parts = trimmed.split("\\_");
             Locale locale;
-            switch(parts.length){
+            switch (parts.length) {
                 case 1:
                     locale = new Locale("", parts[0]);
                     break;
@@ -71,13 +69,12 @@ public class CurrencyConverter implements PropertyConverter<Currency>{
                 default:
                     locale = null;
             }
-            if(locale!=null){
+            if (locale != null) {
                 return Currency.getInstance(locale);
             }
-            LOG.info(() -> "Not a valid currency: " + trimmed +", giving up...");
-        }
-        catch(Exception e){
-            LOG.log(Level.INFO, e, () -> "Not a valid country locale for currency: " +
trimmed +", giving up...");
+            LOG.info(() -> "Not a valid currency: " + trimmed + ", giving up...");
+        } catch (Exception e) {
+            LOG.log(Level.INFO, e, () -> "Not a valid country locale for currency: " +
trimmed + ", giving up...");
         }
         return null;
     }


Mime
View raw message