tamaya-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject [1/2] incubator-tamaya git commit: TAMAYA-42 avoid NPE and add TODOs
Date Mon, 05 Jan 2015 20:15:12 GMT
Repository: incubator-tamaya
Updated Branches:
  refs/heads/master 37725cd05 -> ea651771f


TAMAYA-42 avoid NPE and add TODOs


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

Branch: refs/heads/master
Commit: 022b15e76079b3a65232eeab3d013c5c1b2bab87
Parents: 37725cd
Author: Mark Struberg <struberg@apache.org>
Authored: Mon Jan 5 21:09:50 2015 +0100
Committer: Mark Struberg <struberg@apache.org>
Committed: Mon Jan 5 21:10:27 2015 +0100

----------------------------------------------------------------------
 .../core/internal/PropertyConverterManager.java     | 16 ++++++++--------
 .../core/propertysource/SystemPropertySource.java   |  2 +-
 2 files changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/022b15e7/core/src/main/java/org/apache/tamaya/core/internal/PropertyConverterManager.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/tamaya/core/internal/PropertyConverterManager.java
b/core/src/main/java/org/apache/tamaya/core/internal/PropertyConverterManager.java
index 359dff7..86c8ebe 100644
--- a/core/src/main/java/org/apache/tamaya/core/internal/PropertyConverterManager.java
+++ b/core/src/main/java/org/apache/tamaya/core/internal/PropertyConverterManager.java
@@ -65,25 +65,25 @@ public class PropertyConverterManager {
      */
     protected void initDefaultConverters() {
         // Add default converters
-        register(char.class, (s) -> s.charAt(0));
+        register(char.class, (s) -> s != null ? s.charAt(0) : null);
         register(byte.class, Byte::parseByte);
         register(short.class, Short::parseShort);
         register(int.class, Integer::parseInt);
         register(long.class, Long::parseLong);
         register(boolean.class, Boolean::parseBoolean);
-        register(float.class, Float::parseFloat);
-        register(double.class, Double::parseDouble);
+        register(float.class, Float::parseFloat); //X TODO not good enough as this is Locale
dependent!
+        register(double.class, Double::parseDouble); //X TODO not good enough as this is
Locale dependent!
 
-        register(Character.class, (s) -> s.charAt(0));
+        register(Character.class, (s) -> s != null ? s.charAt(0) : null );
         register(Byte.class, Byte::valueOf);
         register(Short.class, Short::valueOf);
         register(Integer.class, Integer::valueOf);
         register(Long.class, Long::valueOf);
         register(Boolean.class, Boolean::valueOf);
-        register(Float.class, Float::valueOf);
-        register(Double.class, Double::valueOf);
-        register(BigDecimal.class, BigDecimal::new);
-        register(BigInteger.class, BigInteger::new);
+        register(Float.class, Float::valueOf); //X TODO not good enough as this is Locale
dependent!
+        register(Double.class, Double::valueOf); //X TODO not good enough as this is Locale
dependent!
+        register(BigDecimal.class, BigDecimal::new); //X TODO not good enough as this is
Locale dependent!
+        register(BigInteger.class, BigInteger::new); //X TODO not good enough as this is
Locale dependent!
 
         register(Currency.class, Currency::getInstance);
 

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/022b15e7/core/src/main/java/org/apache/tamaya/core/propertysource/SystemPropertySource.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/tamaya/core/propertysource/SystemPropertySource.java
b/core/src/main/java/org/apache/tamaya/core/propertysource/SystemPropertySource.java
index e06e185..4ead5ab 100644
--- a/core/src/main/java/org/apache/tamaya/core/propertysource/SystemPropertySource.java
+++ b/core/src/main/java/org/apache/tamaya/core/propertysource/SystemPropertySource.java
@@ -29,7 +29,7 @@ import java.util.Properties;
 public class SystemPropertySource extends BasePropertySource {
 
     /**
-     * cashed System.getProperties() filled in our Map
+     * cached System.getProperties() filled in our Map
      */
     private Map<String, String> properties;
 


Mime
View raw message