Querz / NBT

A java implementation of the NBT protocol, including a way to implement custom tags.
MIT License
182 stars 48 forks source link

StringOutOfBoundsIndexException issue, and ParseException suggestion #65

Open DalekCraft2 opened 3 years ago

DalekCraft2 commented 3 years ago

The SNBTUtil.fromString() method throws a StringIndexOutOfBoundsException if an empty string is passed to it, so it would be convenient if that was fixed so one would not have to add catch statements for it whenever they invoke the method.

For the ParseException class, I think that it should have a method for getting the index at which the error was found. In my case, I want it so I can create a (java.text.)ParseException from it for a JFormattedTextField's formatter.

Edit: Alternatively, you could simply use the java.text.ParseException class instead of creating your own.