← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 4713: Codestyle

 

------------------------------------------------------------
revno: 4713
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2011-09-27 13:46:52 +0200
message:
  Codestyle
modified:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/RemoveDataElementAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/UpdateDataElementAction.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-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/RemoveDataElementAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/RemoveDataElementAction.java	2010-12-22 04:05:46 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/RemoveDataElementAction.java	2011-09-27 11:46:52 +0000
@@ -27,8 +27,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.Set;
-
 import org.hisp.dhis.common.DeleteNotAllowedException;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementService;
@@ -102,12 +100,10 @@
         try
         {
             DataElement dataElement = dataElementService.getDataElement( id );
-            Set<DataSet> dataSets = dataElement.getDataSets();
-            for(DataSet dataSet : dataSets){
-                if(dataSet.getMobile() != null && dataSet.getMobile()){
-                    dataSet.setVersion( dataSet.getVersion() + 1 );
-                    dataSetService.updateDataSet( dataSet );
-                }                
+            
+            for ( DataSet dataSet : dataElement.getDataSets() )
+            {
+                dataSetService.updateDataSet( dataSet.increaseVersion() );
             }
             
             dataElementService.deleteDataElement( dataElementService.getDataElement( id ) );
@@ -120,8 +116,7 @@
                 
                 return ERROR;
             }
-        }
-        
+        }        
         
         return SUCCESS;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/UpdateDataElementAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/UpdateDataElementAction.java	2011-09-22 10:32:21 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/UpdateDataElementAction.java	2011-09-27 11:46:52 +0000
@@ -265,11 +265,7 @@
 
         for ( DataSet dataSet : dataSets )
         {
-            if ( dataSet.getMobile() != null && dataSet.getMobile() )
-            {
-                dataSet.setVersion( dataSet.getVersion() + 1 );
-                dataSetService.updateDataSet( dataSet );
-            }
+            dataSetService.updateDataSet( dataSet.increaseVersion() );
         }
 
         if ( jsonAttributeValues != null )