Bug 413

Summary: It is found that there is an error in checkIfValid() in UserInputHandler class
Product: CandyCrush 2020 Reporter: jli262-c
Component: Source CodeAssignee: jli262-c
Status: CONFIRMED ---    
Severity: critical CC: jli262-c
Priority: Highest    
Version: 1.0   
Hardware: PC   
OS: Windows   
Attachments: The UserInputHandler class with error

Description jli262-c 2020-11-17 17:06:42 HKT
Created attachment 46 [details]
The UserInputHandler class with error

Summary:
The bug is found after I add the third parameter in the checkIfValid() method in the UserInputHandler class

Steps to Reproduce:
1. Run the program
2. Input command "1 3 W"

Actual Results:
The program prompt:
Exception in thread "main" java.lang.Error: Unresolved compilation problem: 
	Char cannot be resolved to a type

	at game.UserInputHandler.checkIfValid(UserInputHandler.java:50)
	at game.UserInputHandler.getUserInput(UserInputHandler.java:43)
	at game.GameController.startGame(GameController.java:31)
	at game.Main.main(Main.java:9)


Expected Results:
Swap fails!
Please enter your move(eg: 1 3 W):
Comment 1 jli262-c 2020-11-17 17:09:34 HKT
(In reply to jli262-c from comment #0)
> Created attachment 46 [details]
> The UserInputHandler class with error
> 
> Summary:
> The bug is found after I add the third parameter in the checkIfValid()
> method in the UserInputHandler class
> 
> Steps to Reproduce:
> 1. Run the program
> 2. Input command "1 3 W"
> 
> Actual Results:
> The program prompt:
> Exception in thread "main" java.lang.Error: Unresolved compilation problem: 
> 	Char cannot be resolved to a type
> 
> 	at game.UserInputHandler.checkIfValid(UserInputHandler.java:50)
> 	at game.UserInputHandler.getUserInput(UserInputHandler.java:43)
> 	at game.GameController.startGame(GameController.java:31)
> 	at game.Main.main(Main.java:9)
> 
> 
> Expected Results:
> Swap fails!
> Please enter your move(eg: 1 3 W):

According to the error explanation in the eclipse prompt, I found that it was the case that the third parameter should be a String but not a Char to make it valid in the next process.