Bug 315

Summary: Invalid input incorrectly deducted users tokens
Product: Slot Machine Reporter: josephccs0917
Component: slot machineAssignee: billy777 <cfyeung27-c>
Status: RESOLVED FIXED    
Severity: critical    
Priority: High    
Version: 1.0 release   
Hardware: PC   
OS: Mac OS   

Description josephccs0917 2019-11-24 14:55:34 HKT
When I entered non-numeric input for the bet, it deducts my tokens and starts spinning the slot machine. Non-numeric input should be regarded as invalid input and requires player to enter numeric input.
Comment 1 billy777 2019-11-24 15:57:22 HKT
Problem resolved by prohibiting player to enter input by themselves, but allow them to input the bet by clicking the add or minus button.
Comment 2 billy777 2019-11-24 16:14:34 HKT
The problem is caused by Generics in Java is only available at compile time. Java generic is only performing type safe casting at compile time. However, the problem is caused by user enter inputs at run time. Therefore, disabling the editable feature in spinner is the most intuitive way to solve the problem.