Codec Interface to Abstract class, made all paths call parseImpl/writeImpl - #892
Codec Interface to Abstract class, made all paths call parseImpl/writeImpl#892ldintr wants to merge 2 commits into
Conversation
JUnit Test Report 521 files ±0 521 suites ±0 30s ⏱️ +4s Results for commit 6ff1bff. ± Comparison against base commit fd1fa54. This pull request removes 6 and adds 6 tests. Note that renamed tests count towards both. |
Integration Test Report 428 files ±0 428 suites ±0 21m 28s ⏱️ +37s Results for commit 6ff1bff. ± Comparison against base commit fd1fa54. This pull request removes 2 and adds 2 tests. Note that renamed tests count towards both. |
anthony-swirldslabs
left a comment
There was a problem hiding this comment.
You want to add javadocs to any new protected/public methods. I also left a minor comment. Other than that, the changes look great. Thanks!
| default T parse(@NonNull ReadableSequentialData input, boolean strictMode, boolean parseUnknownFields, int maxDepth) | ||
| public final T parse( | ||
| @NonNull ReadableSequentialData input, boolean strictMode, boolean parseUnknownFields, int maxDepth) |
There was a problem hiding this comment.
Minor: I'd go as far as to actually nuke all the overloads that supply default argument values. In the current fix where these methods have simply been made final, the benefit of the code simplification is a bit small to my liking.
| return writeImpl(item, output, startOffset); | ||
| } | ||
|
|
||
| // some classes generate this overload, but not all |
There was a problem hiding this comment.
How come? Our codec generator here in PBJ is supposed to generate them (or not) unconditionally.
Also, you want to add javadocs to any public/protected methods that you introduce here.
Description:
I didn't like how classes could have a 5 signature parse call a 3 signature overload ignoring some parameters (idr where I saw that, it was outside of obj). I would rather a consistent entry (which I'll use to call throwOnError in the future), and a consistent impl.
Here's a quick look. I may change (or rebase in the future) better javadoc.
Checklist
Comments
I noticed I couldn't make this final because sometimes a class overloads it and other times there's no impl
It seems like there's a chance they cane become inconsistent