cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject [cxf] branch master updated: [CXF-7525] simplified forEach
Date Wed, 31 Jan 2018 20:30:59 GMT
This is an automated email from the ASF dual-hosted git repository.

deki pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cxf.git


The following commit(s) were added to refs/heads/master by this push:
     new 8cd828e  [CXF-7525] simplified forEach
8cd828e is described below

commit 8cd828eaf0e1070a0a5f6544cb26e8ed9c6fe8cd
Author: Dennis Kieselhorst <deki@apache.org>
AuthorDate: Wed Jan 31 21:18:51 2018 +0100

    [CXF-7525] simplified forEach
---
 .../java/org/apache/cxf/jaxrs/openapi/OpenApiCustomizer.java   | 10 +++++-----
 .../main/java/org/apache/cxf/jaxrs/openapi/OpenApiFeature.java |  3 +--
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/rt/rs/description-openapi-v3/src/main/java/org/apache/cxf/jaxrs/openapi/OpenApiCustomizer.java
b/rt/rs/description-openapi-v3/src/main/java/org/apache/cxf/jaxrs/openapi/OpenApiCustomizer.java
index 3486f4a..4f033fc 100644
--- a/rt/rs/description-openapi-v3/src/main/java/org/apache/cxf/jaxrs/openapi/OpenApiCustomizer.java
+++ b/rt/rs/description-openapi-v3/src/main/java/org/apache/cxf/jaxrs/openapi/OpenApiCustomizer.java
@@ -90,10 +90,10 @@ public class OpenApiCustomizer {
             });
 
             List<Tag> tags = new ArrayList<>();
-            oas.getPaths().entrySet().forEach(entry -> {
+            oas.getPaths().forEach((pathKey, pathItem) -> {
                 Tag tag = null;
-                if (replaceTags && operations.containsKey(entry.getKey())) {
-                    ClassResourceInfo cri = operations.get(entry.getKey());
+                if (replaceTags && operations.containsKey(pathKey)) {
+                    ClassResourceInfo cri = operations.get(pathKey);
 
                     tag = new Tag();
                     tag.setName(cri.getURITemplate().getValue().replaceAll("/", "_"));
@@ -106,12 +106,12 @@ public class OpenApiCustomizer {
                     }
                 }
 
-                for (Map.Entry<HttpMethod, Operation> subentry : entry.getValue().readOperationsMap().entrySet())
{
+                for (Map.Entry<HttpMethod, Operation> subentry : pathItem.readOperationsMap().entrySet())
{
                     if (replaceTags && tag != null) {
                         subentry.getValue().setTags(Collections.singletonList(tag.getName()));
                     }
 
-                    Pair<String, String> key = Pair.of(subentry.getKey().name(), entry.getKey());
+                    Pair<String, String> key = Pair.of(subentry.getKey().name(), pathKey);
                     if (methods.containsKey(key) && javadocProvider != null) {
                         OperationResourceInfo ori = methods.get(key);
 
diff --git a/rt/rs/description-openapi-v3/src/main/java/org/apache/cxf/jaxrs/openapi/OpenApiFeature.java
b/rt/rs/description-openapi-v3/src/main/java/org/apache/cxf/jaxrs/openapi/OpenApiFeature.java
index abfbe00..ef6f2f3 100644
--- a/rt/rs/description-openapi-v3/src/main/java/org/apache/cxf/jaxrs/openapi/OpenApiFeature.java
+++ b/rt/rs/description-openapi-v3/src/main/java/org/apache/cxf/jaxrs/openapi/OpenApiFeature.java
@@ -535,8 +535,7 @@ public class OpenApiFeature extends AbstractFeature implements SwaggerUiSupport,
     
         boolean hasComponents = false;
         if (securityDefinitions != null && !securityDefinitions.isEmpty()) {
-            securityDefinitions.entrySet().forEach(entry ->
-                components.addSecuritySchemes(entry.getKey(), entry.getValue()));
+            securityDefinitions.forEach((key, value) -> components.addSecuritySchemes(key,
value));
             hasComponents |= true;
         }
         

-- 
To stop receiving notification emails like this one, please contact
deki@apache.org.

Mime
View raw message