Bug 413 - It is found that there is an error in checkIfValid() in UserInputHandler class
Summary: It is found that there is an error in checkIfValid() in UserInputHandler class
Status: CONFIRMED
Alias: None
Product: CandyCrush 2020
Classification: Unclassified
Component: Source Code (show other bugs)
Version: 1.0
Hardware: PC Windows
: Highest critical
Assignee: jli262-c
URL:
Depends on:
Blocks:
 
Reported: 2020-11-17 17:06 HKT by jli262-c
Modified: 2020-11-29 15:04 HKT (History)
1 user (show)

See Also:


Attachments
The UserInputHandler class with error (2.12 KB, text/plain)
2020-11-17 17:06 HKT, jli262-c
Details

Note You need to log in before you can comment on or make changes to this bug.
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.