Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/shared/model/FixAnalysisArtifact.java @ 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 |
parents | f14d4c668ec5 |
children | 6b5920c7ea6e |
comparison
equal
deleted
inserted
replaced
3367:cccd6183b046 | 3368:bf080e932d54 |
---|---|
60 } | 60 } |
61 | 61 |
62 String from = artifactDescription.getDataValueAsString("from"); | 62 String from = artifactDescription.getDataValueAsString("from"); |
63 if (from != null) { | 63 if (from != null) { |
64 try { | 64 try { |
65 double fkm = Double.valueOf(from).doubleValue(); | 65 double fkm = Double.parseDouble(from); |
66 this.filter.setFromKm(fkm); | 66 this.filter.setFromKm(fkm); |
67 } | 67 } |
68 catch(NumberFormatException nfe) { | 68 catch(NumberFormatException nfe) { |
69 GWT.log("Could not parse from km."); | 69 GWT.log("Could not parse from km."); |
70 } | 70 } |
71 } | 71 } |
72 | 72 |
73 String to = artifactDescription.getDataValueAsString("to"); | 73 String to = artifactDescription.getDataValueAsString("to"); |
74 if (to != null) { | 74 if (to != null) { |
75 try { | 75 try { |
76 double tkm = Double.valueOf(to).doubleValue(); | 76 double tkm = Double.parseDouble(to); |
77 this.filter.setToKm(tkm); | 77 this.filter.setToKm(tkm); |
78 } | 78 } |
79 catch(NumberFormatException nfe) { | 79 catch(NumberFormatException nfe) { |
80 GWT.log("Could not parse to km"); | 80 GWT.log("Could not parse to km"); |
81 } | 81 } |
104 } | 104 } |
105 | 105 |
106 String q1 = artifactDescription.getDataValueAsString("q1"); | 106 String q1 = artifactDescription.getDataValueAsString("q1"); |
107 if (q1 != null) { | 107 if (q1 != null) { |
108 try { | 108 try { |
109 int q1i = Integer.valueOf(q1).intValue(); | 109 int q1i = Integer.parseInt(q1); |
110 this.filter.setFromClass(q1i); | 110 this.filter.setFromClass(q1i); |
111 } | 111 } |
112 catch(NumberFormatException nfe) { | 112 catch(NumberFormatException nfe) { |
113 GWT.log("Could not parse start class"); | 113 GWT.log("Could not parse start class"); |
114 } | 114 } |
115 } | 115 } |
116 | 116 |
117 String q2 = artifactDescription.getDataValueAsString("q2"); | 117 String q2 = artifactDescription.getDataValueAsString("q2"); |
118 if (q2 != null) { | 118 if (q2 != null) { |
119 try { | 119 try { |
120 int q2i =Integer.valueOf(q2).intValue(); | 120 int q2i = Integer.parseInt(q2); |
121 this.filter.setToClass(q2i); | 121 this.filter.setToClass(q2i); |
122 } | 122 } |
123 catch(NumberFormatException nfe) { | 123 catch(NumberFormatException nfe) { |
124 GWT.log("could not parse end class"); | 124 GWT.log("could not parse end class"); |
125 } | 125 } |