Skip to content

Commit

Permalink
code review
Browse files Browse the repository at this point in the history
  • Loading branch information
bnasslahsen committed Mar 9, 2023
1 parent 2a18a66 commit 84b45e9
Showing 1 changed file with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -836,8 +836,9 @@ protected Set<RequestMethod> getDefaultAllowedHttpMethods() {
* @return the operation
*/
protected Operation customizeOperation(Operation operation, HandlerMethod handlerMethod) {
if (springDocCustomizers.getOperationCustomizers().isPresent()) {
List<OperationCustomizer> operationCustomizerList = springDocCustomizers.getOperationCustomizers().get();
Optional<List<OperationCustomizer>> optionalOperationCustomizers = springDocCustomizers.getOperationCustomizers();
if (optionalOperationCustomizers.isPresent()) {
List<OperationCustomizer> operationCustomizerList = optionalOperationCustomizers.get();
for (OperationCustomizer operationCustomizer : operationCustomizerList)
operation = operationCustomizer.customize(operation, handlerMethod);
}
Expand All @@ -846,13 +847,15 @@ protected Operation customizeOperation(Operation operation, HandlerMethod handle

/**
* Customise router operation
* @param routerOperation
* @param handlerMethod
*
* @param routerOperation the router operation
* @param handlerMethod the handler method
* @return the router operation
*/
protected RouterOperation customizeRouterOperation(RouterOperation routerOperation, HandlerMethod handlerMethod) {
if (springDocCustomizers.getRouterOperationCustomizers().isPresent()) {
List<RouterOperationCustomizer> routerOperationCustomizerList = springDocCustomizers.getRouterOperationCustomizers().get();
Optional<List<RouterOperationCustomizer>> optionalRouterOperationCustomizers = springDocCustomizers.getRouterOperationCustomizers();
if (optionalRouterOperationCustomizers.isPresent()) {
List<RouterOperationCustomizer> routerOperationCustomizerList = optionalRouterOperationCustomizers.get();
for (RouterOperationCustomizer routerOperationCustomizer : routerOperationCustomizerList) {
routerOperation = routerOperationCustomizer.customize(routerOperation, handlerMethod);
}
Expand Down Expand Up @@ -1356,8 +1359,9 @@ enum ConditionType {
* @return the router operation
*/
private RouterOperation customizeDataRestRouterOperation(RouterOperation routerOperation) {
if (springDocCustomizers.getDataRestRouterOperationCustomizers().isPresent()) {
List<DataRestRouterOperationCustomizer> dataRestRouterOperationCustomizerList = springDocCustomizers.getDataRestRouterOperationCustomizers().get();
Optional<List<DataRestRouterOperationCustomizer>> optionalDataRestRouterOperationCustomizers = springDocCustomizers.getDataRestRouterOperationCustomizers();
if (optionalDataRestRouterOperationCustomizers.isPresent()) {
List<DataRestRouterOperationCustomizer> dataRestRouterOperationCustomizerList = optionalDataRestRouterOperationCustomizers.get();
for (DataRestRouterOperationCustomizer dataRestRouterOperationCustomizer : dataRestRouterOperationCustomizerList) {
routerOperation = dataRestRouterOperationCustomizer.customize(routerOperation);
}
Expand Down

0 comments on commit 84b45e9

Please sign in to comment.