yasson icon indicating copy to clipboard operation
yasson copied to clipboard

YassonParser does not implement JsonParser.currentEvent()

Open nibsi opened this issue 2 years ago • 0 comments

Describe the bug Version 2.1 of the Jakarta JSON Processing API added the method currentEvent() to the JsonParser interface. This method has a default implementation that throws UnsupportedOperationException.

Yasson implements JSON-P 2.1, but it does not override the default implementation for JsonParser.currentEvent().

This is likely an oversight. It's easy to miss new methods in interfaces when they have a default implementation.

To Reproduce

  • Initialize a YassonParser parser.
  • Call parser.next()
  • Call parser.currentEvent()
  • Observe that UnsupportedOperationException is thrown.

Expected behavior

  • parser.currentEvent() returns the last event returned by parser.next().

nibsi avatar Aug 17 '23 14:08 nibsi