← Back to team overview

dhis2-devs team mailing list archive

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

 

------------------------------------------------------------
revno: 20363
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2015-09-25 14:41:17 +0200
message:
  Minor
modified:
  dhis-2/dhis-support/dhis-support-commons/src/main/java/org/hisp/dhis/commons/collection/CollectionUtils.java
  dhis-2/dhis-support/dhis-support-commons/src/main/java/org/hisp/dhis/commons/collection/PaginatedList.java
  dhis-2/dhis-support/dhis-support-commons/src/main/java/org/hisp/dhis/commons/timer/SystemTimer.java
  dhis-2/dhis-support/dhis-support-commons/src/main/java/org/hisp/dhis/commons/util/DebugUtils.java
  dhis-2/dhis-support/dhis-support-commons/src/test/java/org/hisp/dhis/commons/util/ExpressionUtilsTest.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-support/dhis-support-commons/src/main/java/org/hisp/dhis/commons/collection/CollectionUtils.java'
--- dhis-2/dhis-support/dhis-support-commons/src/main/java/org/hisp/dhis/commons/collection/CollectionUtils.java	2015-09-22 10:47:41 +0000
+++ dhis-2/dhis-support/dhis-support-commons/src/main/java/org/hisp/dhis/commons/collection/CollectionUtils.java	2015-09-25 12:41:17 +0000
@@ -49,8 +49,8 @@
  */
 public class CollectionUtils
 {
-    public static String[] STRING_ARR = new String[0];
-    public static String[][] STRING_2D_ARR = new String[0][];
+    public static final String[] STRING_ARR = new String[0];
+    public static final String[][] STRING_2D_ARR = new String[0][];
 
     /**
      * Applies the given Function1 on each member of the Collection.

=== modified file 'dhis-2/dhis-support/dhis-support-commons/src/main/java/org/hisp/dhis/commons/collection/PaginatedList.java'
--- dhis-2/dhis-support/dhis-support-commons/src/main/java/org/hisp/dhis/commons/collection/PaginatedList.java	2015-06-16 17:57:23 +0000
+++ dhis-2/dhis-support/dhis-support-commons/src/main/java/org/hisp/dhis/commons/collection/PaginatedList.java	2015-09-25 12:41:17 +0000
@@ -125,11 +125,11 @@
      */
     public int pageCount()
     {
-        int c = size();        
-        int r = c / pageSize;
-        int m = c % pageSize;
+        int count = size();        
+        int pages = count / pageSize;
+        int mod = count % pageSize;
         
-        return m == 0 ? r : ( r + 1 );
+        return mod == 0 ? pages : ( pages + 1 );
     }
     
     /**

=== modified file 'dhis-2/dhis-support/dhis-support-commons/src/main/java/org/hisp/dhis/commons/timer/SystemTimer.java'
--- dhis-2/dhis-support/dhis-support-commons/src/main/java/org/hisp/dhis/commons/timer/SystemTimer.java	2015-06-16 17:57:23 +0000
+++ dhis-2/dhis-support/dhis-support-commons/src/main/java/org/hisp/dhis/commons/timer/SystemTimer.java	2015-09-25 12:41:17 +0000
@@ -38,28 +38,28 @@
 public class SystemTimer 
     implements Timer
 {
-    private long _start = 0;
+    private long internalStart = 0;
 
-    private long _end = 0;
+    private long internalEnd = 0;
 
     @Override
     public Timer start()
     {
-        _start = System.nanoTime();
+        internalStart = System.nanoTime();
         return this;
     }
 
     @Override
     public Timer stop()
     {
-        _end = System.nanoTime();
+        internalEnd = System.nanoTime();
         return this;
     }
 
     @Override
     public Long duration()
     {
-        return _end - _start;
+        return internalEnd - internalStart;
     }
 
     @Override

=== modified file 'dhis-2/dhis-support/dhis-support-commons/src/main/java/org/hisp/dhis/commons/util/DebugUtils.java'
--- dhis-2/dhis-support/dhis-support-commons/src/main/java/org/hisp/dhis/commons/util/DebugUtils.java	2015-07-03 20:43:24 +0000
+++ dhis-2/dhis-support/dhis-support-commons/src/main/java/org/hisp/dhis/commons/util/DebugUtils.java	2015-09-25 12:41:17 +0000
@@ -49,7 +49,7 @@
     
     public static final String SEPARATOR = "-";
     
-    private static ThreadLocal<Map<String, List<String>>> duplicateMapPeg = new ThreadLocal<>();
+    private static ThreadLocal<Map<String, List<String>>> DUPLICATE_MAP_PEG = new ThreadLocal<>();
     
     public static String logDuplicates( String key, Integer... values )
     {
@@ -85,7 +85,7 @@
     
     private static String log( String key, String value )
     {   
-        Map<String, List<String>> duplicateMap = duplicateMapPeg.get();
+        Map<String, List<String>> duplicateMap = DUPLICATE_MAP_PEG.get();
         
         if ( duplicateMap == null )
         {
@@ -112,20 +112,20 @@
         
         duplicateMap.put( key, list );
         
-        duplicateMapPeg.set( duplicateMap );
+        DUPLICATE_MAP_PEG.set( duplicateMap );
 
         return duplicate;
     }
     
     public static boolean resetDuplicates( String key )
     {
-        Map<String, List<String>> duplicateMap = duplicateMapPeg.get();
+        Map<String, List<String>> duplicateMap = DUPLICATE_MAP_PEG.get();
         
         if ( duplicateMap != null )
         {
             duplicateMap.remove( key );
         
-            duplicateMapPeg.set( duplicateMap );
+            DUPLICATE_MAP_PEG.set( duplicateMap );
             
             log.info( "Reset duplicate for key: '" + key + "'" );
             

=== modified file 'dhis-2/dhis-support/dhis-support-commons/src/test/java/org/hisp/dhis/commons/util/ExpressionUtilsTest.java'
--- dhis-2/dhis-support/dhis-support-commons/src/test/java/org/hisp/dhis/commons/util/ExpressionUtilsTest.java	2015-09-25 12:38:13 +0000
+++ dhis-2/dhis-support/dhis-support-commons/src/test/java/org/hisp/dhis/commons/util/ExpressionUtilsTest.java	2015-09-25 12:41:17 +0000
@@ -96,9 +96,7 @@
             "((d2:zing(4) + d2:zing(0) + d2:zing(-1)) / d2:zpvc(2,0,-1) * 0.25) + " +
             "((d2:zing(8) + d2:zing(0) + d2:zing(-1)) / d2:zpvc(2,0,-1) * 0.75)";
 
-        assertEquals( 3.5, ExpressionUtils.evaluateToDouble( expression, null ), DELTA );
-        
-        
+        assertEquals( 3.5, ExpressionUtils.evaluateToDouble( expression, null ), DELTA );        
     }
 
     @Test