For an example of "modern Java" I would point at something like this (which I wrote, sorry about the hubris):
For an example of "modern Java" I would point at something like this (which I wrote, sorry about the hubris):
Checked exceptions get a bad rep, but I've frequently found taking advantage of their hierarchical nature can be beneficial to at least making them less bad to catch. When I work with languages that have no exception support at all, I sometimes even miss them.
Comment for a method says "null safe" - why not use an annotation?
A package called "util" is a code smell for me.
UrlUtils only provides two methods for URL encoding so why not name it appropriately?
How would you refactor this to avoid a util package or a UrlUtils class?
The problem with checked exceptions is that methods throwing them force its callers to react to the even if they are irrelevant to them. In 99% of cases I don't have any JSON specific error handling, yet Jackson forces me to do a try-catch-rethrow ceremony in thpse 99% to declare I don't want to do anything specific.