In AnnotationSetImpl, get() methods that use the annotation-type index call indexByType() to generate that index. Some of these calls were preceeded by the test if (annotsByType == null) ... However, this test is unnecessary, because it's always safe to call indexByType(). indexByType() will not regenerate annotsByType, because it starts with its own test: if (annotsByType != null) return;.
By the same reasoning, it should also be safe to remove tests of the form if (annotsByStartNode == null) ... from the get() methods that have them, as well as similar tests on annotsByEndNode. These changes are not included in this patch.
remove redundant tests on annotsByType