=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/AttributeUtils.java' --- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/AttributeUtils.java 2011-12-26 10:07:59 +0000 +++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/AttributeUtils.java 2012-04-23 14:24:47 +0000 @@ -27,17 +27,16 @@ package org.hisp.dhis.system.util; +import net.sf.json.JSONObject; +import org.hisp.dhis.attribute.Attribute; +import org.hisp.dhis.attribute.AttributeService; +import org.hisp.dhis.attribute.AttributeValue; + import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; -import net.sf.json.JSONObject; - -import org.hisp.dhis.attribute.Attribute; -import org.hisp.dhis.attribute.AttributeService; -import org.hisp.dhis.attribute.AttributeValue; - /** * @author mortenoh */ @@ -45,11 +44,11 @@ { /** * Given a list of JSON formatted values (with keys: 'id' and 'value'), this - * method will add/update AttributeValue into the given Set. - * + * method will add/update {@link AttributeValue} into the given {@code Set}. + * * @param jsonAttributeValues List of JSON formatted values, needs two keys: - * id => ID of attribute this value belongs to value => Actual value - * @param attributeValues Set that will be updated + * id => ID of attribute this value belongs to value => Actual value + * @param attributeValues Set that will be updated * @param attributeService */ public static void updateAttributeValuesFromJson( Set attributeValues, @@ -65,7 +64,7 @@ Attribute attribute = attributeService.getAttribute( attributeValue.getId() ); - if ( attribute == null ) + if ( attribute == null || attributeValue.getValue() == null || attributeValue.getValue().length() == 0 ) { continue; } @@ -91,7 +90,6 @@ } /** - * * @param attributeValues * @return Map of */