← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 1112: Fix to some warnings reported by Hudson

 

------------------------------------------------------------
revno: 1112
committer: abyot <abyota@xxxxxxxxx>
branch nick: trunk
timestamp: Tue 2009-11-24 17:26:10 +0100
message:
  Fix to some warnings reported by Hudson
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GenerateReportAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/visitplan/VisitPlanAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/ProgramEnrollmentAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/ProgramEnrollmentSelectAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/RemovePatientAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/ShowAddPatientFormAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/ValidatePatientAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/ValidatePatientProgramEnrollmentAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/programstage/RemoveProgramStageAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/relationship/RemoveRelationshipTypeAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/relationship/RemoveRepresentativeAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/relationship/SaveRepresentativeAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/relationship/ShowRelationshipListAction.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-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GenerateReportAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GenerateReportAction.java	2009-11-19 19:31:31 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GenerateReportAction.java	2009-11-24 16:26:10 +0000
@@ -53,6 +53,7 @@
     implements Action
 {
     public static final String RED = "#ff0000";
+
     public static final String YELLOW = "#ffff00";
 
     // -------------------------------------------------------------------------
@@ -119,13 +120,6 @@
         return programs;
     }
 
-    private Collection<ProgramStage> programStages;
-
-    public Collection<ProgramStage> getProgramStages()
-    {
-        return programStages;
-    }
-
     private Integer programId;
 
     public Integer getProgramId()

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/visitplan/VisitPlanAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/visitplan/VisitPlanAction.java	2009-11-19 19:31:31 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/visitplan/VisitPlanAction.java	2009-11-24 16:26:10 +0000
@@ -192,20 +192,18 @@
         // Get all the programs the facility is providing
         // ---------------------------------------------------------------------
 
-        Collection<Program> programs = new ArrayList<Program>();
-
-        programs = programService.getPrograms( organisationUnit );
+        Collection<Program> programs = programService.getPrograms( organisationUnit );
+        
 
         if ( programs.size() > 0 )
         {
-            Collection<ProgramInstance> programInstances = new ArrayList<ProgramInstance>();
 
             // -----------------------------------------------------------------
             // For all the programs a facility is servicing get the active
             // instances completed = false
             // -----------------------------------------------------------------
 
-            programInstances = programInstanceService.getProgramInstances( programs, false );
+            Collection<ProgramInstance> programInstances = programInstanceService.getProgramInstances( programs, false );
 
             // -----------------------------------------------------------------
             // For all the active program instances determine the next visits

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/ProgramEnrollmentAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/ProgramEnrollmentAction.java	2009-10-28 19:47:26 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/ProgramEnrollmentAction.java	2009-11-24 16:26:10 +0000
@@ -124,21 +124,8 @@
     public Collection<Program> getPrograms()
     {
         return programs;
-    }
-
-    private Collection<ProgramStage> programStages;
-
-    public Collection<ProgramStage> getProgramStages()
-    {
-        return programStages;
-    }
-
-    private String message;
-
-    public String getMessage()
-    {
-        return message;
-    }
+    }    
+    
 
     private ProgramInstance programInstance;
 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/ProgramEnrollmentSelectAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/ProgramEnrollmentSelectAction.java	2009-11-24 11:23:48 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/ProgramEnrollmentSelectAction.java	2009-11-24 16:26:10 +0000
@@ -119,14 +119,7 @@
     public Collection<Program> getPrograms()
     {
         return programs;
-    }
-
-    private Collection<ProgramStage> programStages;
-
-    public Collection<ProgramStage> getProgramStages()
-    {
-        return programStages;
-    }
+    }   
 
     private ProgramInstance programInstance;
 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/RemovePatientAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/RemovePatientAction.java	2009-10-11 17:27:07 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/RemovePatientAction.java	2009-11-24 16:26:10 +0000
@@ -42,7 +42,7 @@
     // -------------------------------------------------------------------------
     // Dependencies
     // -------------------------------------------------------------------------
-                           
+
     private PatientService patientService;
 
     public void setPatientService( PatientService patientService )
@@ -60,13 +60,6 @@
     {
         this.id = id;
     }
-    
-    private String message;
-
-    public String getMessage()
-    {
-        return message;
-    }
 
     // -------------------------------------------------------------------------
     // Action implementation

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/ShowAddPatientFormAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/ShowAddPatientFormAction.java	2009-10-22 07:37:47 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/ShowAddPatientFormAction.java	2009-11-24 16:26:10 +0000
@@ -61,27 +61,19 @@
     public void setPatientIdentifierService( PatientIdentifierService patientIdentifierService )
     {
         this.patientIdentifierService = patientIdentifierService;
-    }    
-    
+    }
+
     // -------------------------------------------------------------------------
     // Input/Output
     // -------------------------------------------------------------------------
 
-    private PatientIdentifier patientIdentifier;
-
-    public PatientIdentifier getPatientIdentifier()
-    {
-        return patientIdentifier;
-    }
-
     private String identifier;
 
     public String getIdentifier()
     {
         return identifier;
     }
-    
-  
+
     // -------------------------------------------------------------------------
     // Action implementation
     // -------------------------------------------------------------------------
@@ -90,7 +82,7 @@
     {
         OrganisationUnit organisationUnit = selectionManager.getSelectedOrganisationUnit();
 
-        identifier = patientIdentifierService.getNextIdentifierForOrgUnit( organisationUnit );        
+        identifier = patientIdentifierService.getNextIdentifierForOrgUnit( organisationUnit );
 
         return SUCCESS;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/ValidatePatientAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/ValidatePatientAction.java	2009-10-28 19:47:26 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/ValidatePatientAction.java	2009-11-24 16:26:10 +0000
@@ -140,21 +140,28 @@
             return INPUT;
         }
 
-        else
+        if ( firstName != null )
         {
             firstName = firstName.trim();
+        }
+
+        if ( middleName != null )
+        {
             middleName = middleName.trim();
+        }
+
+        if ( lastName != null )
+        {
             lastName = lastName.trim();
-
-            if ( firstName.length() == 0 && middleName.length() == 0 && lastName.length() == 0 )
-            {
-                message = i18n.getString( "specfiy_name_s" );
-
-                return INPUT;
-            }
-        }   
-        
-        if( age == null && birthDate == null )
+        }
+        if ( firstName.length() == 0 && middleName.length() == 0 && lastName.length() == 0 )
+        {
+            message = i18n.getString( "specfiy_name_s" );
+
+            return INPUT;
+        }
+
+        if ( age == null && birthDate == null )
         {
             message = i18n.getString( "specfiy_birth_date_or_age" );
 
@@ -178,14 +185,14 @@
             }
             else
             {
-                if( age == null )
+                if ( age == null )
                 {
                     message = i18n.getString( "specfiy_birth_date_or_age" );
 
                     return INPUT;
-                }                
+                }
             }
-        }        
+        }
 
         // ---------------------------------------------------------------------
         // Validation success

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/ValidatePatientProgramEnrollmentAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/ValidatePatientProgramEnrollmentAction.java	2009-10-24 09:32:01 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/ValidatePatientProgramEnrollmentAction.java	2009-11-24 16:26:10 +0000
@@ -90,7 +90,7 @@
 
     public String execute()
         throws Exception
-    {        
+    {
 
         if ( enrollmentDate == null )
         {
@@ -101,28 +101,25 @@
 
         else
         {
-            if ( enrollmentDate != null )
-            {
-                enrollmentDate = enrollmentDate.trim();
-
-                if ( enrollmentDate.length() == 0 )
+            enrollmentDate = enrollmentDate.trim();
+
+            if ( enrollmentDate.length() == 0 )
+            {
+                message = i18n.getString( "please_specify_enrollment_date" );
+
+                return INPUT;
+            }
+
+            if ( enrollmentDate.length() != 0 )
+            {
+                Date DateOfEnrollment = format.parseDate( enrollmentDate );
+
+                if ( DateOfEnrollment == null )
                 {
-                    message = i18n.getString( "please_specify_enrollment_date" );
+                    message = i18n.getString( "please_specify_a_valid_enrollment_date" );
 
                     return INPUT;
                 }
-
-                if ( enrollmentDate.length() != 0 )
-                {
-                    Date DateOfEnrollment = format.parseDate( enrollmentDate );
-
-                    if ( DateOfEnrollment == null )
-                    {
-                        message = i18n.getString( "please_specify_a_valid_enrollment_date" );
-
-                        return INPUT;
-                    }
-                }
             }
         }
 
@@ -135,28 +132,25 @@
 
         else
         {
-            if ( dateOfIncident != null )
+            dateOfIncident = dateOfIncident.trim();
+
+            if ( dateOfIncident.length() == 0 )
             {
                 message = i18n.getString( "please_specify_date_of_incident" );
 
-                dateOfIncident = dateOfIncident.trim();
-
-                if ( dateOfIncident.length() == 0 )
+                return INPUT;
+            }
+
+            if ( dateOfIncident.length() != 0 )
+            {
+                Date DateOfIncident = format.parseDate( dateOfIncident );
+
+                if ( DateOfIncident == null )
                 {
+                    message = i18n.getString( "please_specify_a_valid_date_of_incident" );
+
                     return INPUT;
                 }
-
-                if ( dateOfIncident.length() != 0 )
-                {
-                    Date DateOfIncident = format.parseDate( dateOfIncident );
-
-                    if ( DateOfIncident == null )
-                    {
-                        message = i18n.getString( "please_specify_a_valid_date_of_incident" );
-
-                        return INPUT;
-                    }
-                }
             }
         }
 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/programstage/RemoveProgramStageAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/programstage/RemoveProgramStageAction.java	2009-11-11 00:05:58 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/programstage/RemoveProgramStageAction.java	2009-11-24 16:26:10 +0000
@@ -60,13 +60,6 @@
         this.id = id;
     }
 
-    private String message;
-
-    public String getMessage()
-    {
-        return message;
-    }
-
     // -------------------------------------------------------------------------
     // Action implementation
     // -------------------------------------------------------------------------

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/relationship/RemoveRelationshipTypeAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/relationship/RemoveRelationshipTypeAction.java	2009-11-11 00:05:58 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/relationship/RemoveRelationshipTypeAction.java	2009-11-24 16:26:10 +0000
@@ -60,13 +60,6 @@
     {
         this.id = id;
     }
-    
-    private String message;
-
-    public String getMessage()
-    {
-        return message;
-    }
 
     // -------------------------------------------------------------------------
     // Action implementation

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/relationship/RemoveRepresentativeAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/relationship/RemoveRepresentativeAction.java	2009-11-12 11:27:02 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/relationship/RemoveRepresentativeAction.java	2009-11-24 16:26:10 +0000
@@ -69,13 +69,6 @@
         return patient;
     }
 
-    private String message;
-
-    public String getMessage()
-    {
-        return message;
-    }
-
     // -------------------------------------------------------------------------
     // Action implementation
     // -------------------------------------------------------------------------

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/relationship/SaveRepresentativeAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/relationship/SaveRepresentativeAction.java	2009-11-12 11:27:02 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/relationship/SaveRepresentativeAction.java	2009-11-24 16:26:10 +0000
@@ -91,13 +91,6 @@
         this.copyAttribute = copyAttribute;
     }
 
-    private String message;
-
-    public String getMessage()
-    {
-        return message;
-    }
-
     // -------------------------------------------------------------------------
     // Action implementation
     // -------------------------------------------------------------------------

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/relationship/ShowRelationshipListAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/relationship/ShowRelationshipListAction.java	2009-11-11 00:05:58 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/relationship/ShowRelationshipListAction.java	2009-11-24 16:26:10 +0000
@@ -81,13 +81,6 @@
         return patient;
     }
 
-    Collection<Relationship> relationships;
-
-    public Collection<Relationship> getRelationships()
-    {
-        return relationships;
-    }
-
     // -------------------------------------------------------------------------
     // Action implementation
     // -------------------------------------------------------------------------