← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 18957: TrackedEntityDataValue, removed excessive constructors

 

------------------------------------------------------------
revno: 18957
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2015-04-21 10:42:34 +0200
message:
  TrackedEntityDataValue, removed excessive constructors
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentitydatavalue/TrackedEntityDataValue.java
  dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/PathUtils.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/LoadDataEntryAction.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/trackedentitydatavalue/TrackedEntityDataValue.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentitydatavalue/TrackedEntityDataValue.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentitydatavalue/TrackedEntityDataValue.java	2015-04-21 08:42:34 +0000
@@ -65,28 +65,15 @@
     {
     }
 
-    public TrackedEntityDataValue( ProgramStageInstance programStageInstance, DataElement dataElement )
-    {
-        this.programStageInstance = programStageInstance;
-        this.dataElement = dataElement;
-    }
-
-    public TrackedEntityDataValue( ProgramStageInstance programStageInstance, DataElement dataElement, Date timeStamp )
-    {
-        this.programStageInstance = programStageInstance;
-        this.dataElement = dataElement;
-        this.timestamp = timeStamp;
-    }
-
     public TrackedEntityDataValue( ProgramStageInstance programStageInstance, DataElement dataElement, String value )
     {
         this.dataElement = dataElement;
         this.programStageInstance = programStageInstance;
+        this.timestamp = new Date();
         this.value = value;
     }
 
-    public TrackedEntityDataValue( ProgramStageInstance programStageInstance, DataElement dataElement, Date timeStamp,
-        String value )
+    public TrackedEntityDataValue( ProgramStageInstance programStageInstance, DataElement dataElement, Date timeStamp, String value )
     {
         this.programStageInstance = programStageInstance;
         this.dataElement = dataElement;

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/PathUtils.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/PathUtils.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/PathUtils.java	2015-04-21 08:42:34 +0000
@@ -38,10 +38,6 @@
 
     private static final char FILE_SEPARATOR = '/';
 
-    // -------------------------------------------------------------------------
-    //
-    // -------------------------------------------------------------------------
-
     public static String getClassPath( Class<?> clazz )
     {
         return clazz.getName().replace( PACKAGE_SEPARATOR, FILE_SEPARATOR );

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/LoadDataEntryAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/LoadDataEntryAction.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/LoadDataEntryAction.java	2015-04-21 08:42:34 +0000
@@ -376,7 +376,7 @@
                 String value = entityInstanceDataValue.getValue();
                 Option option = optionService.getOptionByCode( optionSet, value );
                 
-                TrackedEntityDataValue instanceDataValue = new TrackedEntityDataValue(entityInstanceDataValue.getProgramStageInstance(), entityInstanceDataValue.getDataElement());
+                TrackedEntityDataValue instanceDataValue = new TrackedEntityDataValue( entityInstanceDataValue.getProgramStageInstance(), entityInstanceDataValue.getDataElement(), null );
                 instanceDataValue.setValue( option.getName() );
                 entityInstanceDataValueMap.put( key, instanceDataValue );
             }