summaryrefslogtreecommitdiff
path: root/src/com/android/loganalysis/parser/AbstractSectionParser.java
diff options
context:
space:
mode:
authorEric Rowe <erowe@google.com>2013-06-19 16:51:20 -0700
committerEric Rowe <erowe@google.com>2013-06-19 16:57:40 -0700
commit2109e00b8c0dd5b4a45b789a96c999818265be7c (patch)
tree2e89988662b4fdd6a905c4bb4c41504b8c34db5c /src/com/android/loganalysis/parser/AbstractSectionParser.java
parent2bfdd6f316369510613ef05f741f301a95e06381 (diff)
downloadloganalysis-2109e00b8c0dd5b4a45b789a96c999818265be7c.tar.gz
Make all parsers return null.
When a parser receives an empty input ("".equals(input.trim())), then return null, not new IItem() with no input. If there is input but invalid, a non-null is still returned. This fixes the case in bugreports where the section is listed but there is no input. For example: ----- SECTION 1 ------ ----- SECTION 2 ------ text In this case, the section 1 parser would return null. Change-Id: Ifdfabc3bc40aa2303fcbc11ec6ccbf63167d54ae
Diffstat (limited to 'src/com/android/loganalysis/parser/AbstractSectionParser.java')
-rw-r--r--src/com/android/loganalysis/parser/AbstractSectionParser.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/com/android/loganalysis/parser/AbstractSectionParser.java b/src/com/android/loganalysis/parser/AbstractSectionParser.java
index 91baeaa..57974fb 100644
--- a/src/com/android/loganalysis/parser/AbstractSectionParser.java
+++ b/src/com/android/loganalysis/parser/AbstractSectionParser.java
@@ -72,10 +72,7 @@ public abstract class AbstractSectionParser implements IParser {
}
} else {
runCurrentParser();
- mParseBlock.clear();
mCurrentParser = nextParser;
-
- onSwitchParser();
}
}
@@ -105,6 +102,9 @@ public abstract class AbstractSectionParser implements IParser {
mCurrentParser = parser;
}
+ /**
+ * Callback for when parsers are switched.
+ */
protected void onSwitchParser() {
}
@@ -119,6 +119,9 @@ public abstract class AbstractSectionParser implements IParser {
// CLog.v("Just ran the %s parser", mCurrentParser.getClass().getSimpleName());
}
}
+
+ mParseBlock.clear();
+ onSwitchParser();
}
}