Skip to content

Commit

Permalink
Fix if statements
Browse files Browse the repository at this point in the history
  • Loading branch information
rnowling committed Nov 20, 2014
1 parent 1b314f0 commit df59b65
Showing 1 changed file with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,27 +66,27 @@ 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)
}

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)
Expand Down Expand Up @@ -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.")
}
Expand Down

0 comments on commit df59b65

Please sign in to comment.