This is an automated email from the ASF dual-hosted git repository.

cziegeler pushed a commit to branch master
in repository 
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-feature-extension-apiregions.git


The following commit(s) were added to refs/heads/master by this push:
     new f049f71  SLING-10222 : Always report warnings
f049f71 is described below

commit f049f71d894a7ea516ec22c7ab6a60f033b8d8ab
Author: Carsten Ziegeler <[email protected]>
AuthorDate: Tue Mar 16 13:56:58 2021 +0100

    SLING-10222 : Always report warnings
---
 .../apiregions/analyser/CheckConfigurationApi.java | 48 +++++++++++-----------
 1 file changed, 23 insertions(+), 25 deletions(-)

diff --git 
a/src/main/java/org/apache/sling/feature/extension/apiregions/analyser/CheckConfigurationApi.java
 
b/src/main/java/org/apache/sling/feature/extension/apiregions/analyser/CheckConfigurationApi.java
index 56d569c..f5b01ea 100644
--- 
a/src/main/java/org/apache/sling/feature/extension/apiregions/analyser/CheckConfigurationApi.java
+++ 
b/src/main/java/org/apache/sling/feature/extension/apiregions/analyser/CheckConfigurationApi.java
@@ -43,41 +43,39 @@ public class CheckConfigurationApi implements AnalyserTask{
        public void execute(final AnalyserTaskContext context) throws Exception 
{
         final FeatureValidator validator = new FeatureValidator();
         validator.setFeatureProvider(context.getFeatureProvider());
-        
+
         final ConfigurationApi api = 
ConfigurationApi.getConfigurationApi(context.getFeature());
         if ( api == null ) {
             context.reportExtensionWarning(ConfigurationApi.EXTENSION_NAME, 
"Configuration api is not specified, unable to validate feature");
         } else {
             final FeatureValidationResult result = 
validator.validate(context.getFeature(), api);
-            if ( !result.isValid() ) {
-                for(final Map.Entry<String, PropertyValidationResult> entry : 
result.getFrameworkPropertyResults().entrySet()) {
-                    for(final String warn : entry.getValue().getWarnings()) {
-                        context.reportWarning("Framework property " + 
entry.getKey() + " : " + warn);
+            for(final Map.Entry<String, PropertyValidationResult> entry : 
result.getFrameworkPropertyResults().entrySet()) {
+                for(final String warn : entry.getValue().getWarnings()) {
+                    context.reportWarning("Framework property " + 
entry.getKey() + " : " + warn);
+                }
+                if ( !entry.getValue().isValid() ) {
+                    for(final String err : entry.getValue().getErrors()) {
+                        context.reportError("Framework property " + 
entry.getKey() + " : " + err);
                     }
-                    if ( !entry.getValue().isValid() ) {
-                        for(final String err : entry.getValue().getErrors()) {
-                            context.reportError("Framework property " + 
entry.getKey() + " : " + err);
-                        }
+                }
+            }
+            for(final Map.Entry<String, ConfigurationValidationResult> entry : 
result.getConfigurationResults().entrySet()) {
+                for(final String warn : entry.getValue().getWarnings()) {
+                    context.reportWarning("Configuration " + entry.getKey() + 
" : " + warn);
+                }
+                for(final Map.Entry<String, PropertyValidationResult> 
propEntry : entry.getValue().getPropertyResults().entrySet()) {
+                    for(final String warn : 
propEntry.getValue().getWarnings()) {
+                        context.reportWarning("Configuration " + 
entry.getKey() + "." + propEntry.getKey() + " : " + warn);
                     }
                 }
-                for(final Map.Entry<String, ConfigurationValidationResult> 
entry : result.getConfigurationResults().entrySet()) {
-                    for(final String warn : entry.getValue().getWarnings()) {
-                        context.reportWarning("Configuration " + 
entry.getKey() + " : " + warn);
+                if ( !entry.getValue().isValid() ) {
+                    for(final String err : entry.getValue().getErrors()) {
+                        context.reportError("Configuration " + entry.getKey() 
+ " : " + err);
                     }
                     for(final Map.Entry<String, PropertyValidationResult> 
propEntry : entry.getValue().getPropertyResults().entrySet()) {
-                        for(final String warn : 
propEntry.getValue().getWarnings()) {
-                            context.reportWarning("Configuration " + 
entry.getKey() + "." + propEntry.getKey() + " : " + warn);
-                        }             
-                    }
-                    if ( !entry.getValue().isValid() ) {
-                        for(final String err : entry.getValue().getErrors()) {
-                            context.reportError("Configuration " + 
entry.getKey() + " : " + err);
-                        }
-                        for(final Map.Entry<String, PropertyValidationResult> 
propEntry : entry.getValue().getPropertyResults().entrySet()) {
-                            if ( !propEntry.getValue().isValid() ) {
-                                for(final String err : 
propEntry.getValue().getErrors()) {
-                                    context.reportError("Configuration " + 
entry.getKey() + "." + propEntry.getKey() + " : " + err);
-                                }
+                        if ( !propEntry.getValue().isValid() ) {
+                            for(final String err : 
propEntry.getValue().getErrors()) {
+                                context.reportError("Configuration " + 
entry.getKey() + "." + propEntry.getKey() + " : " + err);
                             }
                         }
                     }

Reply via email to