Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/CrossSectionArtifact.java @ 3405:b0ba96bbf01d
Use Integer.parseInt() instead of Integer.valueOf() + Autounboxing.
flys-artifacts/trunk@5057 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Thu, 19 Jul 2012 09:37:52 +0000 |
parents | d9af29a4bb85 |
children | afc7bfb4800b |
comparison
equal
deleted
inserted
replaced
3404:d7b065b88f10 | 3405:b0ba96bbf01d |
---|---|
95 throw new IllegalArgumentException("No attribute 'ids' found!"); | 95 throw new IllegalArgumentException("No attribute 'ids' found!"); |
96 } | 96 } |
97 | 97 |
98 List<Facet> fs = new ArrayList<Facet>(); | 98 List<Facet> fs = new ArrayList<Facet>(); |
99 CrossSection cs = CrossSectionFactory.getCrossSection( | 99 CrossSection cs = CrossSectionFactory.getCrossSection( |
100 Integer.valueOf(ids)); | 100 Integer.parseInt(ids)); |
101 | 101 |
102 List<CrossSectionLine> csls = cs.getLines(); | 102 List<CrossSectionLine> csls = cs.getLines(); |
103 if (!csls.isEmpty()) { | 103 if (!csls.isEmpty()) { |
104 CrossSectionLine csl = csls.get(0); | 104 CrossSectionLine csl = csls.get(0); |
105 // Find min-km of cross sections, | 105 // Find min-km of cross sections, |
196 * Get a DataItem casted to int (0 if fails). | 196 * Get a DataItem casted to int (0 if fails). |
197 */ | 197 */ |
198 public int getDataAsIntNull(String dataName) { | 198 public int getDataAsIntNull(String dataName) { |
199 String val = getDataAsString(dataName); | 199 String val = getDataAsString(dataName); |
200 try { | 200 try { |
201 return Integer.valueOf(val); | 201 return Integer.parseInt(val); |
202 } | 202 } |
203 catch (NumberFormatException e) { | 203 catch (NumberFormatException e) { |
204 logger.warn("Could not get data " + dataName + " as int", e); | 204 logger.warn("Could not get data " + dataName + " as int", e); |
205 return 0; | 205 return 0; |
206 } | 206 } |