AdoptOpenJDK/jitwatch — pull request #76 by neomatrix369 (2014-05-31 18:05:56+00:00)
Title: Improve test coverage for TagProcessor

TagProcessor coverage is further improved with this pull request. Only the test class has been modified in this changeset:

* TagProcesserTest

@chriswhocodes:
When does the below block get executed:

```
if (topTag instanceof Task)
{
switch (name)
{
case JITWatchConstants.TAG_TYPE:
((Task) topTag).addDictionaryType(attrs.get(JITWatchConstants.ATTR_ID), t);
break;

case JITWatchConstants.TAG_METHOD:
((Task) topTag).addDictionaryMethod(attrs.get(JITWatchConstants.ATTR_ID), t);
break;

case JITWatchConstants.TAG_KLASS:
((Task) topTag).addDictionaryKlass(attrs.get(JITWatchConstants.ATTR_ID), t);
break;

default:
break;
}
}
```

As the below block always supersedes and makes the above block redundant:
```
if (JITWatchConstants.TAG_TASK.equals(name))
{
t = new Task(name, attrs, selfClosing, currentCompiler);
}
else
{
t = new Tag(name, attrs, selfClosing);
}
```

Maybe I have got it wrong, but if I remove the first block everything should still work. There is also no test coverage available for the first block. I think the condition checks are contradictory.

If you can give me an example of a set of tags that creates execution path between the two blocks I'll be more than happy to create a test case for you.