jakartaee / jsonp-api

Jakarta JSON Processing
https://eclipse.org/ee4j/jsonp
Other
141 stars 61 forks source link

JsonParser.getValue/getObject/getArray Exceptions #152

Closed jjspiegel closed 3 years ago

jjspiegel commented 5 years ago

The methods getValue(), getObject(), and getArray() on JsonParser should be marked as throwing JsonParsingException and possibly NoSuchElementException since they advance the parser state. These exceptions are thrown by next().

jbescos commented 3 years ago

@jjspiegel I am checking this. This is only javadoc related, isn't it?.

Because next() relies on getValue(), getObject() and getArray(). But also, previous methods relies on next(). This is why getValue(), getObject() and getArray() needs to be annotated with throws JsonParsingException and NoSuchElementException.