Skip to content

Commit

Permalink
fix bug in parameter parser
Browse files Browse the repository at this point in the history
  • Loading branch information
chenson42 committed Jan 31, 2012
1 parent 9d28f63 commit 9141d45
Showing 1 changed file with 4 additions and 1 deletion.
Expand Up @@ -29,6 +29,7 @@
import java.util.TreeMap;

import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -52,7 +53,6 @@ public Map<String, ParameterMetaData> parse() {
ParameterMetaData currentMetaData = new ParameterMetaData();
for (String line : lines) {
if (line.trim().startsWith(COMMENT) && line.length() > 1) {

line = line.substring(line.indexOf(COMMENT) + 1);
if (line.contains(DATABASE_OVERRIDABLE)) {
currentMetaData.setDatabaseOverridable(Boolean.parseBoolean(line.substring(
Expand All @@ -79,6 +79,9 @@ public Map<String, ParameterMetaData> parse() {
currentMetaData.setDefaultValue(defaultValue);
metaData.put(key, currentMetaData);
currentMetaData = new ParameterMetaData();
} else if (StringUtils.isBlank(line)) {
// reset the metadata
currentMetaData = new ParameterMetaData();
}
}
} catch (IOException e) {
Expand Down

0 comments on commit 9141d45

Please sign in to comment.