← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 17165: Timer, removed generics

 

------------------------------------------------------------
revno: 17165
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Sun 2014-10-19 10:38:19 +0200
message:
  Timer, removed generics
modified:
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/AbstractEventService.java
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/JacksonEventService.java
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/DefaultImportService.java
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/DefaultObjectBridge.java
  dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/timer/SystemNanoTimer.java
  dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/timer/Timer.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-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/AbstractEventService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/AbstractEventService.java	2014-10-19 08:26:12 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/AbstractEventService.java	2014-10-19 08:38:19 +0000
@@ -179,7 +179,7 @@
     {
         notifier.clear( taskId ).notify( taskId, "Importing events" );
 
-        Timer<Long> timer = new SystemNanoTimer().start();
+        Timer timer = new SystemNanoTimer().start();
 
         ImportSummaries importSummaries = addEvents( events, importOptions );
 

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/JacksonEventService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/JacksonEventService.java	2014-10-19 08:26:12 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/JacksonEventService.java	2014-10-19 08:38:19 +0000
@@ -120,7 +120,7 @@
 
         notifier.clear( taskId ).notify( taskId, "Importing events" );
 
-        Timer<Long> timer = new SystemNanoTimer().start();
+        Timer timer = new SystemNanoTimer().start();
 
         try
         {
@@ -182,7 +182,7 @@
 
         notifier.clear( taskId ).notify( taskId, "Importing events" );
 
-        Timer<Long> timer = new SystemNanoTimer().start();
+        Timer timer = new SystemNanoTimer().start();
 
         try
         {

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/DefaultImportService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/DefaultImportService.java	2014-10-19 08:26:12 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/DefaultImportService.java	2014-10-19 08:38:19 +0000
@@ -144,7 +144,7 @@
         log.info( "User '" + username + "' started import at " + new Date() );
 
         notifier.clear( taskId ).notify( taskId, "Importing meta-data" );
-        Timer<Long> timer = new SystemNanoTimer().start();
+        Timer timer = new SystemNanoTimer().start();
 
         ImportSummary importSummary = new ImportSummary();
 

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/DefaultObjectBridge.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/DefaultObjectBridge.java	2014-10-19 08:26:12 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/DefaultObjectBridge.java	2014-10-19 08:38:19 +0000
@@ -127,8 +127,7 @@
     public void init()
     {
         log.info( "Building object-bridge maps (preheatCache: " + preheatCache + ")." );
-        Timer<Long> timer = new SystemNanoTimer();
-        timer.start();
+        Timer timer = new SystemNanoTimer().start();
 
         masterMap = Maps.newHashMap();
         periodTypeMap = Maps.newHashMap();

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/timer/SystemNanoTimer.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/timer/SystemNanoTimer.java	2014-10-19 08:26:12 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/timer/SystemNanoTimer.java	2014-10-19 08:38:19 +0000
@@ -33,28 +33,29 @@
 /**
  * @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
  */
-public class SystemNanoTimer implements Timer<Long>
+public class SystemNanoTimer 
+    implements Timer
 {
     private long _start = 0;
 
     private long _end = 0;
 
     @Override
-    public Timer<Long> start()
+    public Timer start()
     {
         _start = System.nanoTime();
         return this;
     }
 
     @Override
-    public Timer<Long> stop()
+    public Timer stop()
     {
         _end = System.nanoTime();
         return this;
     }
 
     @Override
-    public Long getDuration()
+    public Long duration()
     {
         return _end - _start;
     }
@@ -62,7 +63,7 @@
     @Override
     public String toString()
     {
-        double seconds = TimeUnit.MILLISECONDS.convert( getDuration(), TimeUnit.NANOSECONDS ) / 1000.0f;
+        double seconds = TimeUnit.MILLISECONDS.convert( duration(), TimeUnit.NANOSECONDS ) / 1000.0f;
         return String.format( "%.2f seconds", seconds );
     }
 }

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/timer/Timer.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/timer/Timer.java	2014-10-19 08:26:12 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/timer/Timer.java	2014-10-19 08:38:19 +0000
@@ -33,11 +33,11 @@
  *
  * @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
  */
-public interface Timer<T>
+public interface Timer
 {
-    Timer<T> start();
-
-    Timer<T> stop();
-
-    T getDuration();
+    Timer start();
+
+    Timer stop();
+
+    Long duration();
 }