BATCH-1033: Updated to account for the possibility of a null key in the map

This commit is contained in:
dhgarrette
2009-01-28 05:19:31 +00:00
parent 18f7870ba2
commit 505d8532f9
2 changed files with 36 additions and 10 deletions

View File

@@ -56,13 +56,14 @@ public class PrefixMatchingCompositeLineTokenizer implements LineTokenizer, Init
if (line != null) {
for (String key : delegates.keySet()) {
if ("".equals(key)) {
defaultDelegate = delegates.get(key);
// don't break here or the delegate may not be found
}
else if (line.startsWith(key)) {
delegate = delegates.get(key);
break;
if (key != null) {
if ("".equals(key)) {
defaultDelegate = delegates.get(key);
}
else if (line.startsWith(key)) {
delegate = delegates.get(key);
break;
}
}
}