changeset 3368:bf080e932d54

Use more idiomatic Java when parsing doubles and ints. flys-client/trunk@5055 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Thu, 19 Jul 2012 09:00:42 +0000 (2012-07-19)
parents cccd6183b046
children 20688790f0c0
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/NaviChartOutputTab.java flys-client/src/main/java/de/intevation/flys/client/client/ui/fixation/FixGaugeSelectPanel.java flys-client/src/main/java/de/intevation/flys/client/shared/model/DoubleProperty.java flys-client/src/main/java/de/intevation/flys/client/shared/model/FixAnalysisArtifact.java
diffstat 5 files changed, 19 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Thu Jul 19 08:51:01 2012 +0000
+++ b/flys-client/ChangeLog	Thu Jul 19 09:00:42 2012 +0000
@@ -1,3 +1,11 @@
+2012-07-19	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
+
+	* src/main/java/de/intevation/flys/client/shared/model/FixAnalysisArtifact.java,
+	  src/main/java/de/intevation/flys/client/shared/model/DoubleProperty.java,
+	  src/main/java/de/intevation/flys/client/client/ui/fixation/FixGaugeSelectPanel.java,
+	  src/main/java/de/intevation/flys/client/client/ui/chart/NaviChartOutputTab.java:
+	  Use more idiomatic Java when parsing doubles and ints.
+
 2012-07-19	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
 
 	* ChangeLog: Removed remains from former conflict.
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/NaviChartOutputTab.java	Thu Jul 19 08:51:01 2012 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/NaviChartOutputTab.java	Thu Jul 19 09:00:42 2012 +0000
@@ -86,7 +86,7 @@
 
         String s = fix.getArtifactDescription().getDataValueAsString("step");
         try {
-            double ds = Double.valueOf(s).doubleValue();
+            double ds = Double.parseDouble(s);
             collectionView.setSteps(ds);
         }
         catch(NumberFormatException nfe) {
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/fixation/FixGaugeSelectPanel.java	Thu Jul 19 08:51:01 2012 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/fixation/FixGaugeSelectPanel.java	Thu Jul 19 09:00:42 2012 +0000
@@ -163,8 +163,8 @@
         String v1 = from.getValueAsString();
         String v2 = to.getValueAsString();
         try {
-            int v1i = Integer.valueOf(v1).intValue();
-            int v2i = Integer.valueOf(v2).intValue();
+            int v1i = Integer.parseInt(v1);
+            int v2i = Integer.parseInt(v2);
             if (v1i <= v2i) {
                 this.first = v1;
                 this.second = v2;
--- a/flys-client/src/main/java/de/intevation/flys/client/shared/model/DoubleProperty.java	Thu Jul 19 08:51:01 2012 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/shared/model/DoubleProperty.java	Thu Jul 19 09:00:42 2012 +0000
@@ -35,8 +35,9 @@
     @Override
     public Double getValue() {
         try {
-            GWT.log("returning: " + Double.valueOf(this.value));
-            return Double.valueOf(this.value);
+            Double value = Double.valueOf(this.value);
+            GWT.log("returning: " + value);
+            return value;
         }
         catch(NumberFormatException nfe) {
             //Should never happen, if property is used correctly.
@@ -65,7 +66,7 @@
         double dv;
         NumberFormat nf = NumberFormat.getDecimalFormat();
         try {
-            dv = Double.valueOf(this.value).doubleValue();
+            dv = Double.parseDouble(this.value);
         }
         catch (NumberFormatException nfe) {
             return null;
--- a/flys-client/src/main/java/de/intevation/flys/client/shared/model/FixAnalysisArtifact.java	Thu Jul 19 08:51:01 2012 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/shared/model/FixAnalysisArtifact.java	Thu Jul 19 09:00:42 2012 +0000
@@ -62,7 +62,7 @@
         String from = artifactDescription.getDataValueAsString("from");
         if (from != null) {
             try {
-                double fkm = Double.valueOf(from).doubleValue();
+                double fkm = Double.parseDouble(from);
                 this.filter.setFromKm(fkm);
             }
             catch(NumberFormatException nfe) {
@@ -73,7 +73,7 @@
         String to = artifactDescription.getDataValueAsString("to");
         if (to != null) {
             try {
-                double tkm = Double.valueOf(to).doubleValue();
+                double tkm = Double.parseDouble(to);
                 this.filter.setToKm(tkm);
             }
             catch(NumberFormatException nfe) {
@@ -106,7 +106,7 @@
         String q1 = artifactDescription.getDataValueAsString("q1");
         if (q1 != null) {
             try {
-                int q1i = Integer.valueOf(q1).intValue();
+                int q1i = Integer.parseInt(q1);
                 this.filter.setFromClass(q1i);
             }
             catch(NumberFormatException nfe) {
@@ -117,7 +117,7 @@
         String q2 = artifactDescription.getDataValueAsString("q2");
         if (q2 != null) {
             try {
-                int q2i =Integer.valueOf(q2).intValue();
+                int q2i = Integer.parseInt(q2);
                 this.filter.setToClass(q2i);
             }
             catch(NumberFormatException nfe) {

http://dive4elements.wald.intevation.org