sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1784118 - in /sling/trunk/bundles/extensions/serviceusermapper/src/main/java/org/apache/sling/serviceusermapping/impl: MappingConfigAmendment.java ServiceUserMapperImpl.java
Date Thu, 23 Feb 2017 12:40:32 GMT
Author: cziegeler
Date: Thu Feb 23 12:40:32 2017
New Revision: 1784118

URL: http://svn.apache.org/viewvc?rev=1784118&view=rev
Log:
SLING-6555 : Migrate to R6 annotations, clean up dependencies

Modified:
    sling/trunk/bundles/extensions/serviceusermapper/src/main/java/org/apache/sling/serviceusermapping/impl/MappingConfigAmendment.java
    sling/trunk/bundles/extensions/serviceusermapper/src/main/java/org/apache/sling/serviceusermapping/impl/ServiceUserMapperImpl.java

Modified: sling/trunk/bundles/extensions/serviceusermapper/src/main/java/org/apache/sling/serviceusermapping/impl/MappingConfigAmendment.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/serviceusermapper/src/main/java/org/apache/sling/serviceusermapping/impl/MappingConfigAmendment.java?rev=1784118&r1=1784117&r2=1784118&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/serviceusermapper/src/main/java/org/apache/sling/serviceusermapping/impl/MappingConfigAmendment.java
(original)
+++ sling/trunk/bundles/extensions/serviceusermapper/src/main/java/org/apache/sling/serviceusermapping/impl/MappingConfigAmendment.java
Thu Feb 23 12:40:32 2017
@@ -68,19 +68,23 @@ public class MappingConfigAmendment impl
     void configure(final Config config) {
         final String[] props = config.user_mapping();
 
-        final ArrayList<Mapping> mappings = new ArrayList<Mapping>(props.length);
-        for (final String prop : props) {
-            if (prop != null && prop.trim().length() > 0 ) {
-                try {
-                    final Mapping mapping = new Mapping(prop.trim());
-                    mappings.add(mapping);
-                } catch (final IllegalArgumentException iae) {
-                    logger.info("configure: Ignoring '{}': {}", prop, iae.getMessage());
+        if ( props != null ) {
+            final ArrayList<Mapping> mappings = new ArrayList<Mapping>(props.length);
+            for (final String prop : props) {
+                if (prop != null && prop.trim().length() > 0 ) {
+                    try {
+                        final Mapping mapping = new Mapping(prop.trim());
+                        mappings.add(mapping);
+                    } catch (final IllegalArgumentException iae) {
+                        logger.info("configure: Ignoring '{}': {}", prop, iae.getMessage());
+                    }
                 }
             }
-        }
 
-        this.serviceUserMappings = mappings.toArray(new Mapping[mappings.size()]);
+            this.serviceUserMappings = mappings.toArray(new Mapping[mappings.size()]);
+        } else {
+            this.serviceUserMappings = new Mapping[0];
+        }
         this.serviceRanking = config.service_ranking();
     }
 

Modified: sling/trunk/bundles/extensions/serviceusermapper/src/main/java/org/apache/sling/serviceusermapping/impl/ServiceUserMapperImpl.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/serviceusermapper/src/main/java/org/apache/sling/serviceusermapping/impl/ServiceUserMapperImpl.java?rev=1784118&r1=1784117&r2=1784118&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/serviceusermapper/src/main/java/org/apache/sling/serviceusermapping/impl/ServiceUserMapperImpl.java
(original)
+++ sling/trunk/bundles/extensions/serviceusermapper/src/main/java/org/apache/sling/serviceusermapping/impl/ServiceUserMapperImpl.java
Thu Feb 23 12:40:32 2017
@@ -106,19 +106,23 @@ public class ServiceUserMapperImpl imple
 
         final String[] props = config.user_mapping();
 
-        final ArrayList<Mapping> mappings = new ArrayList<Mapping>(props.length);
-        for (final String prop : props) {
-            if (prop != null && prop.trim().length() > 0 ) {
-                try {
-                    final Mapping mapping = new Mapping(prop.trim());
-                    mappings.add(mapping);
-                } catch (final IllegalArgumentException iae) {
-                    log.error("configure: Ignoring '{}': {}", prop, iae.getMessage());
+        if ( props != null ) {
+            final ArrayList<Mapping> mappings = new ArrayList<Mapping>(props.length);
+            for (final String prop : props) {
+                if (prop != null && prop.trim().length() > 0 ) {
+                    try {
+                        final Mapping mapping = new Mapping(prop.trim());
+                        mappings.add(mapping);
+                    } catch (final IllegalArgumentException iae) {
+                        log.error("configure: Ignoring '{}': {}", prop, iae.getMessage());
+                    }
                 }
             }
-        }
 
-        this.globalServiceUserMappings = mappings.toArray(new Mapping[mappings.size()]);
+            this.globalServiceUserMappings = mappings.toArray(new Mapping[mappings.size()]);
+        } else {
+            this.globalServiceUserMappings = new Mapping[0];
+        }
         this.defaultUser = config.user_default();
 
         RegistrationSet registrationSet = null;



Mime
View raw message