From df59b6597b4ca953dbb685e69c5f1f569bdef71b Mon Sep 17 00:00:00 2001 From: RJ Nowling Date: Thu, 20 Nov 2014 09:15:55 -0500 Subject: [PATCH] Fix if statements --- .../apache/spark/examples/DFSReadWriteTest.scala | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/examples/src/main/scala/org/apache/spark/examples/DFSReadWriteTest.scala b/examples/src/main/scala/org/apache/spark/examples/DFSReadWriteTest.scala index 16c54b8ae9f2b..9c9a71a7e5c9a 100644 --- a/examples/src/main/scala/org/apache/spark/examples/DFSReadWriteTest.scala +++ b/examples/src/main/scala/org/apache/spark/examples/DFSReadWriteTest.scala @@ -66,13 +66,13 @@ object DFSReadWriteTest { var i = 0 localFilePath = new File(args(i)) - if(! localFilePath.exists()) { + if(!localFilePath.exists) { System.err.println("Given path (" + args(i) + ") does not exist.\n") printUsage() System.exit(1) } - if(! localFilePath.isFile()) { + if(!localFilePath.isFile) { System.err.println("Given path (" + args(i) + ") is not a file.\n") printUsage() System.exit(1) @@ -80,13 +80,13 @@ object DFSReadWriteTest { i += 1 dfsDirPath = new File(args(i)) - if(! dfsDirPath.exists()) { + if(!dfsDirPath.exists) { System.err.println("Given path (" + args(i) + ") does not exist.\n") printUsage() System.exit(1) } - if(! dfsDirPath.isDirectory()) { + if(dfsDirPath.isDirectory) { System.err.println("Given path (" + args(i) + ") is not a directory.\n") printUsage() System.exit(1) @@ -131,13 +131,11 @@ object DFSReadWriteTest { sc.stop() - if(localWordCount == dfsWordCount) - { + if(localWordCount == dfsWordCount) { println("Success! Local Word Count (" + localWordCount + ") and DFS Word Count (" + dfsWordCount + ") agree.") } - else - { + else { println("Failure! Local Word Count (" + localWordCount + ") and DFS Word Count (" + dfsWordCount + ") disagree.") }