← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 11717: Patient model, consistent implementation of hashcode and equals

 

------------------------------------------------------------
revno: 11717
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2013-08-20 15:24:46 +0200
message:
  Patient model, consistent implementation of hashcode and equals
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/caseaggregation/CaseAggregationCondition.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/Patient.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientAttribute.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientAttributeGroup.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientAttributeOption.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientAudit.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientIdentifier.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientIdentifierType.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientMobileSetting.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientRegistrationForm.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientReminder.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientattributevalue/PatientAttributeValue.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientcomment/PatientComment.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientdatavalue/PatientDataValue.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientreport/PatientAggregateReport.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientreport/PatientTabularReport.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientreport/TabularReportColumn.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramExpression.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramIndicator.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramInstance.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStage.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageDataElement.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstance.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramValidation.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramValidationResult.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/SchedulingProgramObject.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/relationship/Relationship.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/relationship/RelationshipType.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/caseaggregation/CaseAggregationCondition.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/caseaggregation/CaseAggregationCondition.java	2013-07-05 07:05:20 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/caseaggregation/CaseAggregationCondition.java	2013-08-20 13:24:46 +0000
@@ -42,55 +42,34 @@
     private static final long serialVersionUID = -5746649805915250424L;
 
     public static final String SEPARATOR_ID = "\\.";
-
     public static final String SEPARATOR_OBJECT = ":";
 
     public static final String AGGRERATION_COUNT = "COUNT";
-
     public static final String AGGRERATION_SUM = "times";
-
     public static final String AGGRERATION_SUM_VALUE = "sum";
-
     public static final String AGGRERATION_AVG_VALUE = "avg";
-
     public static final String AGGRERATION_AVG_MIN = "min";
-
     public static final String AGGRERATION_AVG_MAX = "max";
 
     public static final String OPERATOR_AND = "AND";
-
     public static final String OPERATOR_OR = "OR";
 
     public static String OBJECT_PROGRAM_STAGE_DATAELEMENT = "DE";
-
     public static String OBJECT_PATIENT_ATTRIBUTE = "CA";
-
     public static String OBJECT_PATIENT_PROPERTY = "CP";
-
     public static String OBJECT_PROGRAM_PROPERTY = "PP";
-
     public static String OBJECT_PROGRAM = "PG";
-
     public static String OBJECT_PATIENT = "PT";
-
     public static String OBJECT_PROGRAM_STAGE = "PS";
-
     public static String OBJECT_PROGRAM_STAGE_PROPERTY = "PSP";
-
     public static String OBJECT_PATIENT_PROGRAM_STAGE_PROPERTY = "PC";
-
     public static String OBJECT_ORGUNIT_COMPLETE_PROGRAM_STAGE = "PSIC";
-
     public static String OBJECT_PROGRAM_PROPERTY_INCIDENT_DATE = "dateOfIncident";
-
     public static String OBJECT_PROGRAM_PROPERTY_ENROLLEMENT_DATE = "enrollmentDate";
-
     public static String OBJECT_PROGRAM_PROPERTY_REPORT_DATE_DATE = "executionDate";
 
     public static String MINUS_OPERATOR = "DATEDIFF";
-
     public static String MINUS_DATAELEMENT_OPERATOR = "DEDATEDIFF";
-
     public static String AUTO_STORED_BY = "DHIS-SYSTEM";
 
     public static final String regExp = "\\[(" + OBJECT_ORGUNIT_COMPLETE_PROGRAM_STAGE + "|" + OBJECT_PATIENT + "|"
@@ -168,29 +147,49 @@
     }
 
     @Override
-    public boolean equals( Object obj )
+    public boolean equals( Object object )
     {
-        if ( this == obj )
+        if ( this == object )
+        {
             return true;
-        if ( obj == null )
-            return false;
-        if ( getClass() != obj.getClass() )
-            return false;
-        CaseAggregationCondition other = (CaseAggregationCondition) obj;
+        }
+        
+        if ( object == null )
+        {
+            return false;
+        }
+        
+        if ( getClass() != object.getClass() )
+        {
+            return false;
+        }
+        
+        final CaseAggregationCondition other = (CaseAggregationCondition) object;
+        
         if ( aggregationExpression == null )
         {
             if ( other.aggregationExpression != null )
+            {
                 return false;
+            }
         }
         else if ( !aggregationExpression.equals( other.aggregationExpression ) )
+        {
             return false;
+        }
+        
         if ( operator == null )
         {
             if ( other.operator != null )
+            {
                 return false;
+            }
         }
         else if ( !operator.equals( other.operator ) )
+        {
             return false;
+        }
+        
         return true;
     }
 

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java	2013-08-14 11:04:31 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java	2013-08-20 13:24:46 +0000
@@ -81,35 +81,22 @@
     private static final long serialVersionUID = -7131541880444446669L;
 
     public static final String VALUE_TYPE_STRING = "string";
-
     public static final String VALUE_TYPE_INT = "int";
-
-    public static final String VALUE_TYPE_NUMBER = "number";
-    
+    public static final String VALUE_TYPE_NUMBER = "number";    
     public static final String VALUE_TYPE_USER_NAME = "username";
-
     public static final String VALUE_TYPE_POSITIVE_INT = "positiveNumber";
-
     public static final String VALUE_TYPE_NEGATIVE_INT = "negativeNumber";
-
     public static final String VALUE_TYPE_TRUE_ONLY = "trueOnly";
-
     public static final String VALUE_TYPE_TEXT = "text";
-
     public static final String VALUE_TYPE_LONG_TEXT = "longText";
-
     public static final String VALUE_TYPE_BOOL = "bool";
-
     public static final String VALUE_TYPE_DATE = "date";
 
     public static final String DOMAIN_TYPE_AGGREGATE = "aggregate";
-
     public static final String DOMAIN_TYPE_PATIENT = "patient";
 
     public static final String AGGREGATION_OPERATOR_SUM = "sum";
-
     public static final String AGGREGATION_OPERATOR_AVERAGE = "average";
-
     public static final String AGGREGATION_OPERATOR_COUNT = "count";
 
     /**

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/Patient.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/Patient.java	2013-04-04 18:06:19 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/Patient.java	2013-08-20 13:24:46 +0000
@@ -49,37 +49,25 @@
     private static final long serialVersionUID = 884114994005945275L;
 
     public static final String MALE = "M";
-
     public static final String FEMALE = "F";
-
     public static final String TRANSGENDER = "M";
 
     public static final char DOB_TYPE_VERIFIED = 'V';
-
     public static final char DOB_TYPE_DECLARED = 'D';
-
     public static final char DOB_TYPE_APPROXIATED = 'A';
 
     public static final char AGE_TYPE_YEAR = 'Y';
-
     public static final char AGE_TYPE_MONTH = 'M';
-
     public static final char AGE_TYPE_DAY = 'D';
 
     public static String PREFIX_IDENTIFIER_TYPE = "iden";
-
     public static String PREFIX_FIXED_ATTRIBUTE = "fixedAttr";
-
     public static String PREFIX_PATIENT_ATTRIBUTE = "attr";
-
     public static String PREFIX_PROGRAM = "prg";
-
     public static String PREFIX_PROGRAM_EVENT_BY_STATUS = "stat";
-
     public static String PREFIX_PROGRAM_STAGE = "prgst";
 
     public static String FIXED_ATTR_BIRTH_DATE = "birthDate";
-
     public static String FIXED_ATTR_AGE = "age";
 
     private Integer id;
@@ -147,24 +135,24 @@
     }
 
     @Override
-    public boolean equals( Object obj )
+    public boolean equals( Object object )
     {
-        if ( this == obj )
+        if ( this == object )
         {
             return true;
         }
 
-        if ( obj == null )
-        {
-            return false;
-        }
-
-        if ( getClass() != obj.getClass() )
-        {
-            return false;
-        }
-
-        final Patient other = (Patient) obj;
+        if ( object == null )
+        {
+            return false;
+        }
+
+        if ( getClass() != object.getClass() )
+        {
+            return false;
+        }
+
+        final Patient other = (Patient) object;
 
         if ( birthDate == null )
         {

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientAttribute.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientAttribute.java	2013-06-05 04:17:53 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientAttribute.java	2013-08-20 13:24:46 +0000
@@ -52,15 +52,10 @@
     private static final long serialVersionUID = 3026922158464592390L;
 
     public static final String TYPE_DATE = "date";
-
     public static final String TYPE_STRING = "string";
-
     public static final String TYPE_INT = "number";
-
     public static final String TYPE_BOOL = "bool";
-
     public static final String TYPE_TRUE_ONLY = "trueOnly";
-
     public static final String TYPE_COMBO = "combo";
 
     private String description;
@@ -102,24 +97,24 @@
     }
 
     @Override
-    public boolean equals( Object o )
+    public boolean equals( Object object )
     {
-        if ( this == o )
+        if ( this == object )
         {
             return true;
         }
 
-        if ( o == null )
-        {
-            return false;
-        }
-
-        if ( !(o instanceof PatientAttribute) )
-        {
-            return false;
-        }
-
-        final PatientAttribute other = (PatientAttribute) o;
+        if ( object == null )
+        {
+            return false;
+        }
+
+        if ( getClass() != object.getClass() )
+        {
+            return false;
+        }
+
+        final PatientAttribute other = (PatientAttribute) object;
 
         return name.equals( other.getName() );
     }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientAttributeGroup.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientAttributeGroup.java	2013-05-17 03:29:07 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientAttributeGroup.java	2013-08-20 13:24:46 +0000
@@ -78,24 +78,24 @@
     }
 
     @Override
-    public boolean equals( Object o )
+    public boolean equals( Object object )
     {
-        if ( this == o )
+        if ( this == object )
         {
             return true;
         }
 
-        if ( o == null )
-        {
-            return false;
-        }
-
-        if ( !(o instanceof PatientAttributeGroup) )
-        {
-            return false;
-        }
-
-        final PatientAttributeGroup other = (PatientAttributeGroup) o;
+        if ( object == null )
+        {
+            return false;
+        }
+
+        if ( getClass() != object.getClass() )
+        {
+            return false;
+        }
+
+        final PatientAttributeGroup other = (PatientAttributeGroup) object;
 
         return name.equals( other.getName() );
     }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientAttributeOption.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientAttributeOption.java	2011-05-05 21:14:56 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientAttributeOption.java	2013-08-20 13:24:46 +0000
@@ -65,24 +65,24 @@
     }
 
     @Override
-    public boolean equals( Object o )
+    public boolean equals( Object object )
     {
-        if ( this == o )
+        if ( this == object )
         {
             return true;
         }
 
-        if ( o == null )
-        {
-            return false;
-        }
-
-        if ( !(o instanceof PatientAttributeOption) )
-        {
-            return false;
-        }
-
-        final PatientAttributeOption other = (PatientAttributeOption) o;
+        if ( object == null )
+        {
+            return false;
+        }
+
+        if ( getClass() != object.getClass() )
+        {
+            return false;
+        }
+
+        final PatientAttributeOption other = (PatientAttributeOption) object;
 
         return name.equals( other.getName() );
     }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientAudit.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientAudit.java	2013-02-27 14:39:27 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientAudit.java	2013-08-20 13:24:46 +0000
@@ -67,6 +67,8 @@
         this.accessedModule = accessedModule;
     }
 
+    //TODO implement hashcode and equals
+    
     // -------------------------------------------------------------------------
     // Getters && Setters
     // -------------------------------------------------------------------------
@@ -120,5 +122,4 @@
     {
         this.accessedModule = accessedModule;
     }
-
 }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientIdentifier.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientIdentifier.java	2012-12-11 08:03:28 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientIdentifier.java	2013-08-20 13:24:46 +0000
@@ -65,24 +65,24 @@
         return result;
     }
 
-    public boolean equals( Object obj )
+    public boolean equals( Object object )
     {
-        if ( this == obj )
+        if ( this == object )
         {
             return true;
         }
 
-        if ( obj == null )
-        {
-            return false;
-        }
-
-        if ( !(obj instanceof PatientIdentifier) )
-        {
-            return false;
-        }
-
-        PatientIdentifier other = (PatientIdentifier) obj;
+        if ( object == null )
+        {
+            return false;
+        }
+
+        if ( getClass() != object.getClass() )
+        {
+            return false;
+        }
+
+        PatientIdentifier other = (PatientIdentifier) object;
 
         return identifier.equals( other.getIdentifier() ) && identifierType.equals( other.getIdentifierType() );
     }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientIdentifierType.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientIdentifierType.java	2013-07-02 15:18:36 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientIdentifierType.java	2013-08-20 13:24:46 +0000
@@ -91,24 +91,24 @@
     }
 
     @Override
-    public boolean equals( Object o )
+    public boolean equals( Object object )
     {
-        if ( this == o )
+        if ( this == object )
         {
             return true;
         }
 
-        if ( o == null )
-        {
-            return false;
-        }
-
-        if ( !(o instanceof PatientIdentifierType) )
-        {
-            return false;
-        }
-
-        final PatientIdentifierType other = (PatientIdentifierType) o;
+        if ( object == null )
+        {
+            return false;
+        }
+
+        if ( getClass() != object.getClass() )
+        {
+            return false;
+        }
+
+        final PatientIdentifierType other = (PatientIdentifierType) object;
 
         return name.equals( other.getName() );
     }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientMobileSetting.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientMobileSetting.java	2013-04-04 18:06:19 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientMobileSetting.java	2013-08-20 13:24:46 +0000
@@ -34,7 +34,6 @@
 public class PatientMobileSetting
     extends BaseIdentifiableObject
 {
-
     private static final long serialVersionUID = -5947521380646718129L;
 
     private Boolean gender;

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientRegistrationForm.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientRegistrationForm.java	2013-07-03 15:40:29 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientRegistrationForm.java	2013-08-20 13:24:46 +0000
@@ -35,8 +35,6 @@
 
 /**
  * @author Chau Thu Tran
- * 
- * @version PatientRegistrationForm.java 9:33:02 AM Jan 31, 2013 $
  */
 public class PatientRegistrationForm
     extends BaseIdentifiableObject
@@ -44,23 +42,14 @@
     private static final long serialVersionUID = -6000530171659755186L;
 
     public static String FIXED_ATTRIBUTE_FULLNAME = "fullName";
-
     public static String FIXED_ATTRIBUTE_GENDER = "gender";
-
     public static String FIXED_ATTRIBUTE_BIRTHDATE = "birthDate";
-
     public static String FIXED_ATTRIBUTE_AGE = "age";
-
     public static String FIXED_ATTRIBUTE_PHONE_NUMBER = "phoneNumber";
-
     public static String FIXED_ATTRIBUTE_DEATH_DATE = "deathDate";
-
     public static String FIXED_ATTRIBUTE_REGISTRATION_DATE = "registrationDate";
-
     public static String FIXED_ATTRIBUTE_IS_DEAD = "isDead";
-
     public static String FIXED_ATTRIBUTE_DOB_TYPE = "dobType";
-
     public static String FIXED_ATTRIBUTE_HEALTH_WORKER = "healthWorker";
 
     private Program program;
@@ -87,6 +76,8 @@
         this.dataEntryForm = dataEntryForm;
     }
 
+    //TODO implement hashcode and equals
+    
     // -------------------------------------------------------------------------
     // Getters && Setters
     // -------------------------------------------------------------------------

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientReminder.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientReminder.java	2013-08-07 03:44:17 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientReminder.java	2013-08-20 13:24:46 +0000
@@ -41,45 +41,28 @@
     private static final long serialVersionUID = 3101502417481903219L;
 
     public static final String DUE_DATE_TO_COMPARE = "duedate";
-
     public static final String ENROLLEMENT_DATE_TO_COMPARE = "enrollmentdate";
-
     public static final String INCIDENT_DATE_TO_COMPARE = "dateofincident";
 
     public static final String TEMPLATE_MESSSAGE_PATIENT_NAME = "{patient-name}";
-
     public static final String TEMPLATE_MESSSAGE_PROGRAM_NAME = "{program-name}";
-
     public static final String TEMPLATE_MESSSAGE_PROGAM_STAGE_NAME = "{program-stage-name}";
-
     public static final String TEMPLATE_MESSSAGE_DUE_DATE = "{due-date}";
-
     public static final String TEMPLATE_MESSSAGE_ORGUNIT_NAME = "{orgunit-name}";
-
     public static final String TEMPLATE_MESSSAGE_DAYS_SINCE_DUE_DATE = "{days-since-due-date}";
-
     public static final String TEMPLATE_MESSSAGE_INCIDENT_DATE = "{incident-date}";
-
     public static final String TEMPLATE_MESSSAGE_ENROLLMENT_DATE = "{enrollement-date}";
-
     public static final String TEMPLATE_MESSSAGE_DAYS_SINCE_ENROLLMENT_DATE = "{days-since-enrollment-date}";
-
     public static final String TEMPLATE_MESSSAGE_DAYS_SINCE_INCIDENT_DATE = "{days-since-incident-date}";
 
     public static final int SEND_TO_PATIENT = 1;
-
     public static final int SEND_TO_HEALTH_WORKER = 2;
-
     public static final int SEND_TO_ORGUGNIT_REGISTERED = 3;
-
     public static final int SEND_TO_ALL_USERS_IN_ORGUGNIT_REGISTERED = 4;
-
     public static final int SEND_TO_USER_GROUP = 5;
 
     public static final int SEND_WHEN_TO_EMROLLEMENT = 1;
-
     public static final int SEND_WHEN_TO_C0MPLETED_EVENT = 2;
-
     public static final int SEND_WHEN_TO_C0MPLETED_PROGRAM = 3;
 
     private int id;
@@ -102,6 +85,10 @@
     // Constructors
     // -------------------------------------------------------------------------
 
+    public PatientReminder()
+    {
+    }
+
     public PatientReminder( String name, Integer daysAllowedSendMessage, String templateMessage )
     {
         this.name = name;
@@ -109,6 +96,8 @@
         this.templateMessage = templateMessage;
     }
 
+    //TODO implement hashcode and equals
+    
     // -------------------------------------------------------------------------
     // Getter && Setter
     // -------------------------------------------------------------------------
@@ -183,11 +172,6 @@
         this.whenToSend = whenToSend;
     }
 
-    public PatientReminder()
-    {
-
-    }
-
     public UserGroup getUserGroup()
     {
         return userGroup;
@@ -197,5 +181,4 @@
     {
         this.userGroup = userGroup;
     }
-
 }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientattributevalue/PatientAttributeValue.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientattributevalue/PatientAttributeValue.java	2011-05-05 21:14:56 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientattributevalue/PatientAttributeValue.java	2013-08-20 13:24:46 +0000
@@ -80,24 +80,24 @@
     // -------------------------------------------------------------------------
 
     @Override
-    public boolean equals( Object o )
+    public boolean equals( Object object )
     {
-        if ( this == o )
+        if ( this == object )
         {
             return true;
         }
 
-        if ( o == null )
-        {
-            return false;
-        }
-
-        if ( !(o instanceof PatientAttributeValue) )
-        {
-            return false;
-        }
-
-        final PatientAttributeValue other = (PatientAttributeValue) o;
+        if ( object == null )
+        {
+            return false;
+        }
+
+        if ( getClass() != object.getClass() )
+        {
+            return false;
+        }
+
+        final PatientAttributeValue other = (PatientAttributeValue) object;
 
         return patientAttribute.equals( other.getPatientAttribute() ) && patient.equals( other.getPatient() );
 

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientcomment/PatientComment.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientcomment/PatientComment.java	2012-09-11 13:35:26 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientcomment/PatientComment.java	2013-08-20 13:24:46 +0000
@@ -50,7 +50,6 @@
 
     public PatientComment()
     {
-
     }
 
     public PatientComment( String commentText, String creator, Date createdDate )
@@ -59,6 +58,8 @@
         this.creator = creator;
         this.createdDate = createdDate;
     }
+    
+    //TODO implement hashcode and equals
 
     // -------------------------------------------------------------------------
     // Getters/Setters
@@ -103,5 +104,4 @@
     {
         this.creator = creator;
     }
-
 }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientdatavalue/PatientDataValue.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientdatavalue/PatientDataValue.java	2013-02-13 03:00:36 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientdatavalue/PatientDataValue.java	2013-08-20 13:24:46 +0000
@@ -35,7 +35,6 @@
 
 /**
  * @author Abyot Asalefew Gizaw
- * @version $Id$
  */
 public class PatientDataValue
     implements Serializable
@@ -102,29 +101,49 @@
     }
 
     @Override
-    public boolean equals( Object obj )
+    public boolean equals( Object object )
     {
-        if ( this == obj )
+        if ( this == object )
+        {
             return true;
-        if ( obj == null )
-            return false;
-        if ( getClass() != obj.getClass() )
-            return false;
-        PatientDataValue other = (PatientDataValue) obj;
+        }
+        
+        if ( object == null )
+        {
+            return false;
+        }
+        
+        if ( getClass() != object.getClass() )
+        {
+            return false;
+        }
+        
+        final PatientDataValue other = (PatientDataValue) object;
+        
         if ( dataElement == null )
         {
             if ( other.dataElement != null )
+            {
                 return false;
+            }
         }
         else if ( !dataElement.equals( other.dataElement ) )
+        {
             return false;
+        }
+        
         if ( programStageInstance == null )
         {
             if ( other.programStageInstance != null )
+            {
                 return false;
+            }
         }
         else if ( !programStageInstance.equals( other.programStageInstance ) )
+        {
             return false;
+        }
+        
         return true;
     }
 

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientreport/PatientAggregateReport.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientreport/PatientAggregateReport.java	2013-05-30 09:08:10 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientreport/PatientAggregateReport.java	2013-08-20 13:24:46 +0000
@@ -50,25 +50,15 @@
     private static final long serialVersionUID = 3261142704777097572L;
 
     public static final int POSITION_ROW_ORGUNIT_COLUMN_PERIOD = 1;
-
     public static final int POSITION_ROW_PERIOD_COLUMN_ORGUNIT = 2;
-
     public static final int POSITION_ROW_ORGUNIT_ROW_PERIOD = 3;
-
     public static final int POSITION_ROW_PERIOD = 4;
-
     public static final int POSITION_ROW_ORGUNIT = 5;
-
     public static final int POSITION_ROW_PERIOD_COLUMN_DATA = 6;
-
     public static final int POSITION_ROW_ORGUNIT_COLUMN_DATA = 7;
-
     public static final int POSITION_ROW_DATA = 8;
-
     public static final int POSITION_ROW_DATA_COLUMN_PERIOD = 9; // PIVOT FROM 6
-
-    public static final int POSITION_ROW_DATA_COLUMN_ORGUNIT = 10; // PIVOT FROM
-                                                                   // 7
+    public static final int POSITION_ROW_DATA_COLUMN_ORGUNIT = 10; // PIVOT FROM 7
     
     public static final String AGGREGATE_TYPE_COUNT = "count";
     public static final String AGGREGATE_TYPE_SUM = "sum";
@@ -78,30 +68,18 @@
 
     private ProgramStage programStage;
 
-    // Date period range
-
     private List<Date> startDates;
 
     private List<Date> endDates;
 
-    // Relative periods
-
     private Set<String> relativePeriods = new HashSet<String>();
 
-    // Fixed periods
-
     private List<String> fixedPeriods = new ArrayList<String>();
 
-    // Organisation units
-
     private Set<OrganisationUnit> organisationUnits;
 
-    // Data element filter values
-
     private Set<String> filterValues = new HashSet<String>();
 
-    // Option
-
     private String facilityLB;
 
     private Integer limitRecords;
@@ -122,8 +100,6 @@
 
     private Boolean useFormNameDataElement;
     
-    // User created
-
     private User user;
 
     // -------------------------------------------------------------------------
@@ -318,5 +294,4 @@
     {
         this.useFormNameDataElement = useFormNameDataElement;
     }
-
 }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientreport/PatientTabularReport.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientreport/PatientTabularReport.java	2013-08-20 04:58:55 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientreport/PatientTabularReport.java	2013-08-20 13:24:46 +0000
@@ -59,19 +59,12 @@
     private static final long serialVersionUID = -2880334669266185058L;
 
     public static String PREFIX_EXECUTION_DATE = "executiondate";
-
     public static String PREFIX_ORGUNIT = "orgunit";
-
     public static String PREFIX_META_DATA = "meta";
-
     public static String PREFIX_IDENTIFIER_TYPE = "iden";
-
     public static String PREFIX_FIXED_ATTRIBUTE = "fixedAttr";
-
     public static String PREFIX_PATIENT_ATTRIBUTE = "attr";
-
     public static String PREFIX_DATA_ELEMENT = "de";
-
     public static String PREFIX_NUMBER_DATA_ELEMENT = "numberDe";
 
     public static String VALUE_TYPE_OPTION_SET = "optionSet";
@@ -307,5 +300,4 @@
     {
         this.displayOrgunitCode = displayOrgunitCode;
     }
-
 }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientreport/TabularReportColumn.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientreport/TabularReportColumn.java	2013-08-13 09:06:11 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientreport/TabularReportColumn.java	2013-08-20 13:24:46 +0000
@@ -4,15 +4,10 @@
 public class TabularReportColumn
 {
     public static String PREFIX_META_DATA = "meta";
-
     public static String PREFIX_IDENTIFIER_TYPE = "iden";
-
     public static String PREFIX_FIXED_ATTRIBUTE = "fixedAttr";
-
     public static String PREFIX_PATIENT_ATTRIBUTE = "attr";
-
     public static String PREFIX_DATA_ELEMENT = "de";
-
     public static String PREFIX_NUMBER_DATA_ELEMENT = "numberDe";
 
     private String prefix;
@@ -27,7 +22,7 @@
 
     private String name;
 
-    private boolean dateType = false;
+    private boolean dateType;
 
     // -------------------------------------------------------------------------
     // Constructor

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java	2013-07-29 09:14:04 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java	2013-08-20 13:24:46 +0000
@@ -36,6 +36,7 @@
 import org.hisp.dhis.common.DxfNamespaces;
 import org.hisp.dhis.common.view.DetailedView;
 import org.hisp.dhis.common.view.ExportView;
+import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroup;
 import org.hisp.dhis.patient.Patient;
@@ -65,9 +66,7 @@
     private static final long serialVersionUID = -2581751965520009382L;
 
     public static final int MULTIPLE_EVENTS_WITH_REGISTRATION = 1;
-
     public static final int SINGLE_EVENT_WITH_REGISTRATION = 2;
-
     public static final int SINGLE_EVENT_WITHOUT_REGISTRATION = 3;
 
     private String description;
@@ -158,32 +157,56 @@
     // -------------------------------------------------------------------------
 
     @Override
-    public boolean equals( Object o )
+    public boolean equals( Object object )
     {
-        if ( this == o )
+        if ( this == object )
         {
             return true;
         }
 
-        if ( o == null )
-        {
-            return false;
-        }
-
-        if ( !(o instanceof Program) )
-        {
-            return false;
-        }
-
-        final Program other = (Program) o;
+        if ( object == null )
+        {
+            return false;
+        }
+
+        if ( getClass() != object.getClass() )
+        {
+            return false;
+        }
+
+        final Program other = (Program) object;
 
         return name.equals( other.getName() );
     }
 
+    @Override
+    public int hashCode()
+    {
+        return name.hashCode();
+    }
+
     // -------------------------------------------------------------------------
     // Logic methods
     // -------------------------------------------------------------------------
 
+    /**
+     * Returns all data elements which are part of the stages of this program.
+     */
+    public Set<DataElement> getAllDataElements()
+    {
+        Set<DataElement> elements = new HashSet<DataElement>();
+        
+        for ( ProgramStage stage : programStages )
+        {
+            for ( ProgramStageDataElement element : stage.getProgramStageDataElements() )
+            {
+                elements.add( element.getDataElement() );
+            }
+        }
+        
+        return elements;
+    }
+    
     public ProgramStage getProgramStageByStage( int stage )
     {
         int count = 1;
@@ -485,7 +508,7 @@
     @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public boolean isSingleEvent()
     {
-        return type != null && (SINGLE_EVENT_WITH_REGISTRATION == type || SINGLE_EVENT_WITHOUT_REGISTRATION == type);
+        return type != null && ( SINGLE_EVENT_WITH_REGISTRATION == type || SINGLE_EVENT_WITHOUT_REGISTRATION == type );
     }
 
     @JsonProperty
@@ -493,7 +516,7 @@
     @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public boolean isRegistration()
     {
-        return type != null && (SINGLE_EVENT_WITH_REGISTRATION == type || MULTIPLE_EVENTS_WITH_REGISTRATION == type);
+        return type != null && ( SINGLE_EVENT_WITH_REGISTRATION == type || MULTIPLE_EVENTS_WITH_REGISTRATION == type );
     }
 
     @JsonProperty

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramExpression.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramExpression.java	2012-12-07 12:47:16 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramExpression.java	2013-08-20 13:24:46 +0000
@@ -37,22 +37,15 @@
 public class ProgramExpression
     implements Serializable
 {
-    private static final long serialVersionUID = -2807997671779497354L;
-    
+    private static final long serialVersionUID = -2807997671779497354L;    
 
     public static final String SEPARATOR_ID = "\\.";
-
     public static String OBJECT_PROGRAM_STAGE_DATAELEMENT = "DE";
 
     public static final String SEPARATOR_OBJECT = ":";
-    
-
-    public static final String DUE_DATE = "DUE_DATE";
-    
+    public static final String DUE_DATE = "DUE_DATE";    
     public static final String REPORT_DATE = "REPORT_DATE";
-
-    public static final String RANGE_IN_DUE_DATE = "RANGE_IN_DUE_DATE";
-    
+    public static final String RANGE_IN_DUE_DATE = "RANGE_IN_DUE_DATE";    
     public static final String NOT_NULL_VALUE_IN_EXPRESSION = "NOT-NULL-VALUE";
 
     
@@ -68,7 +61,6 @@
 
     public ProgramExpression()
     {
-
     }
 
     public ProgramExpression( String expression, String description )
@@ -86,35 +78,55 @@
     {
         final int prime = 31;
         int result = 1;
-        result = prime * result + ((description == null) ? 0 : description.hashCode());
-        result = prime * result + ((expression == null) ? 0 : expression.hashCode());
+        result = prime * result + ( ( description == null ) ? 0 : description.hashCode() );
+        result = prime * result + ( ( expression == null ) ? 0 : expression.hashCode() );
         return result;
     }
 
     @Override
-    public boolean equals( Object obj )
+    public boolean equals( Object object )
     {
-        if ( this == obj )
+        if ( this == object )
+        {
             return true;
-        if ( obj == null )
-            return false;
-        if ( getClass() != obj.getClass() )
-            return false;
-        ProgramExpression other = (ProgramExpression) obj;
+        }
+        
+        if ( object == null )
+        {
+            return false;
+        }
+        
+        if ( getClass() != object.getClass() )
+        {
+            return false;
+        }
+        
+        final ProgramExpression other = (ProgramExpression) object;
+        
         if ( description == null )
         {
             if ( other.description != null )
+            {
                 return false;
+            }
         }
         else if ( !description.equals( other.description ) )
+        {
             return false;
+        }
+        
         if ( expression == null )
         {
             if ( other.expression != null )
+            {
                 return false;
+            }
         }
         else if ( !expression.equals( other.expression ) )
+        {
             return false;
+        }
+        
         return true;
     }
 

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramIndicator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramIndicator.java	2013-05-30 06:08:13 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramIndicator.java	2013-08-20 13:24:46 +0000
@@ -45,13 +45,10 @@
     public static final String SEPARATOR_ID = "\\.";
 
     public static final String VALUE_TYPE_DATE = "date";
-
     public static final String VALUE_TYPE_INT = "int";
 
     public static final String INCIDENT_DATE = "incident_date";
-
     public static final String ENROLLEMENT_DATE = "enrollment_date";
-
     public static final String CURRENT_DATE = "current_date";
 
     public static final String regExp = "\\[" + OBJECT_PROGRAM_STAGE_DATAELEMENT + SEPARATOR_OBJECT + "([a-zA-Z0-9\\- ]+["
@@ -89,30 +86,30 @@
     @Override
     public int hashCode()
     {
-        final int prime = 31;
-        int result = super.hashCode();
-        result = prime * result + ((name == null) ? 0 : name.hashCode());
-        return result;
+        return name.hashCode();
     }
 
     @Override
-    public boolean equals( Object obj )
+    public boolean equals( Object object )
     {
-        if ( this == obj )
+        if ( this == object )
+        {
             return true;
-        if ( !super.equals( obj ) )
-            return false;
-        if ( getClass() != obj.getClass() )
-            return false;
-        ProgramIndicator other = (ProgramIndicator) obj;
-        if ( name == null )
-        {
-            if ( other.name != null )
-                return false;
-        }
-        else if ( !name.equals( other.name ) )
-            return false;
-        return true;
+        }
+
+        if ( object == null )
+        {
+            return false;
+        }
+
+        if ( getClass() != object.getClass() )
+        {
+            return false;
+        }
+        
+        final ProgramIndicator other = (ProgramIndicator) object;
+        
+        return name.equals( other.name );
     }
 
     // -------------------------------------------------------------------------

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramInstance.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramInstance.java	2013-04-11 08:30:45 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramInstance.java	2013-08-20 13:24:46 +0000
@@ -54,9 +54,7 @@
     implements Serializable
 {
     public static int STATUS_ACTIVE = 0;
-
     public static int STATUS_COMPLETED = 1;
-
     public static int STATUS_CANCELLED = 2;
 
     /**
@@ -120,33 +118,33 @@
         final int prime = 31;
         int result = 1;
 
-        result = prime * result + ((dateOfIncident == null) ? 0 : dateOfIncident.hashCode());
-        result = prime * result + ((enrollmentDate == null) ? 0 : enrollmentDate.hashCode());
-        result = prime * result + ((patient == null) ? 0 : patient.hashCode());
-        result = prime * result + ((program == null) ? 0 : program.hashCode());
+        result = prime * result + ( ( dateOfIncident == null) ? 0 : dateOfIncident.hashCode() );
+        result = prime * result + ( ( enrollmentDate == null) ? 0 : enrollmentDate.hashCode() );
+        result = prime * result + ( ( patient == null) ? 0 : patient.hashCode() );
+        result = prime * result + ( ( program == null) ? 0 : program.hashCode() );
 
         return result;
     }
 
     @Override
-    public boolean equals( Object obj )
+    public boolean equals( Object object )
     {
-        if ( this == obj )
+        if ( this == object )
         {
             return true;
         }
 
-        if ( obj == null )
-        {
-            return false;
-        }
-
-        if ( getClass() != obj.getClass() )
-        {
-            return false;
-        }
-
-        final ProgramInstance other = (ProgramInstance) obj;
+        if ( object == null )
+        {
+            return false;
+        }
+
+        if ( getClass() != object.getClass() )
+        {
+            return false;
+        }
+
+        final ProgramInstance other = (ProgramInstance) object;
 
         if ( dateOfIncident == null )
         {

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStage.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStage.java	2013-07-31 06:51:17 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStage.java	2013-08-20 13:24:46 +0000
@@ -50,9 +50,7 @@
     extends BaseIdentifiableObject
 {
     public static final String TYPE_DEFAULT = "default";
-
     public static final String TYPE_SECTION = "section";
-
     public static final String TYPE_CUSTOM = "custom";
     
     /**

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageDataElement.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageDataElement.java	2013-06-21 05:12:42 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageDataElement.java	2013-08-20 13:24:46 +0000
@@ -194,13 +194,18 @@
     @Override
     public int hashCode()
     {
-        return programStage.hashCode() + dataElement.hashCode();
+        final int prime = 31;
+        int result = 1;
+
+        result = result * prime + programStage.hashCode();
+        result = result * prime + dataElement.hashCode();
+        
+        return result;
     }
 
     @Override
     public boolean equals( Object object )
     {
-
         if ( object == null )
         {
             return false;
@@ -216,5 +221,4 @@
         return dataElement.getId() == other.getDataElement().getId()
             && programStage.getId() == other.getProgramStage().getId();
     }
-
 }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstance.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstance.java	2013-07-31 06:51:17 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstance.java	2013-08-20 13:24:46 +0000
@@ -49,13 +49,9 @@
     private static final long serialVersionUID = 6239130884678145713L;
 
     public static final int COMPLETED_STATUS = 1;
-
     public static final int VISITED_STATUS = 2;
-
     public static final int FUTURE_VISIT_STATUS = 3;
-
     public static final int LATE_VISIT_STATUS = 4;
-
     public static final int SKIPPED_STATUS = 5;
 
     private ProgramInstance programInstance;
@@ -68,7 +64,7 @@
 
     private OrganisationUnit organisationUnit;
 
-    private boolean completed = false;
+    private boolean completed;
 
     private List<OutboundSms> outboundSms;
 
@@ -103,24 +99,24 @@
     // -------------------------------------------------------------------------
 
     @Override
-    public boolean equals( Object o )
+    public boolean equals( Object object )
     {
-        if ( this == o )
+        if ( this == object )
         {
             return true;
         }
 
-        if ( o == null )
-        {
-            return false;
-        }
-
-        if ( !(o instanceof ProgramStageInstance) )
-        {
-            return false;
-        }
-
-        final ProgramStageInstance other = (ProgramStageInstance) o;
+        if ( object == null )
+        {
+            return false;
+        }
+
+        if ( getClass() != object.getClass() )
+        {
+            return false;
+        }
+
+        final ProgramStageInstance other = (ProgramStageInstance) object;
 
         return programInstance.equals( other.getProgramInstance() ) && programStage.equals( other.getProgramStage() );
 

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramValidation.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramValidation.java	2013-01-14 16:10:34 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramValidation.java	2013-08-20 13:24:46 +0000
@@ -43,31 +43,22 @@
     private static final long serialVersionUID = 4785165717118297802L;
 
     public static final String SEPARATOR_ID = "\\.";
-
     public static final String SEPARATOR_OBJECT = ":";
 
     public static String OBJECT_PROGRAM_STAGE_DATAELEMENT = "DE";
 
+    public static final String NOT_NULL_VALUE_IN_EXPRESSION = "{NOT-NULL-VALUE}";
+
     public static final int BEFORE_CURRENT_DATE = 1;
-
     public static final int BEFORE_OR_EQUALS_TO_CURRENT_DATE = 2;
-
     public static final int AFTER_CURRENT_DATE = 3;
-
     public static final int AFTER_OR_EQUALS_TO_CURRENT_DATE = 4;
-
     public static final int BEFORE_DUE_DATE = -1;
-
     public static final int BEFORE_OR_EQUALS_TO_DUE_DATE = -2;
-
     public static final int AFTER_DUE_DATE = -3;
-
     public static final int AFTER_OR_EQUALS_TO_DUE_DATE = -4;
-
     public static final int BEFORE_DUE_DATE_PLUS_OR_MINUS_MAX_DAYS = -5;
 
-    public static final String NOT_NULL_VALUE_IN_EXPRESSION = "{NOT-NULL-VALUE}";
-
     // -------------------------------------------------------------------------
     // Fields
     // -------------------------------------------------------------------------
@@ -107,31 +98,31 @@
     {
         final int prime = 31;
         int result = 1;
-        result = prime * result + ((leftSide == null) ? 0 : leftSide.hashCode());
-        result = prime * result + ((program == null) ? 0 : program.hashCode());
-        result = prime * result + ((rightSide == null) ? 0 : rightSide.hashCode());
+        result = prime * result + ( ( leftSide == null ) ? 0 : leftSide.hashCode() );
+        result = prime * result + ( ( program == null ) ? 0 : program.hashCode() );
+        result = prime * result + ( ( rightSide == null ) ? 0 : rightSide.hashCode() );
         return result;
     }
 
     @Override
-    public boolean equals( Object obj )
+    public boolean equals( Object object )
     {
-        if ( this == obj )
+        if ( this == object )
         {
             return true;
         }
 
-        if ( obj == null )
-        {
-            return false;
-        }
-
-        if ( getClass() != obj.getClass() )
-        {
-            return false;
-        }
-
-        ProgramValidation other = (ProgramValidation) obj;
+        if ( object == null )
+        {
+            return false;
+        }
+
+        if ( getClass() != object.getClass() )
+        {
+            return false;
+        }
+
+        ProgramValidation other = (ProgramValidation) object;
 
         if ( leftSide == null )
         {

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramValidationResult.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramValidationResult.java	2012-11-06 07:09:13 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramValidationResult.java	2013-08-20 13:24:46 +0000
@@ -29,8 +29,6 @@
 
 /**
  * @author Chau Thu Tran
- * 
- * @version ProgramValidationResult.java 10:33:59 AM Nov 6, 2012 $
  */
 public class ProgramValidationResult
 {
@@ -75,29 +73,49 @@
     }
 
     @Override
-    public boolean equals( Object obj )
+    public boolean equals( Object object )
     {
-        if ( this == obj )
+        if ( this == object )
+        {
             return true;
-        if ( obj == null )
-            return false;
-        if ( getClass() != obj.getClass() )
-            return false;
-        ProgramValidationResult other = (ProgramValidationResult) obj;
+        }
+        
+        if ( object == null )
+        {
+            return false;
+        }
+        
+        if ( getClass() != object.getClass() )
+        {
+            return false;
+        }
+        
+        final ProgramValidationResult other = (ProgramValidationResult) object;
+        
         if ( programStageInstance == null )
         {
             if ( other.programStageInstance != null )
+            {
                 return false;
+            }
         }
         else if ( !programStageInstance.equals( other.programStageInstance ) )
+        {
             return false;
+        }
+        
         if ( programValidation == null )
         {
             if ( other.programValidation != null )
+            {
                 return false;
+            }
         }
         else if ( !programValidation.equals( other.programValidation ) )
+        {
             return false;
+        }
+        
         return true;
     }
 
@@ -144,5 +162,4 @@
     {
         this.rightsideValue = rightsideValue;
     }
-
 }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/SchedulingProgramObject.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/SchedulingProgramObject.java	2013-04-10 08:45:43 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/SchedulingProgramObject.java	2013-08-20 13:24:46 +0000
@@ -93,5 +93,4 @@
     {
         this.programInstanceId = programInstanceId;
     }
-
 }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/relationship/Relationship.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/relationship/Relationship.java	2011-05-05 21:14:56 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/relationship/Relationship.java	2013-08-20 13:24:46 +0000
@@ -71,28 +71,27 @@
     // -------------------------------------------------------------------------
 
     @Override
-    public boolean equals( Object o )
+    public boolean equals( Object object )
     {
-        if ( this == o )
+        if ( this == object )
         {
             return true;
         }
 
-        if ( o == null )
-        {
-            return false;
-        }
-
-        if ( !(o instanceof Relationship) )
-        {
-            return false;
-        }
-
-        final Relationship other = (Relationship) o;
+        if ( object == null )
+        {
+            return false;
+        }
+
+        if ( getClass() != object.getClass() )
+        {
+            return false;
+        }
+
+        final Relationship other = (Relationship) object;
 
         return patientA.equals( other.getPatientA() ) && relationshipType.equals( other.getRelationshipType() )
             && patientB.equals( other.getPatientB() );
-
     }
 
     @Override

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/relationship/RelationshipType.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/relationship/RelationshipType.java	2013-02-13 03:57:52 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/relationship/RelationshipType.java	2013-08-20 13:24:46 +0000
@@ -70,27 +70,26 @@
     // -------------------------------------------------------------------------
 
     @Override
-    public boolean equals( Object o )
+    public boolean equals( Object object )
     {
-        if ( this == o )
+        if ( this == object )
         {
             return true;
         }
 
-        if ( o == null )
-        {
-            return false;
-        }
-
-        if ( !(o instanceof RelationshipType) )
-        {
-            return false;
-        }
-
-        final RelationshipType other = (RelationshipType) o;
+        if ( object == null )
+        {
+            return false;
+        }
+
+        if ( getClass() != object.getClass() )
+        {
+            return false;
+        }
+
+        final RelationshipType other = (RelationshipType) object;
 
         return aIsToB.equals( other.getaIsToB() ) && bIsToA.equals( other.getbIsToA() );
-
     }
 
     @Override