short nodeType = context.getNodeType(); switch (axis) { case CHILD: if (nodeType == Node.ATTRIBUTE_NODE) return false; break; case ATTRIBUTE: case NAMESPACE: if (nodeType != Node.ATTRIBUTE_NODE) return false; break; case DESCENDANT_OR_SELF: return true; default: return false; } int tlen = tests.length; if (tlen > 0) { int pos = getContextPosition(context); int len = getContextSize(context); if (len == 0) System.err.println("WARNING: context size is 0"); for (int j = 0; j < tlen && len > 0; j++) { Test test = tests[j]; if (!test.matches(context, pos, len)) return false; } } return true;
return matches(context, getContextPosition(context), getContextSize(context));
  public boolean matches(Node context)  {    short nodeType = context.getNodeType();    switch (axis)      {      case CHILD:        if (nodeType == Node.ATTRIBUTE_NODE)            return false;        break;      case ATTRIBUTE:      case NAMESPACE:        if (nodeType != Node.ATTRIBUTE_NODE)            return false;        break;      case DESCENDANT_OR_SELF:        return true;      default:        return false;      }    int tlen = tests.length;    if (tlen > 0)      {        int pos = getContextPosition(context);        int len = getContextSize(context);        if (len == 0)          System.err.println("WARNING: context size is 0");        for (int j = 0; j < tlen && len > 0; j++)          {            Test test = tests[j];            if (!test.matches(context, pos, len))                return false;              }          }    return true;  }