← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 18607: Code style

 

------------------------------------------------------------
revno: 18607
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2015-03-16 09:43:56 +0100
message:
  Code style
modified:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/AddProgramStageAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/UpdateProgramStageAction.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-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/AddProgramStageAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/AddProgramStageAction.java	2015-03-16 08:11:46 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/AddProgramStageAction.java	2015-03-16 08:43:56 +0000
@@ -56,7 +56,6 @@
 /**
  * @author Abyot Asalefew Gizaw
  * @modified Tran Thanh Tri
- * @version $Id$
  */
 public class AddProgramStageAction
     implements Action
@@ -379,17 +378,17 @@
         programStage.setValidCompleteOnly( validCompleteOnly );
         
         periodTypeName = StringUtils.trimToNull( periodTypeName );
-        
-        if( periodTypeName != null )
+
+        if ( periodTypeName != null )
         {
             PeriodType periodType = PeriodType.getPeriodTypeByName( periodTypeName );
             programStage.setPeriodType( periodService.getPeriodTypeByClass( periodType.getClass() ) );
         }
-        else{
+        else
+        {
             programStage.setPeriodType( null );
         }
         
-        
         if ( program.isSingleEvent() )
         {
             programStage.setAutoGenerateEvent( true );
@@ -398,6 +397,7 @@
         {
             programStage.setAutoGenerateEvent( autoGenerateEvent );
         }
+        
         programStage.setCaptureCoordinates( captureCoordinates );
         programStage.setBlockEntryForm( blockEntryForm );
         programStage.setRemindCompleted( remindCompleted );
@@ -416,8 +416,8 @@
             ProgramIndicator indicator = programIndicatorService.getProgramIndicator( id );
             programIndicators.add( indicator );
         }
+        
         programStage.setProgramIndicators( programIndicators );
-
       
         // SMS Reminder
 
@@ -431,6 +431,7 @@
             reminder.setSendTo( sendTo.get( i ) );
             reminder.setWhenToSend( whenToSend.get( i ) );
             reminder.setMessageType( messageType.get( i ) );
+            
             if ( sendTo.get( i ) == TrackedEntityInstanceReminder.SEND_TO_USER_GROUP )
             {
                 UserGroup selectedUserGroup = userGroupService.getUserGroup( userGroup.get( i ) );
@@ -440,8 +441,10 @@
             {
                 reminder.setUserGroup( null );
             }
+            
             reminders.add( reminder );
         }
+        
         programStage.setReminders( reminders );
         program.getProgramStages().add( programStage );
 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/UpdateProgramStageAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/UpdateProgramStageAction.java	2015-03-16 08:11:46 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programstage/UpdateProgramStageAction.java	2015-03-16 08:43:56 +0000
@@ -54,8 +54,6 @@
 
 /**
  * @author Abyot Asalefew Gizaw
- * @version $Id$
- * @modified Tran Thanh Tri
  */
 public class UpdateProgramStageAction
     implements Action
@@ -381,16 +379,17 @@
         programStage.setPreGenerateUID( preGenerateUID );
         
         periodTypeName = StringUtils.trimToNull( periodTypeName );
-        
-        if( periodTypeName != null )
+
+        if ( periodTypeName != null )
         {
             PeriodType periodType = PeriodType.getPeriodTypeByName( periodTypeName );
             programStage.setPeriodType( periodService.getPeriodTypeByClass( periodType.getClass() ) );
         }
-        else{
+        else
+        {
             programStage.setPeriodType( null );
         }
-        
+
         if ( programStage.getProgram().isSingleEvent() )
         {
             programStage.setAutoGenerateEvent( true );
@@ -411,11 +410,13 @@
             ProgramIndicator indicator = programIndicatorService.getProgramIndicator( id );
             programIndicators.add( indicator );
         }
+        
         programStage.setProgramIndicators( programIndicators );
         
         // SMS Reminder
         
         programStage.getReminders().clear();
+        
         Set<TrackedEntityInstanceReminder> reminders = new HashSet<>();
         for ( int i = 0; i < this.daysAllowedSendMessages.size(); i++ )
         {
@@ -435,8 +436,10 @@
             {
                 reminder.setUserGroup( null );
             }
+            
             reminders.add( reminder );
         }
+        
         programStage.setReminders( reminders );
         programStageService.updateProgramStage( programStage );