throw new CorruptedDatabaseFileException(this.fileName, "No \"value=bla\" found."); //NOI18N
}
- Pattern pattern = Pattern.compile("(key=([a-z0-9_]{1,}),value=\"([^\"]*)\";){1,}"); //NOI18N
+ Pattern pattern = Pattern.compile("(key=([a-zA-Z0-9_]{1,}),value=\"([^\"]*)\";){1,}"); //NOI18N
Matcher matcher = pattern.matcher(line);
// Debug message
// Matches?
if (!matcher.matches()) {
// Corrupted file found
- throw new CorruptedDatabaseFileException(this.fileName, MessageFormat.format("line {0} doesn't match regular expression.", line)); //NOI18N
+ throw new CorruptedDatabaseFileException(this.fileName, MessageFormat.format("line {0} does not match regular expression.", line)); //NOI18N
}
// Instance map
Map<String, String> map = new HashMap<>(line.length() / 40);
- pattern = Pattern.compile("(key=([a-z0-9_]{1,}),value=\"([^\"]*)\";)"); //NOI18N
+ pattern = Pattern.compile("(key=([a-zA-Z0-9_]{1,}),value=\"([^\"]*)\";)"); //NOI18N
matcher = pattern.matcher(line);
// Init group count
String key = matcher.group(2);
String value = matcher.group(3);
+ // Debug log
+ this.getLogger().debug(MessageFormat.format("match={0},key={1},value={2}", match, key, value));
+
// key must noch be empty
assert ((key != null) && (!key.isEmpty())) : MessageFormat.format("key={0} is not valid", key); //NOI18N