Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/StateFactory.java @ 3453:e74e707ff650
Replace string comparison with empty string with length equals zero comparison
flys-artifacts/trunk@5117 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Tue, 24 Jul 2012 09:16:00 +0000 |
parents | 45f7762767e2 |
children |
comparison
equal
deleted
inserted
replaced
3452:200e70f31f6f | 3453:e74e707ff650 |
---|---|
101 String type = (String) XMLUtils.xpath( | 101 String type = (String) XMLUtils.xpath( |
102 data, XPATH_DATA_TYPE, XPathConstants.STRING); | 102 data, XPATH_DATA_TYPE, XPathConstants.STRING); |
103 String desc = (String) XMLUtils.xpath( | 103 String desc = (String) XMLUtils.xpath( |
104 data, XPATH_DATA_DESCRIPTION, XPathConstants.STRING); | 104 data, XPATH_DATA_DESCRIPTION, XPathConstants.STRING); |
105 | 105 |
106 if (name == null || name.equals("")) { | 106 if (name == null || name.length() == 0) { |
107 logger.warn("No name for data item at pos " + i + " found."); | 107 logger.warn("No name for data item at pos " + i + " found."); |
108 continue; | 108 continue; |
109 } | 109 } |
110 | 110 |
111 if (type == null || type.equals("")) { | 111 if (type == null || type.length() == 0) { |
112 logger.warn("No type for data item at pos " + i + " found."); | 112 logger.warn("No type for data item at pos " + i + " found."); |
113 logger.warn("Default type 'string' used."); | 113 logger.warn("Default type 'string' used."); |
114 type = "string"; | 114 type = "string"; |
115 } | 115 } |
116 | 116 |