← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 18767: Upgrade dependencies to org.apache.commons.math3

 

------------------------------------------------------------
revno: 18767
committer: Jason P. Pickering <jason.p.pickering@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2015-03-31 10:46:53 +0200
message:
  Upgrade dependencies to org.apache.commons.math3 
modified:
  dhis-2/dhis-services/dhis-service-administration/pom.xml
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/gml/GmlConversionUtils.java
  dhis-2/dhis-services/dhis-service-reporting/pom.xml
  dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/chart/impl/DefaultChartService.java
  dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/dataelementhistory/DefaultHistoryRetriever.java
  dhis-2/dhis-support/dhis-support-system/pom.xml
  dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/grid/ListGrid.java
  dhis-2/pom.xml


--
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-administration/pom.xml'
--- dhis-2/dhis-services/dhis-service-administration/pom.xml	2015-01-23 14:07:46 +0000
+++ dhis-2/dhis-services/dhis-service-administration/pom.xml	2015-03-31 08:46:53 +0000
@@ -33,8 +33,9 @@
       <artifactId>commons-logging</artifactId>
     </dependency>
     <dependency>
-      <groupId>commons-math</groupId>
-      <artifactId>commons-math</artifactId>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-math3</artifactId>
+      <version>3.4.1</version>
     </dependency>
     
   </dependencies>

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/gml/GmlConversionUtils.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/gml/GmlConversionUtils.java	2015-03-24 16:52:51 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/gml/GmlConversionUtils.java	2015-03-31 08:46:53 +0000
@@ -28,7 +28,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import org.apache.commons.math.util.MathUtils;
+import org.apache.commons.math3.util.Precision;
 
 import java.text.NumberFormat;
 import java.text.ParseException;
@@ -132,6 +132,6 @@
     private static String parseCoordinate( String number, int precision, NumberFormat nf )
         throws ParseException
     {
-        return Double.toString( MathUtils.round( nf.parse( number ).doubleValue(), precision ) );
+        return Double.toString( Precision.round(nf.parse(number).doubleValue(), precision ) );
     }
 }

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/pom.xml'
--- dhis-2/dhis-services/dhis-service-reporting/pom.xml	2015-03-06 11:35:01 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/pom.xml	2015-03-31 08:46:53 +0000
@@ -87,8 +87,9 @@
     <!-- Other -->
     
     <dependency>
-      <groupId>commons-math</groupId>
-      <artifactId>commons-math</artifactId>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-math3</artifactId>
+      <version>3.4.1</version>
     </dependency>
     <dependency>
       <groupId>org.hisp.dhis</groupId>

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/chart/impl/DefaultChartService.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/chart/impl/DefaultChartService.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/chart/impl/DefaultChartService.java	2015-03-31 08:46:53 +0000
@@ -52,11 +52,11 @@
 import java.util.Map;
 import java.util.Map.Entry;
 
-import org.apache.commons.math.MathException;
-import org.apache.commons.math.analysis.SplineInterpolator;
-import org.apache.commons.math.analysis.UnivariateRealFunction;
-import org.apache.commons.math.analysis.UnivariateRealInterpolator;
-import org.apache.commons.math.stat.regression.SimpleRegression;
+import org.apache.commons.math3.exception.MathRuntimeException;
+import org.apache.commons.math3.analysis.interpolation.SplineInterpolator;
+import org.apache.commons.math3.analysis.UnivariateFunction;
+import org.apache.commons.math3.analysis.interpolation.UnivariateInterpolator;
+import org.apache.commons.math3.stat.regression.SimpleRegression;
 import org.hisp.dhis.analytics.AnalyticsService;
 import org.hisp.dhis.analytics.event.EventAnalyticsService;
 import org.hisp.dhis.chart.BaseChart;
@@ -340,7 +340,7 @@
         MinMaxDataElement minMax = minMaxDataElementService.getMinMaxDataElement( organisationUnit, dataElement,
             categoryOptionCombo );
 
-        UnivariateRealInterpolator interpolator = new SplineInterpolator();
+        UnivariateInterpolator interpolator = new SplineInterpolator();
 
         Integer periodCount = 0;
         List<Double> x = new ArrayList<>();
@@ -396,7 +396,7 @@
 
             try
             {
-                UnivariateRealFunction function = interpolator.interpolate( xa, getArray( y ) );
+                UnivariateFunction function = interpolator.interpolate( xa, getArray( y ) );
 
                 for ( Period period : periods )
                 {
@@ -406,7 +406,7 @@
                     }
                 }
             }
-            catch ( MathException ex )
+            catch ( MathRuntimeException ex )
             {
                 throw new RuntimeException( "Failed to interpolate", ex );
             }

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/dataelementhistory/DefaultHistoryRetriever.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/dataelementhistory/DefaultHistoryRetriever.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/dataelementhistory/DefaultHistoryRetriever.java	2015-03-31 08:46:53 +0000
@@ -30,7 +30,7 @@
 
 import java.util.List;
 
-import org.apache.commons.math.util.MathUtils;
+import org.apache.commons.math3.util.Precision;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
 import org.hisp.dhis.datavalue.DataValue;
@@ -129,7 +129,7 @@
                 max = Math.max( max, historyPoint.getValue() );
                 total += historyPoint.getValue();
                 average = total / ++count;
-                average = MathUtils.round( average, 1 );
+                average = Precision.round( average, 1 );
             }
 
             historyPoint.setAverage( average );

=== modified file 'dhis-2/dhis-support/dhis-support-system/pom.xml'
--- dhis-2/dhis-support/dhis-support-system/pom.xml	2015-03-05 18:41:52 +0000
+++ dhis-2/dhis-support/dhis-support-system/pom.xml	2015-03-31 08:46:53 +0000
@@ -107,8 +107,9 @@
       <artifactId>commons-codec</artifactId>
     </dependency>
     <dependency>
-      <groupId>commons-math</groupId>
-      <artifactId>commons-math</artifactId>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-math3</artifactId>
+      <version>3.4.1</version>
     </dependency>
     <dependency>
       <groupId>commons-validator</groupId>

=== 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-03-07 16:16:41 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/grid/ListGrid.java	2015-03-31 08:46:53 +0000
@@ -45,7 +45,7 @@
 import net.sf.jasperreports.engine.JRException;
 import net.sf.jasperreports.engine.JRField;
 
-import org.apache.commons.math.stat.regression.SimpleRegression;
+import org.apache.commons.math3.stat.regression.SimpleRegression;
 import org.hisp.dhis.common.Grid;
 import org.hisp.dhis.common.GridHeader;
 import org.hisp.dhis.common.adapter.JacksonRowDataSerializer;

=== modified file 'dhis-2/pom.xml'
--- dhis-2/pom.xml	2015-03-30 02:29:33 +0000
+++ dhis-2/pom.xml	2015-03-31 08:46:53 +0000
@@ -653,9 +653,9 @@
         <version>1.9</version>
       </dependency>
       <dependency>
-        <groupId>commons-math</groupId>
-        <artifactId>commons-math</artifactId>
-        <version>1.2</version>
+        <groupId>org.apache.commons</groupId>
+        <artifactId>commons-math3</artifactId>
+        <version>3.4.1</version>
       </dependency>
       <dependency>
         <groupId>commons-validator</groupId>