# HG changeset patch # User Sascha L. Teichmann # Date 1342688442 0 # Node ID bf080e932d541d069ba695e589d7025339c80d1d # Parent cccd6183b0464aa9e09baeec6b27f7fa958339f3 Use more idiomatic Java when parsing doubles and ints. flys-client/trunk@5055 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r cccd6183b046 -r bf080e932d54 flys-client/ChangeLog --- 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 + + * 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 * ChangeLog: Removed remains from former conflict. diff -r cccd6183b046 -r bf080e932d54 flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/NaviChartOutputTab.java --- 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) { diff -r cccd6183b046 -r bf080e932d54 flys-client/src/main/java/de/intevation/flys/client/client/ui/fixation/FixGaugeSelectPanel.java --- 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; diff -r cccd6183b046 -r bf080e932d54 flys-client/src/main/java/de/intevation/flys/client/shared/model/DoubleProperty.java --- 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; diff -r cccd6183b046 -r bf080e932d54 flys-client/src/main/java/de/intevation/flys/client/shared/model/FixAnalysisArtifact.java --- 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) {