Repository: camel
Updated Branches:
  refs/heads/master fa38e09b9 -> c3b6f810c


Fixed potential NPE in unit test


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

Branch: refs/heads/master
Commit: c3b6f810ca548945ec875cb5bd252ff2bb7f88e8
Parents: fa38e09
Author: Claus Ibsen <davscl...@apache.org>
Authored: Fri Mar 6 18:01:42 2015 +0100
Committer: Claus Ibsen <davscl...@apache.org>
Committed: Fri Mar 6 18:01:42 2015 +0100

----------------------------------------------------------------------
 .../java/org/apache/camel/component/hdfs/HdfsConsumerTest.java    | 3 ++-
 .../java/org/apache/camel/component/hdfs2/HdfsConsumerTest.java   | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/c3b6f810/components/camel-hdfs/src/test/java/org/apache/camel/component/hdfs/HdfsConsumerTest.java
----------------------------------------------------------------------
diff --git 
a/components/camel-hdfs/src/test/java/org/apache/camel/component/hdfs/HdfsConsumerTest.java
 
b/components/camel-hdfs/src/test/java/org/apache/camel/component/hdfs/HdfsConsumerTest.java
index 9488afb..3386e8d 100644
--- 
a/components/camel-hdfs/src/test/java/org/apache/camel/component/hdfs/HdfsConsumerTest.java
+++ 
b/components/camel-hdfs/src/test/java/org/apache/camel/component/hdfs/HdfsConsumerTest.java
@@ -247,7 +247,8 @@ public class HdfsConsumerTest extends HdfsTestSupport {
             return;
         }
 
-        int before = new File("target/test").list().length;
+        String[] beforeFiles = new File("target/test").list();
+        int before = beforeFiles != null ? beforeFiles.length : 0;
 
         final Path file = new Path(new 
File("target/test/test-camel-boolean").getAbsolutePath());
         Configuration conf = new Configuration();

http://git-wip-us.apache.org/repos/asf/camel/blob/c3b6f810/components/camel-hdfs2/src/test/java/org/apache/camel/component/hdfs2/HdfsConsumerTest.java
----------------------------------------------------------------------
diff --git 
a/components/camel-hdfs2/src/test/java/org/apache/camel/component/hdfs2/HdfsConsumerTest.java
 
b/components/camel-hdfs2/src/test/java/org/apache/camel/component/hdfs2/HdfsConsumerTest.java
index fdbfd73..a55c421 100644
--- 
a/components/camel-hdfs2/src/test/java/org/apache/camel/component/hdfs2/HdfsConsumerTest.java
+++ 
b/components/camel-hdfs2/src/test/java/org/apache/camel/component/hdfs2/HdfsConsumerTest.java
@@ -247,7 +247,8 @@ public class HdfsConsumerTest extends HdfsTestSupport {
             return;
         }
 
-        int before = new File("target/test").list().length;
+        String[] beforeFiles = new File("target/test").list();
+        int before = beforeFiles != null ? beforeFiles.length : 0;
 
         final Path file = new Path(new 
File("target/test/test-camel-boolean").getAbsolutePath());
         Configuration conf = new Configuration();

Reply via email to