-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Code cleanup: UnitOfWorkInvoker and UnitOfWorkInvokerFactory (#98)
* Update obsolete javadoc comment in UnitOfWorkInvoker. Dropwizard made UnitOfWorkAspect public a long time ago, in version 1.1.0. * Modify UnitOfWorkInvoker#invoke to use try-with-resources for the Hibernate Session, and wrap the Map#get call with requireNonNull since the containsKey check returned true. Remove redundant RuntimeException type parameter in call to rethrow. * Use var in UnitOfWorkInvokerFactory for the ImmutableMap.Builder to reduce code verbosity * Refactor logic in UnitOfWorkInvokerFactory so that it doesn't reassign a local variable. Instead, if the "unitOfWorkMethods" map is empty, return the rootInvoker. This inverts the logic and is clearer, since re-assigning variables is generally not a good practice.
- Loading branch information
1 parent
765df61
commit 0944487
Showing
2 changed files
with
20 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters