Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JsonParser needs to have a way to get current event #303

Merged
merged 1 commit into from
Sep 30, 2021

Conversation

jbescos
Copy link
Member

@jbescos jbescos commented Sep 20, 2021

Relates to #282

@lukasj
Copy link
Contributor

lukasj commented Sep 21, 2021

@Verdent is this what you are looking for?

@Verdent
Copy link
Contributor

Verdent commented Sep 21, 2021

@jbescos @lukasj It is :-) Thank you! Just wondering, why is it default?

@jbescos
Copy link
Member Author

jbescos commented Sep 21, 2021

@jbescos @lukasj It is :-) Thank you! Just wondering, why is it default?

In this way, the implementations of jsonp can compile without implementing this method immediately.

I am not sure if this is something we need to be worried about, but I saw there are already other default methods in the interface, so I was following that convention.

@lukasj
Copy link
Contributor

lukasj commented Sep 21, 2021

using default is the only way to not break backward compatibility of the interface; w/o that every vendor would be required to implement it ...

@Verdent
Copy link
Contributor

Verdent commented Sep 21, 2021

Sure, I was just wondering :-)

*/
default public Event currentEvent() {
throw new UnsupportedOperationException();
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd move this next to other event related methods (likely after the next()) and improved javadoc to look more consistent with the rest. Ie return could be updated to @return the event for the current parsing state

Signed-off-by: Jorge Bescos Gascon <jorge.bescos.gascon@oracle.com>
Copy link
Contributor

@lukasj lukasj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@lukasj lukasj linked an issue Sep 30, 2021 that may be closed by this pull request
@lukasj lukasj merged commit d166d5d into jakartaee:master Sep 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JsonParser needs to have a way to get current event
3 participants