You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by de...@apache.org on 2018/09/28 12:54:33 UTC

[cxf] branch master updated: simplify code

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 ffff30f  simplify code
ffff30f is described below

commit ffff30fdd8fc1b5987158d7d9fec8349b9d735d2
Author: Dennis Kieselhorst <ma...@dekies.de>
AuthorDate: Fri Sep 28 14:53:56 2018 +0200

    simplify code
---
 .../main/java/org/apache/cxf/jaxrs/openapi/OpenApiFeature.java | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

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 05cc578..df7000e 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
@@ -111,12 +111,8 @@ public class OpenApiFeature extends AbstractFeature implements SwaggerUiSupport,
 
         DefaultApplication(final List<ClassResourceInfo> cris, final Set<String> resourcePackages) {
             this.serviceClasses = cris.stream().map(ClassResourceInfo::getServiceClass).
-                    filter(cls -> {
-                        return resourcePackages == null || resourcePackages.isEmpty()
-                            ? true
-                                : resourcePackages.stream().
-                                anyMatch(pkg -> cls.getPackage().getName().startsWith(pkg));
-                    }).collect(Collectors.toSet());
+                    filter(cls -> (resourcePackages == null || resourcePackages.isEmpty()) || resourcePackages.stream().
+                            anyMatch(pkg -> cls.getPackage().getName().startsWith(pkg))).collect(Collectors.toSet());
         }
 
         @Override
@@ -578,7 +574,7 @@ public class OpenApiFeature extends AbstractFeature implements SwaggerUiSupport,
     
         boolean hasComponents = false;
         if (securityDefinitions != null && !securityDefinitions.isEmpty()) {
-            securityDefinitions.forEach((key, value) -> components.addSecuritySchemes(key, value));
+            securityDefinitions.forEach(components::addSecuritySchemes);
             hasComponents |= true;
         }