← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16175: Various cleanup

 

------------------------------------------------------------
revno: 16175
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2014-07-18 13:51:12 +0200
message:
  Various cleanup
modified:
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataapproval/DataApprovalPeriodAggregator.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataapproval/DefaultDataApprovalLevelService.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/datavalue/hibernate/HibernateDataValueAuditStore.java
  dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataapproval/DataApprovalLevelServiceTest.java
  dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataapproval/DataApprovalServiceTest.java
  dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataapproval/DataApprovalStoreTest.java
  dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/datavalue/DataValueAuditServiceTest.java
  dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/i18n/I18nServiceTest.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/dataapproval/DataApprovalPeriodAggregator.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataapproval/DataApprovalPeriodAggregator.java	2014-06-06 19:29:39 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataapproval/DataApprovalPeriodAggregator.java	2014-07-18 11:51:12 +0000
@@ -42,7 +42,7 @@
  * @author Jim Grace
  * @version $Id$
  */
-class DataApprovalPeriodAggregator
+public class DataApprovalPeriodAggregator
 {
     /**
      * Represents the data approval state transitions from a current state
@@ -209,7 +209,7 @@
      * @param <T> type of items
      * @return the first non-null item
      */
-    private static <T> T firstNonNull(T ...values)
+    private static <T> T firstNonNull( T ...values) 
     {
         for ( T value : values )
         {
@@ -218,6 +218,7 @@
                 return value;
             }
         }
+        
         return null;
     }
 }

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataapproval/DefaultDataApprovalLevelService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataapproval/DefaultDataApprovalLevelService.java	2014-07-05 06:27:29 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataapproval/DefaultDataApprovalLevelService.java	2014-07-18 11:51:12 +0000
@@ -37,8 +37,6 @@
 import java.util.Set;
 
 import org.apache.commons.collections.CollectionUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.hisp.dhis.dataelement.CategoryOptionGroup;
 import org.hisp.dhis.dataelement.CategoryOptionGroupSet;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
@@ -57,8 +55,6 @@
 public class DefaultDataApprovalLevelService
     implements DataApprovalLevelService
 {
-    private final static Log log = LogFactory.getLog( DefaultDataApprovalService.class );
-
     // -------------------------------------------------------------------------
     // Dependencies
     // -------------------------------------------------------------------------

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/datavalue/hibernate/HibernateDataValueAuditStore.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/datavalue/hibernate/HibernateDataValueAuditStore.java	2014-07-10 15:06:47 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/datavalue/hibernate/HibernateDataValueAuditStore.java	2014-07-18 11:51:12 +0000
@@ -92,6 +92,7 @@
     }
 
     @Override
+    @SuppressWarnings("unchecked")
     public Collection<DataValueAudit> getDataValueAudits( DataElement dataElement, Period period,
         OrganisationUnit organisationUnit, DataElementCategoryOptionCombo categoryOptionCombo )
     {

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataapproval/DataApprovalLevelServiceTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataapproval/DataApprovalLevelServiceTest.java	2014-07-05 06:27:29 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataapproval/DataApprovalLevelServiceTest.java	2014-07-18 11:51:12 +0000
@@ -90,12 +90,10 @@
     private DataApprovalLevel level3A;
     private DataApprovalLevel level3B;
     private DataApprovalLevel level3C;
-    private DataApprovalLevel level3D;
 
     private DataApprovalLevel level4;
     private DataApprovalLevel level4A;
     private DataApprovalLevel level4B;
-    private DataApprovalLevel level4C;
     private DataApprovalLevel level4D;
 
     private DataApprovalLevel level5;
@@ -149,12 +147,10 @@
         level3A = new DataApprovalLevel( "3A", 3, setA );
         level3B = new DataApprovalLevel( "3B", 3, setB );
         level3C = new DataApprovalLevel( "3C", 3, setC );
-        level3D = new DataApprovalLevel( "3D", 3, setD );
 
         level4 = new DataApprovalLevel( "04", 4, null );
         level4A = new DataApprovalLevel( "4A", 4, setA );
         level4B = new DataApprovalLevel( "4B", 4, setB );
-        level4C = new DataApprovalLevel( "4C", 4, setC );
         level4D = new DataApprovalLevel( "4D", 4, setD );
 
         level5 = new DataApprovalLevel( "05", 5, null );

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataapproval/DataApprovalServiceTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataapproval/DataApprovalServiceTest.java	2014-06-10 20:46:05 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataapproval/DataApprovalServiceTest.java	2014-07-18 11:51:12 +0000
@@ -28,6 +28,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import static org.hisp.dhis.system.util.CollectionUtils.asSet;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
@@ -57,12 +58,9 @@
 import org.hisp.dhis.user.CurrentUserService;
 import org.hisp.dhis.user.User;
 import org.hisp.dhis.user.UserService;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 
-import static org.hisp.dhis.system.util.CollectionUtils.*;
-
 /**
  * @author Jim Grace
  */

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataapproval/DataApprovalStoreTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataapproval/DataApprovalStoreTest.java	2014-04-28 18:13:09 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataapproval/DataApprovalStoreTest.java	2014-07-18 11:51:12 +0000
@@ -86,10 +86,6 @@
 
     private DataApprovalLevel level2;
 
-    private DataApprovalLevel level3;
-
-    private DataApprovalLevel level4;
-
     private DataSet dataSetA;
 
     private DataSet dataSetB;
@@ -125,8 +121,6 @@
 
         level1 = new DataApprovalLevel( "01", 1, null );
         level2 = new DataApprovalLevel( "02", 2, null );
-        level3 = new DataApprovalLevel( "03", 3, null );
-        level4 = new DataApprovalLevel( "04", 4, null );
 
         PeriodType periodType = PeriodType.getPeriodTypeByName( "Monthly" );
 

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/datavalue/DataValueAuditServiceTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/datavalue/DataValueAuditServiceTest.java	2014-07-10 15:06:47 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/datavalue/DataValueAuditServiceTest.java	2014-07-18 11:51:12 +0000
@@ -43,7 +43,7 @@
 import java.util.Collection;
 import java.util.Date;
 
-import static junit.framework.Assert.assertTrue;
+import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/i18n/I18nServiceTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/i18n/I18nServiceTest.java	2014-05-14 05:24:50 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/i18n/I18nServiceTest.java	2014-07-18 11:51:12 +0000
@@ -108,7 +108,7 @@
         String className = DataElement.class.getSimpleName();
         
         DataElement dataElementA = createDataElement( 'A' );
-        int idA = dataElementService.addDataElement( dataElementA );
+        dataElementService.addDataElement( dataElementA );
         
         Map<String, String> translationsA = new HashMap<String, String>();
         translationsA.put( "name", "frenchNameA" );
@@ -135,13 +135,13 @@
         String className = DataElement.class.getSimpleName();
         
         DataElement dataElementA = createDataElement( 'A' );
-        int idA = dataElementService.addDataElement( dataElementA );
+        dataElementService.addDataElement( dataElementA );
 
         DataElement dataElementB = createDataElement( 'B' );
-        int idB = dataElementService.addDataElement( dataElementB );
+        dataElementService.addDataElement( dataElementB );
 
         DataElement dataElementC = createDataElement( 'C' );
-        int idC = dataElementService.addDataElement( dataElementC );
+        dataElementService.addDataElement( dataElementC );
         
         List<DataElement> elements = new ArrayList<DataElement>();
         elements.add( dataElementA );