XPathType (XPathExpression lop, XPathExpression rop, XPathType type) { XPathType lType = lop != null ? lop.getType() : XPathType.UNKNOWN; XPathType rType = rop != null ? rop.getType() : XPathType.UNKNOWN; if (lType.isAbstract()) { if (rType.isAbstract()) { return type; } else { return rType; } } else { if (!rType.isAbstract()) { if (lType.canBePromotedTo(rType)) return rType; if (rType.canBePromotedTo(lType)) return lType; if (XPathType.isAssignable(lType, rType)) return rType; } return lType; } }