In case a parsed file has no Intents AND the flag ICC_SHOW_VARS is set to TRUE, then the application throws a runtime exception (NullPointerException) at line 110 from Main.java.
The exception occurs because if there's no intents, the first loop will be skipped. By skipping the loop on intents.entrySet(), the reference info is never initialized.
Consequentially, if the following if-statement if (ICC_SHOW_VARS) is enabled, the System.out.printf command is going to reference info.type, halting the execution.
See the following lines for reference:
Main.java
// printing the intents
Map<String, IntentInfo> intents = resultsEntry.getValue().intentsST.getMap();
IntentInfo info = null;
for(Map.Entry<String, IntentInfo> intentEntry : intents.entrySet())
{
info = intentEntry.getValue();
if ((info.isExplicit() && ICC_SHOW_EXPLICIT_INTENTS) ||
(!info.isExplicit() && ICC_SHOW_IMPLICIT_INTENTS))
{
System.out.println(String.format("%s:\n%s\n----------", intentEntry.getKey(), intentEntry.getValue()));
}
}
// printing the vars
if (ICC_SHOW_VARS)
{
Map<String, VarInfo> vars = resultsEntry.getValue().varsST.getMap();
for(Map.Entry<String, VarInfo> varEntry : vars.entrySet())
{
String name = varEntry.getKey();
VarInfo varInfo = varEntry.getValue();
System.out.printf("%s %s = %s\n", info.type, name, varInfo.value);
}
}
In case a parsed file has no Intents AND the flag ICC_SHOW_VARS is set to TRUE, then the application throws a runtime exception (NullPointerException) at line 110 from Main.java.
The exception occurs because if there's no intents, the first loop will be skipped. By skipping the loop on
intents.entrySet(), the referenceinfois never initialized.Consequentially, if the following if-statement
if (ICC_SHOW_VARS)is enabled, theSystem.out.printfcommand is going to referenceinfo.type, halting the execution.See the following lines for reference:
Main.java