I will collect several PRs here since there are many places where the code can be simplified and putting all in a single PR will be hard to review.
resource handling: use try-with resources to reduce complexity and handle corner cases correctly; don't re-implement JDK functionality
remove unnecessary explicit boxing and unboxing
simplify operations on collections, for example use Map.putIfAbsent()/computeIfAbsent() and others
collapse Exceptions with the same catch clauses
replace StringBuffer with StringBuilder
Please keep this one open for the time being, I will provide iterative PRs.
I will collect several PRs here since there are many places where the code can be simplified and putting all in a single PR will be hard to review.
resource handling: use try-with resources to reduce complexity and handle corner cases correctly; don't re-implement JDK functionalityremove unnecessary explicit boxing and unboxingsimplify operations on collections, for example use Map.putIfAbsent()/computeIfAbsent() and otherscollapse Exceptions with the same catch clausesreplace StringBuffer with StringBuilderPlease keep this one open for the time being, I will provide iterative PRs.