[IGNITE-349]: bugfix by integration testing results: (1) NPE in properties 
serialization; (2) small usability improvement.


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

Branch: refs/heads/ignite-release-test-no-mod
Commit: d1ebb02bb58b0c2e2e76bccafe832a900b91e729
Parents: d3a3a3e
Author: iveselovskiy <iveselovs...@gridgain.com>
Authored: Thu Mar 5 21:33:22 2015 +0300
Committer: iveselovskiy <iveselovs...@gridgain.com>
Committed: Thu Mar 5 21:33:22 2015 +0300

----------------------------------------------------------------------
 .../hadoop/fs/IgniteHadoopIgfsSecondaryFileSystem.java   | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d1ebb02b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/IgniteHadoopIgfsSecondaryFileSystem.java
----------------------------------------------------------------------
diff --git 
a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/IgniteHadoopIgfsSecondaryFileSystem.java
 
b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/IgniteHadoopIgfsSecondaryFileSystem.java
index f5d7055..3320a96 100644
--- 
a/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/IgniteHadoopIgfsSecondaryFileSystem.java
+++ 
b/modules/hadoop/src/main/java/org/apache/ignite/hadoop/fs/IgniteHadoopIgfsSecondaryFileSystem.java
@@ -64,7 +64,12 @@ public class IgniteHadoopIgfsSecondaryFileSystem implements 
IgfsSecondaryFileSys
      * @param cfgPath Additional path to Hadoop configuration.
      * @throws IgniteCheckedException In case of error.
      */
-    public IgniteHadoopIgfsSecondaryFileSystem(@Nullable String uri, @Nullable 
String cfgPath) throws IgniteCheckedException {
+    public IgniteHadoopIgfsSecondaryFileSystem(@Nullable String uri, @Nullable 
String cfgPath)
+            throws IgniteCheckedException {
+        // Treat empty uri argument as null to improve configuration usability:
+        if (F.isEmpty(uri))
+            uri = null;
+
         try {
             SecondaryFileSystemProvider secProvider = new 
SecondaryFileSystemProvider(uri, cfgPath);
 
@@ -75,7 +80,9 @@ public class IgniteHadoopIgfsSecondaryFileSystem implements 
IgfsSecondaryFileSys
             if (!uri.endsWith("/"))
                 uri += "/";
 
-            props.put(SECONDARY_FS_CONFIG_PATH, cfgPath);
+            if (cfgPath != null)
+                props.put(SECONDARY_FS_CONFIG_PATH, cfgPath);
+
             props.put(SECONDARY_FS_URI, uri);
         }
         catch (IOException e) {

Reply via email to