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:
[email protected]


With regards,
Apache Git Services

Reply via email to