← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 20142: Support-system, cleanup

 

------------------------------------------------------------
revno: 20142
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2015-09-14 20:06:48 +0200
message:
  Support-system, cleanup
modified:
  dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/collection/TaskLocalList.java
  dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/collection/TaskLocalMap.java
  dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/deletion/DefaultDeletionManager.java
  dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/deletion/DeletionHandler.java
  dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/filter/AggregatableDataElementFilter.java
  dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/grid/ListGrid.java
  dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/math/UnaryDoubleFunction.java
  dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/notification/InMemoryNotifier.java
  dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/process/OpenSessionThread.java
  dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/scheduling/Scheduler.java
  dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/AnnotationUtils.java
  dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/ValidationUtils.java
  dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/util/StreamUtilsTest.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-system/src/main/java/org/hisp/dhis/system/collection/TaskLocalList.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/collection/TaskLocalList.java	2015-06-15 13:44:20 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/collection/TaskLocalList.java	2015-09-14 18:06:48 +0000
@@ -40,7 +40,7 @@
  */
 public class TaskLocalList<T>
 {
-    private Map<TaskId, List<T>> internalMap;
+    private final Map<TaskId, List<T>> internalMap;
     
     public TaskLocalList()
     {

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/collection/TaskLocalMap.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/collection/TaskLocalMap.java	2015-06-15 13:44:20 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/collection/TaskLocalMap.java	2015-09-14 18:06:48 +0000
@@ -38,7 +38,7 @@
  */
 public class TaskLocalMap<T, V>
 {
-    private Map<TaskId, Map<T, V>> internalMap;
+    private final Map<TaskId, Map<T, V>> internalMap;
     
     public TaskLocalMap()
     {

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/deletion/DefaultDeletionManager.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/deletion/DefaultDeletionManager.java	2015-01-22 17:53:46 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/deletion/DefaultDeletionManager.java	2015-09-14 18:06:48 +0000
@@ -53,7 +53,7 @@
     private static final String DELETE_METHOD_PREFIX = "delete";
     private static final String ALLOW_METHOD_PREFIX = "allowDelete";
 
-    private List<DeletionHandler> handlers = new ArrayList<>();
+    private final List<DeletionHandler> handlers = new ArrayList<>();
 
     // -------------------------------------------------------------------------
     // DeletionManager implementation

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/deletion/DeletionHandler.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/deletion/DeletionHandler.java	2015-07-14 07:33:21 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/deletion/DeletionHandler.java	2015-09-14 18:06:48 +0000
@@ -119,7 +119,7 @@
  */
 public abstract class DeletionHandler
 {
-    protected final String ERROR = "";
+    protected static final String ERROR = "";
 
     // -------------------------------------------------------------------------
     // Abstract methods

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/filter/AggregatableDataElementFilter.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/filter/AggregatableDataElementFilter.java	2015-09-04 09:29:23 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/filter/AggregatableDataElementFilter.java	2015-09-14 18:06:48 +0000
@@ -44,7 +44,7 @@
 {
     public static final AggregatableDataElementFilter INSTANCE = new AggregatableDataElementFilter();
 
-    private static Set<ValueType> VALUE_TYPES = Sets.newHashSet(
+    private static final Set<ValueType> VALUE_TYPES = Sets.newHashSet(
         ValueType.BOOLEAN, ValueType.TEXT, ValueType.LONG_TEXT, ValueType.LETTER,
         ValueType.INTEGER, ValueType.INTEGER_POSITIVE, ValueType.INTEGER_NEGATIVE, ValueType.INTEGER_ZERO_OR_POSITIVE,
         ValueType.NUMBER, ValueType.UNIT_INTERVAL, ValueType.PERCENTAGE

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/grid/ListGrid.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/grid/ListGrid.java	2015-06-18 12:53:41 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/grid/ListGrid.java	2015-09-14 18:06:48 +0000
@@ -516,7 +516,7 @@
             return this; // No sorting
         }
 
-        columnIndex = columnIndex - 1;
+        columnIndex--;
 
         if ( columnIndex < 0 || columnIndex >= getWidth() )
         {

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/math/UnaryDoubleFunction.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/math/UnaryDoubleFunction.java	2015-07-14 09:47:47 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/math/UnaryDoubleFunction.java	2015-09-14 18:06:48 +0000
@@ -41,7 +41,7 @@
 public abstract class UnaryDoubleFunction
     extends PostfixMathCommand
 {
-    public UnaryDoubleFunction()
+    protected UnaryDoubleFunction()
     {
         super();
 

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/notification/InMemoryNotifier.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/notification/InMemoryNotifier.java	2015-06-15 13:44:20 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/notification/InMemoryNotifier.java	2015-09-14 18:06:48 +0000
@@ -49,7 +49,7 @@
 {
     private static final Log log = LogFactory.getLog( InMemoryNotifier.class );
     
-    private int MAX_SIZE = 75;
+    private static final int MAX_SIZE = 75;
     
     private TaskLocalList<Notification> notifications;
     

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/process/OpenSessionThread.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/process/OpenSessionThread.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/process/OpenSessionThread.java	2015-09-14 18:06:48 +0000
@@ -40,7 +40,7 @@
 {
     private SessionFactory sessionFactory;
 
-    public OpenSessionThread( SessionFactory sessionFactory )
+    protected OpenSessionThread( SessionFactory sessionFactory )
     {
         this.sessionFactory = sessionFactory;
     }

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/scheduling/Scheduler.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/scheduling/Scheduler.java	2015-05-30 13:36:07 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/scheduling/Scheduler.java	2015-09-14 18:06:48 +0000
@@ -35,16 +35,16 @@
  */
 public interface Scheduler
 {
-    final String CRON_DAILY_0AM = "0 0 0 * * ?";
-    final String CRON_DAILY_11PM = "0 0 23 * * ?";
-    final String CRON_EVERY_MIN = "0 0/1 * * * ?";
-    final String CRON_EVERY_15MIN = "0 0/15 * * * ?";
-    final String CRON_TEST = "0 * * * * ?";
+    String CRON_DAILY_0AM = "0 0 0 * * ?";
+    String CRON_DAILY_11PM = "0 0 23 * * ?";
+    String CRON_EVERY_MIN = "0 0/1 * * * ?";
+    String CRON_EVERY_15MIN = "0 0/15 * * * ?";
+    String CRON_TEST = "0 * * * * ?";
     
-    final String STATUS_RUNNING = "running";
-    final String STATUS_DONE = "done";
-    final String STATUS_STOPPED  = "stopped";
-    final String STATUS_NOT_STARTED = "not_started";
+    String STATUS_RUNNING = "running";
+    String STATUS_DONE = "done";
+    String STATUS_STOPPED  = "stopped";
+    String STATUS_NOT_STARTED = "not_started";
     
     /**
      * Execute the given task immediately.

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/AnnotationUtils.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/AnnotationUtils.java	2015-05-30 13:36:07 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/AnnotationUtils.java	2015-09-14 18:06:48 +0000
@@ -57,9 +57,9 @@
         
         for ( Method method : target.getClass().getMethods() )
         {
-            Annotation a = org.springframework.core.annotation.AnnotationUtils.findAnnotation( method, annotationType );
+            Annotation annotation = org.springframework.core.annotation.AnnotationUtils.findAnnotation( method, annotationType );
             
-            if ( a != null )
+            if ( annotation != null )
             {
                 methods.add( method );
             }

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/ValidationUtils.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/ValidationUtils.java	2015-09-03 12:15:43 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/ValidationUtils.java	2015-09-14 18:06:48 +0000
@@ -50,16 +50,16 @@
  */
 public class ValidationUtils
 {
-    private static Pattern POINT_PATTERN = Pattern.compile( "\\[(.+),\\s?(.+)\\]" );
-    private static Pattern DIGIT_PATTERN = Pattern.compile( ".*\\d.*" );
-    private static Pattern UPPERCASE_PATTERN = Pattern.compile( ".*[A-Z].*" );
-    private static Pattern HEX_COLOR_PATTERN = Pattern.compile( "^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$" );
+    private static final Pattern POINT_PATTERN = Pattern.compile( "\\[(.+),\\s?(.+)\\]" );
+    private static final Pattern DIGIT_PATTERN = Pattern.compile( ".*\\d.*" );
+    private static final Pattern UPPERCASE_PATTERN = Pattern.compile( ".*[A-Z].*" );
+    private static final Pattern HEX_COLOR_PATTERN = Pattern.compile( "^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$" );
 
-    private static int VALUE_MAX_LENGTH = 50000;
-    private static int LONG_MAX = 180;
-    private static int LONG_MIN = -180;
-    private static int LAT_MAX = 90;
-    private static int LAT_MIN = -90;
+    private static final int VALUE_MAX_LENGTH = 50000;
+    private static final int LONG_MAX = 180;
+    private static final int LONG_MIN = -180;
+    private static final int LAT_MAX = 90;
+    private static final int LAT_MIN = -90;
 
     private static final Set<Character> SQL_VALID_CHARS = Sets.newHashSet(
         '&', '|', '=', '!', '<', '>', '/', '%', '"', '\'', '*', '+', '-', '^', ',', '.' );

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/util/StreamUtilsTest.java'
--- dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/util/StreamUtilsTest.java	2015-06-15 13:44:20 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/util/StreamUtilsTest.java	2015-09-14 18:06:48 +0000
@@ -46,11 +46,11 @@
  */
 public class StreamUtilsTest
 {
-    public static BufferedInputStream zipStream;
-
-    public static BufferedInputStream gzipStream;
-
-    public static BufferedInputStream plainStream;
+    private BufferedInputStream zipStream;
+
+    private BufferedInputStream gzipStream;
+
+    private BufferedInputStream plainStream;
 
     @Before
     public void setUp()