Bug 256 - Input cards choices error
Summary: Input cards choices error
Status: CONFIRMED
Alias: None
Product: Group6
Classification: Unclassified
Component: Cards (show other bugs)
Version: unspecified
Hardware: PC Windows
: --- critical
Assignee: Chan Tai To
URL:
Depends on:
Blocks:
 
Reported: 2018-11-14 18:04 HKT by Chan Tai To
Modified: 2018-11-14 18:04 HKT (History)
0 users

See Also:


Attachments
java.lang.StringIndexOutOfBoundsException screen cap (84.84 KB, image/png)
2018-11-14 18:04 HKT, Chan Tai To
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Chan Tai To 2018-11-14 18:04:40 HKT
Created attachment 18 [details]
java.lang.StringIndexOutOfBoundsException screen cap

Java version: 11
OS version: Windows10 1803, OS build: 17134.345

Every time I try to input a card choice with 3 number, like 410, 110, 210, system throw java.lang.StringIndexOutOfBoundsException.

Full message:
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: begin 2, end 4, length 3
	at java.base/java.lang.String.checkBoundsBeginEnd(String.java:3319)
	at java.base/java.lang.String.substring(String.java:1874)
	at cards.PlayPoker.errorHandler(PlayPoker.java:126)
	at cards.PlayPoker.startPlay(PlayPoker.java:75)
	at cards.PlayPoker.main(PlayPoker.java:36)

This exception only throw when my input contained 3 number.