← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 19018: ExpressionService, moved util method to support system

 

------------------------------------------------------------
revno: 19018
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2015-04-24 15:45:54 +0200
message:
  ExpressionService, moved util method to support system
modified:
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/expression/DefaultExpressionService.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-core/src/main/java/org/hisp/dhis/expression/DefaultExpressionService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/expression/DefaultExpressionService.java	2015-04-10 12:32:54 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/expression/DefaultExpressionService.java	2015-04-24 13:45:54 +0000
@@ -65,6 +65,7 @@
 import org.hisp.dhis.period.Period;
 import org.hisp.dhis.system.util.DateUtils;
 import org.hisp.dhis.system.util.MathUtils;
+import org.hisp.dhis.system.util.TextUtils;
 import org.hisp.dhis.validation.ValidationRule;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -510,7 +511,7 @@
             matcher.appendReplacement( sb, "1.1" );
         }
         
-        expression = appendTail( matcher, sb );
+        expression = TextUtils.appendTail( matcher, sb );
 
         // ---------------------------------------------------------------------
         // Constants
@@ -531,7 +532,7 @@
             matcher.appendReplacement( sb, "1.1" );
         }
 
-        expression = appendTail( matcher, sb );
+        expression = TextUtils.appendTail( matcher, sb );
 
         // ---------------------------------------------------------------------
         // Org unit groups
@@ -552,7 +553,7 @@
             matcher.appendReplacement( sb, "1.1" );
         }
 
-        expression = appendTail( matcher, sb );
+        expression = TextUtils.appendTail( matcher, sb );
         
         // ---------------------------------------------------------------------
         // Days
@@ -609,7 +610,7 @@
             matcher.appendReplacement( sb, DataElementOperand.getPrettyName( dataElement, categoryOptionCombo ) );
         }
         
-        expression = appendTail( matcher, sb );
+        expression = TextUtils.appendTail( matcher, sb );
         
         // ---------------------------------------------------------------------
         // Constants
@@ -632,7 +633,7 @@
             matcher.appendReplacement( sb, constant.getDisplayName() );
         }
 
-        expression = appendTail( matcher, sb );
+        expression = TextUtils.appendTail( matcher, sb );
 
         // ---------------------------------------------------------------------
         // Org unit groups
@@ -655,7 +656,7 @@
             matcher.appendReplacement( sb, group.getDisplayName() );
         }
 
-        expression = appendTail( matcher, sb );
+        expression = TextUtils.appendTail( matcher, sb );
 
         // ---------------------------------------------------------------------
         // Days
@@ -669,7 +670,7 @@
             matcher.appendReplacement( sb, DAYS_DESCRIPTION );
         }
 
-        expression = appendTail( matcher, sb );
+        expression = TextUtils.appendTail( matcher, sb );
 
         return expression;
     }
@@ -749,7 +750,7 @@
             }
         }
 
-        return appendTail( matcher, sb );
+        return TextUtils.appendTail( matcher, sb );
     }
 
     @Override
@@ -785,7 +786,7 @@
             }
         }
 
-        return appendTail( matcher, sb );
+        return TextUtils.appendTail( matcher, sb );
     }
 
     @Override
@@ -815,7 +816,7 @@
             matcher.appendReplacement( sb, replacement );
         }
 
-        expression = appendTail( matcher, sb );
+        expression = TextUtils.appendTail( matcher, sb );
 
         // ---------------------------------------------------------------------
         // Org unit groups
@@ -837,7 +838,7 @@
             //TODO sub tree
         }
 
-        expression = appendTail( matcher, sb );
+        expression = TextUtils.appendTail( matcher, sb );
         
         // ---------------------------------------------------------------------
         // Days
@@ -853,7 +854,7 @@
             matcher.appendReplacement( sb, replacement );
         }
         
-        return appendTail( matcher, sb );
+        return TextUtils.appendTail( matcher, sb );
     }
 
     @Override
@@ -914,7 +915,7 @@
             return null;
         }
         
-        expression = appendTail( matcher, sb );
+        expression = TextUtils.appendTail( matcher, sb );
         
         // ---------------------------------------------------------------------
         // Constants
@@ -932,7 +933,7 @@
             matcher.appendReplacement( sb, replacement );
         }
         
-        expression = appendTail( matcher, sb );
+        expression = TextUtils.appendTail( matcher, sb );
 
         // ---------------------------------------------------------------------
         // Org unit groups
@@ -950,7 +951,7 @@
             matcher.appendReplacement( sb, replacement );
         }
 
-        expression = appendTail( matcher, sb );        
+        expression = TextUtils.appendTail( matcher, sb );        
         
         // ---------------------------------------------------------------------
         // Days
@@ -966,7 +967,7 @@
             matcher.appendReplacement( sb, replacement );
         }
         
-        return appendTail( matcher, sb );
+        return TextUtils.appendTail( matcher, sb );
     }
 
     @Override
@@ -991,11 +992,6 @@
     // Supportive methods
     // -------------------------------------------------------------------------
     
-    private String appendTail( Matcher matcher, StringBuffer sb )
-    {
-        matcher.appendTail( sb );
-        return sb.toString();
-    }
     
     private boolean operandIsTotal( Matcher matcher )
     {