You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@atlas.apache.org by GitBox <gi...@apache.org> on 2019/03/12 06:10:20 UTC

[GitHub] [atlas] mneethiraj commented on a change in pull request #29: ATLAS-2933:Empty array attributes are returned as null instead of an empty list

mneethiraj commented on a change in pull request #29: ATLAS-2933:Empty array attributes are returned as null instead of an empty list
URL: https://github.com/apache/atlas/pull/29#discussion_r264532760
 
 

 ##########
 File path: repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasGraphUtilsV2.java
 ##########
 @@ -207,12 +207,15 @@ public static AtlasVertex addProperty(AtlasVertex vertex, String propertyName, O
         Object existingValue = element.getProperty(propertyName, Object.class);
 
         if (value == null || (value instanceof Collection && ((Collection)value).isEmpty())) {
 
 Review comment:
   Consider the following alternate, for easier readability:
   
   ```
   if (value == null) {
     if (existingValue != null) {
       if (LOG.isDebugEnabled()) {
         LOG.debug("Removing property {} from {}", propertyName, toString(element));
       }
   
       element.removeProperty(propertyName);
     }
   } else {
     element.setProperty(propertyName, value);
   }
   
   ```
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services