IABTechLab / iabgpp-java

Apache License 2.0
11 stars 12 forks source link

StringIndexOutOfBoundsException #33

Open ulviibra opened 11 months ago

ulviibra commented 11 months ago

Hi, new GppModel("RandomString"); currently throws java.lang.StringIndexOutOfBoundsException: String index out of range: -11. I believe this should be DecodingException instead.

infinite-monkeys commented 10 months ago

I think other "garbage" strings that can throw other exceptions as well, should also be a DecodingException.

new GppModel("xyAFz220~r")`

java.lang.NumberFormatException: For input string: "r"
        at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
        at java.lang.Integer.parseInt(Integer.java:580)
        at java.lang.Integer.parseInt(Integer.java:615)
        at com.iab.gpp.encoder.section.UspV1.decode(UspV1.java:73)
        at com.iab.gpp.encoder.section.UspV1.<init>(UspV1.java:25)
        at com.iab.gpp.encoder.GppModel.decode(GppModel.java:240)
        at com.iab.gpp.encoder.GppModel.<init>(GppModel.java:33)