private static void checkSillyStep(AnnotationHolder holder, XPathStep step) {
    final XPathExpression previousStep = step.getPreviousStep();
    if (previousStep instanceof XPathStep) {
      final XPathNodeTest nodeTest = ((XPathStep)previousStep).getNodeTest();
      if (nodeTest != null) {
        final XPathNodeTest.PrincipalType principalType = nodeTest.getPrincipalType();
        if (principalType != XPathNodeTest.PrincipalType.ELEMENT) {
          XPathNodeTest test = step.getNodeTest();
          if (test != null) {
            holder.newAnnotation(HighlightSeverity.WARNING,
                                 XPathBundle.message("annotator.warning.silly.location.step.on.axis", principalType.getType())).range(test).create();
          }
        }
      }
    }
  }
private static void checkSillyStep(AnnotationHolder holder, XPathStep step)