comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/StaticWQKmsArtifact.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 5642a83420f2
children afc7bfb4800b
comparison
equal deleted inserted replaced
3404:d7b065b88f10 3405:b0ba96bbf01d
62 Document data) 62 Document data)
63 { 63 {
64 logger.debug("StaticWQKmsArtifact.setup"); 64 logger.debug("StaticWQKmsArtifact.setup");
65 65
66 // Store the 'ids' (from datacage). 66 // Store the 'ids' (from datacage).
67 logger.debug("StaticWQKmsArtiact.setup" + XMLUtils.toString(data)); 67 if (logger.isDebugEnabled()) {
68 logger.debug("StaticWQKmsArtiact.setup" + XMLUtils.toString(data));
69 }
68 70
69 String code = getDatacageIDValue(data); 71 String code = getDatacageIDValue(data);
70 addStringData("ids", code); 72 addStringData("ids", code);
71 if (code != null) { 73 if (code != null) {
72 String [] parts = code.split("-"); 74 String [] parts = code.split("-");
73 75
74 if (parts.length >= 4) { 76 if (parts.length >= 4) {
75 int col = Integer.valueOf(parts[2]); 77 int col = Integer.parseInt(parts[2]);
76 int wst = Integer.valueOf(parts[3]); 78 int wst = Integer.parseInt(parts[3]);
77 79
78 addStringData("col_pos", parts[2]); 80 addStringData("col_pos", parts[2]);
79 addStringData("wst_id", parts[3]); 81 addStringData("wst_id", parts[3]);
80 } 82 }
81 } 83 }
121 * @return WQKms according to parameterization (can be null); 123 * @return WQKms according to parameterization (can be null);
122 */ 124 */
123 public WQKms getWQKms() { 125 public WQKms getWQKms() {
124 logger.debug("StaticWQKmsArtifact.getWQKms"); 126 logger.debug("StaticWQKmsArtifact.getWQKms");
125 127
126 int col = Integer.valueOf(getDataAsString("col_pos")); 128 int col = Integer.parseInt(getDataAsString("col_pos"));
127 int wst = Integer.valueOf(getDataAsString("wst_id")); 129 int wst = Integer.parseInt(getDataAsString("wst_id"));
128 130
129 /** TODO do not run twice against db to do this. */ 131 /** TODO do not run twice against db to do this. */
130 String wkmsName = WKmsFactory.getWKmsName(col, wst); 132 String wkmsName = WKmsFactory.getWKmsName(col, wst);
131 133
132 WQKms res = WQKmsFactory.getWQKms( 134 WQKms res = WQKmsFactory.getWQKms(col, wst);
133 Integer.valueOf(getDataAsString("col_pos")),
134 Integer.valueOf(getDataAsString("wst_id")));
135 res.setName(wkmsName); 135 res.setName(wkmsName);
136 return res; 136 return res;
137 } 137 }
138 138
139 139

http://dive4elements.wald.intevation.org