← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 21699: minor fix, change NonUniqueAttributeValueException from checked to unchecked exception

 

------------------------------------------------------------
revno: 21699
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2016-01-12 17:20:27 +0700
message:
  minor fix, change NonUniqueAttributeValueException from checked to unchecked exception
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/exception/NonUniqueAttributeValueException.java
  dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/datavalueset/DataValueSetServiceTest.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/exception/NonUniqueAttributeValueException.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/exception/NonUniqueAttributeValueException.java	2016-01-04 02:27:49 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/exception/NonUniqueAttributeValueException.java	2016-01-12 10:20:27 +0000
@@ -33,7 +33,7 @@
 /**
  * @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
  */
-public class NonUniqueAttributeValueException extends Exception
+public class NonUniqueAttributeValueException extends RuntimeException
 {
     public NonUniqueAttributeValueException( AttributeValue attributeValue )
     {

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/datavalueset/DataValueSetServiceTest.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/datavalueset/DataValueSetServiceTest.java	2016-01-04 02:27:49 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/datavalueset/DataValueSetServiceTest.java	2016-01-12 10:20:27 +0000
@@ -33,7 +33,6 @@
 import org.hisp.dhis.attribute.Attribute;
 import org.hisp.dhis.attribute.AttributeService;
 import org.hisp.dhis.attribute.AttributeValue;
-import org.hisp.dhis.attribute.exception.NonUniqueAttributeValueException;
 import org.hisp.dhis.common.IdSchemes;
 import org.hisp.dhis.common.IdentifiableObject;
 import org.hisp.dhis.common.IdentifiableObjectManager;
@@ -144,14 +143,7 @@
     private AttributeValue addAttributeValue( IdentifiableObject identifiableObject, Attribute attribute, String value )
     {
         AttributeValue attributeValue = new AttributeValue( value, attribute );
-
-        try
-        {
-            attributeService.addAttributeValue( identifiableObject, attributeValue );
-        }
-        catch ( NonUniqueAttributeValueException ignored )
-        {
-        }
+        attributeService.addAttributeValue( identifiableObject, attributeValue );
 
         return attributeValue;
     }