mirror of
https://github.com/kennytv/Maintenance.git
synced 2026-11-04 16:50:07 -05:00
Fix potential config deserialization error
This commit is contained in:
1 parent
1de926bb28
commit
ac19bac11c
1 file changed
+10
-4
+10
-4
@@ -119,14 +119,20 @@ public final class ConfigSerializer {
|
||||
if (indents <= currentIndents) {
|
||||
final String[] array = key.split(PATH_SEPARATOR_QUOTED);
|
||||
final int backspace = currentIndents - indents + 1;
|
||||
key = join(array, array.length - backspace);
|
||||
final int delta = array.length - backspace;
|
||||
key = delta >= 0 ? join(array, delta) : key;
|
||||
}
|
||||
|
||||
final String separator = key.isEmpty() ? "" : PATH_SEPARATOR_STRING;
|
||||
final String lineKey = line.contains(":") ? line.split(Pattern.quote(":"))[0] : line;
|
||||
key += separator + lineKey.substring(indent);
|
||||
currentIndents = indents;
|
||||
|
||||
final String separator = key.isEmpty() ? "" : PATH_SEPARATOR_STRING;
|
||||
final String substring = line.substring(indent).trim();
|
||||
if (substring.isEmpty() || substring.charAt(0) == '-') continue;
|
||||
if (!line.contains(":")) continue;
|
||||
|
||||
final String lineKey = line.split(Pattern.quote(":"))[0];
|
||||
key += separator + lineKey.substring(indent);
|
||||
|
||||
if (!currentComments.isEmpty()) {
|
||||
comments.put(key, currentComments.toArray(EMPTY));
|
||||
currentComments.clear();
|
||||
|
||||
Reference in new issue
Block a user