← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 19016: Minor

 

------------------------------------------------------------
revno: 19016
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2015-04-24 15:11:10 +0200
message:
  Minor
modified:
  dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/DefaultProgramIndicatorService.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-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/DefaultProgramIndicatorService.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/DefaultProgramIndicatorService.java	2015-03-29 20:22:47 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/DefaultProgramIndicatorService.java	2015-04-24 13:11:10 +0000
@@ -428,7 +428,7 @@
 
     private Double getValue( ProgramInstance programInstance, ProgramIndicator indicator )
     {
-        StringBuffer description = new StringBuffer();
+        StringBuffer buffer = new StringBuffer();
 
         Matcher matcher = ProgramIndicator.EXPRESSION_PATTERN.matcher( indicator.getExpression() );
 
@@ -463,7 +463,7 @@
                         value = DateUtils.daysBetween( new Date(), DateUtils.getDefaultDate( value ) ) + " ";
                     }
 
-                    matcher.appendReplacement( description, value );
+                    matcher.appendReplacement( buffer, value );
                     
                 }
                 else
@@ -487,7 +487,7 @@
                         {
                             value = DateUtils.daysBetween( new Date(), DateUtils.getDefaultDate( value ) ) + " ";
                         }
-                        matcher.appendReplacement( description, value );
+                        matcher.appendReplacement( buffer, value );
                     }
                     else
                     {
@@ -505,7 +505,7 @@
                 
                 if ( constant != null )
                 {
-                    matcher.appendReplacement( description, String.valueOf( constant.getValue() ) );
+                    matcher.appendReplacement( buffer, String.valueOf( constant.getValue() ) );
                 }
                 else
                 {
@@ -532,14 +532,13 @@
 
                 if ( date != null )
                 {
-                    matcher.appendReplacement( description, DateUtils.daysBetween( currentDate, date ) + "" );
+                    matcher.appendReplacement( buffer, DateUtils.daysBetween( currentDate, date ) + "" );
                 }
             }
-
         }
 
-        matcher.appendTail( description );
+        matcher.appendTail( buffer );
 
-        return MathUtils.calculateExpression( description.toString() );
+        return MathUtils.calculateExpression( buffer.toString() );
     }
 }