Skip to content

Fix exception while parsing for timestamps like hh:mm:ss without dates #1

@vizsatiz

Description

@vizsatiz

Sample input: 22:55:4
Debug Logs:

ch:2 state:2 map:{NUM=2, TYP=NUM}
ch:2 state:3 map:{NUM=22, TYP=NUM}
ch:: state:4 map:{HH=22, TYP=DATE}
ch:5 state:5 map:{HH=22, mm=5, TYP=DATE}
ch:5 state:5 map:{HH=22, mm=55, TYP=DATE}
ch:: state:6 map:{HH=22, mm=55, TYP=DATE}
ch:4 state:-1 map:{HH=22, mm=55, ss=4, TYP=DATE}

Exception:

String index out of range: 8
java.lang.StringIndexOutOfBoundsException: String index out of range: 8
	at java.lang.String.substring(String.java:1963)
	at com.twelfthmile.kyuga.Kyuga.prepareResult(kYuga.kt:168)
	at com.twelfthmile.kyuga.Kyuga.getResponse(kYuga.kt:128)
	at com.twelfthmile.kyuga.Kyuga.parse(kYuga.kt:145)
	at com.twelfthmile.kyuga.Kyuga.tokenise(kYuga.kt:77)
	at YugaTest.on tokenize - valid offer- should tokenize(YugaTest.kt:45)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions