diff --git a/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java b/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java index fbdc15a59..eb0830d7f 100644 --- a/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java +++ b/springdoc-openapi-starter-common/src/main/java/org/springdoc/api/AbstractOpenApiResource.java @@ -689,7 +689,7 @@ protected void getRouterFunctionPaths(String beanName, AbstractRouterFunctionVis boolean withRouterOperation = routerFunctionVisitor.getRouterFunctionDatas().stream() .anyMatch(routerFunctionData -> routerFunctionData.getAttributes().containsKey(OPERATION_ATTRIBUTE)); if (withRouterOperation) { - List operationList = routerFunctionVisitor.getRouterFunctionDatas().stream().map(RouterOperation::new).collect(Collectors.toList()); + List operationList = routerFunctionVisitor.getRouterFunctionDatas().stream().map(RouterOperation::new).toList(); calculatePath(operationList, locale, openAPI); } else { @@ -704,9 +704,9 @@ protected void getRouterFunctionPaths(String beanName, AbstractRouterFunctionVis else routerOperationList.addAll(Arrays.asList(routerOperations.value())); if (routerOperationList.size() == 1) - calculatePath(routerOperationList.stream().map(routerOperation -> new RouterOperation(routerOperation, routerFunctionVisitor.getRouterFunctionDatas().get(0))).collect(Collectors.toList()), locale, openAPI); + calculatePath(routerOperationList.stream().map(routerOperation -> new RouterOperation(routerOperation, routerFunctionVisitor.getRouterFunctionDatas().get(0))).toList(), locale, openAPI); else { - List operationList = routerOperationList.stream().map(RouterOperation::new).collect(Collectors.toList()); + List operationList = routerOperationList.stream().map(RouterOperation::new).toList(); mergeRouters(routerFunctionVisitor.getRouterFunctionDatas(), operationList); calculatePath(operationList, locale, openAPI); }