Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
49,900
int () { int result = super.hashCode(); result = 31 * result + myType.hashCode(); return result; }
hashCode
49,901
String () { return StringUtil.toLowerCase(name()).replace('_', '-'); }
getType
49,902
String () { return "XPathType: " + type; }
toString
49,903
boolean () { return myAbstract; }
isAbstract
49,904
XPathType (XPathType type) { return type instanceof XPath2Type ? ((XPath2Type)type).getSuperType() : null; }
getSuperType
49,905
XPathType (String value) { if ("string".equals(value)) { return XPathType.STRING; } else if ("number".equals(value)) { return XPathType.NUMBER; } else if ("boolean".equals(value)) { return XPathType.BOOLEAN; } else if ("nodeset".equals(value)) { return XPathType.NODESET; } return XPathType.UNKNOWN; }
fromString
49,906
boolean (XPathType type) { return isAbstract() || type.isAbstract() || this != NODESET || type == NODESET; }
isAssignableFrom
49,907
boolean (XPathType type) { return type != NODESET; }
canBePromotedTo
49,908
boolean (@NotNull XPathType left, @NotNull XPathType type) { if (left instanceof ChoiceType) { final XPathType[] types = ((ChoiceType)left).getTypes(); for (XPathType t : types) { if (isAssignable(t, type)) { return true; } } return false; } return left.isAssignableFrom(type) || type.canBePromotedTo(left); }
isAssignable
49,909
XPathType (XPathType... types) { final StringBuilder name = new StringBuilder(); for (XPathType type : types) { if (name.length() > 0) { name.append(", "); } name.append(type.getName()); } name.insert(0, "one of "); return new ChoiceType(types, name.toString()); }
create
49,910
XPathType[] () { return myTypes; }
getTypes
49,911
boolean (@NotNull XPathType type) { return false; }
isAssignableFrom
49,912
boolean (XPathType type) { return false; }
canBePromotedTo
49,913
XPathType () { final XPathExpression then = getThenBranch(); final XPathExpression value = then != null ? then : getElseBranch(); return value != null ? value.getType() : XPathType.UNKNOWN; }
getType
49,914
XPathExpression () { return ArrayUtil.getFirstElement(findChildrenByClass(XPathExpression.class)); }
getCondition
49,915
XPathExpression () { return null; }
getThenBranch
49,916
XPathExpression () { return null; }
getElseBranch
49,917
void (XPath2ElementVisitor visitor) { visitor.visitXPath2If(this); }
accept
49,918
XPathExpression () { final ASTNode[] nodes = getNode().getChildren(XPath2ElementTypes.EXPRESSIONS); return (XPathExpression)(nodes.length > 0 ? nodes[0].getPsi() : null); }
getLOperand
49,919
XPathExpression () { final ASTNode[] nodes = getNode().getChildren(XPath2ElementTypes.EXPRESSIONS); return (XPathExpression)(nodes.length > 1 ? nodes[1].getPsi() : null); }
getROperand
49,920
XPathElementType () { final ASTNode[] nodes = getNode().getChildren(BINARY_OPERATIONS); final XPathElementType elementType = (XPathElementType)(nodes.length > 0 ? nodes[0].getElementType() : null); assert elementType != null : unexpectedPsiAssertion(); return elementType; }
getOperator
49,921
String () { final ASTNode[] nodes = getNode().getChildren(BINARY_OPERATIONS); return nodes[0].getText(); }
getOperationSign
49,922
XPathType () { return CachedValuesManager.getCachedValue(this, () -> CachedValueProvider.Result.create(calcType(), PsiModificationTracker.MODIFICATION_COUNT)); }
getType
49,923
XPathType () { final XPathElementType operator = getOperator(); if (operator == XPathTokenTypes.UNION || XPath2TokenTypes.INTERSECT_EXCEPT.contains(operator)) { return XPathType.NODESET; } else if (XPath2TokenTypes.BOOLEAN_OPERATIONS.contains(operator)) { return XPathType.BOOLEAN; } else if (operator == XPath2TokenType...
calcType
49,924
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.isAbs...
mostSpecificType
49,925
boolean (XPathExpression op, XPathType type) { return op != null && (type instanceof XPath2Type ? type.isAssignableFrom(op.getType()) : type == op.getType()); }
is
49,926
void (XPathElementVisitor visitor) { visitor.visitXPathBinaryExpression(this); }
accept
49,927
XPathType () { final XPathExpression[] sequence = getSequence(); if (sequence.length == 0) { return XPath2Type.SEQUENCE; } XPathType commonType = XPath2Type.mapType(sequence[0].getType()); outer: while (commonType != null) { for (int i = 1; i < sequence.length; i++) { final XPathType t = XPath2Type.mapType(sequence[i]....
getType
49,928
void (XPath2ElementVisitor visitor) { visitor.visitXPath2Sequence(this); }
accept
49,929
XPathExpression () { final ASTNode[] nodes = getNode().getChildren(XPath2ElementTypes.EXPRESSIONS); return (XPathExpression)(nodes.length > 0 ? nodes[0].getPsi() : null); }
getPredicateExpression
49,930
void (XPathElementVisitor visitor) { visitor.visitXPathPredicate(this); }
accept
49,931
XPathElement () { return element; }
getElement
49,932
TextRange () { final int outer = element.getTextRange().getStartOffset(); return TextRange.from(nameNode.getTextRange().getStartOffset() - outer, nameNode.getTextLength()); }
getRangeInElement
49,933
PsiElement () { return null; }
resolve
49,934
String () { return nameNode.getText(); }
getCanonicalText
49,935
boolean (@NotNull PsiElement element) { return Comparing.equal(resolve(), element); }
isReferenceTo
49,936
boolean () { return true; }
isSoft
49,937
ASTNode () { return nameNode; }
getNameNode
49,938
String () { return getText().substring(1); }
getReferencedName
49,939
XPathType () { final XPathVariable xPathVariable = resolve(); if (xPathVariable != null) { return xPathVariable.getType(); } return XPathType.UNKNOWN; }
getType
49,940
PsiReference () { return this; }
getReference
49,941
PsiElement () { return this; }
getElement
49,942
int () { return getTextRange().getStartOffset() + 1; }
getTextOffset
49,943
TextRange () { return TextRange.from(1, getTextLength() - 1); }
getRangeInElement
49,944
XPathVariable () { if (getContainingFile().getLanguage() == XPathFileType.XPATH2.getLanguage()) { XPathVariableHolder f = PsiTreeUtil.getParentOfType(this, XPathVariableHolder.class, true); while (f != null) { final XPathVariable variable = findVariable(f.getVariables(), getReferencedName()); if (variable != null) { re...
resolve
49,945
XPathVariable (XPathVariableDeclaration[] declarations, String referencedName) { for (XPathVariableDeclaration decl : declarations) { final XPathVariable v = decl.getVariable(); if (v != null) { if (referencedName.equals(v.getName())) { return v; } } } return null; }
findVariable
49,946
String () { return getText(); }
getCanonicalText
49,947
void (String newElementName) { final XPathVariableReference child = XPathChangeUtil.createVariableReference(this, newElementName); final PrefixedNameImpl newName = ((PrefixedNameImpl)child.getQName()); final PrefixedNameImpl oldName = ((PrefixedNameImpl)getQName()); assert newName != null; assert oldName != null; final...
renameTo
49,948
boolean (@NotNull PsiElement element) { if (element instanceof XPathVariable) { final XPathVariable resolved = resolve(); if (getReferencedName().equals(((XPathVariable)element).getName())) { if (element.equals(resolved)) { return true; } } } final VariableContext context = getXPathContext().getVariableContext(); if (c...
isReferenceTo
49,949
boolean () { return true; }
isSoft
49,950
PrefixedName () { final ASTNode[] nodes = getNode().getChildren(QNAME_FILTER); if (nodes.length == 1) { return new PrefixedNameImpl(nodes[0]); } else if (nodes.length == 2) { return new PrefixedNameImpl(nodes[0], nodes[1]); } return null; }
getQName
49,951
int () { return getReferencedName().hashCode(); }
hashCode
49,952
boolean (Object obj) { return obj == this; }
equals
49,953
void (XPathElementVisitor visitor) { visitor.visitXPathVariableReference(this); }
accept
49,954
XPathExpression () { return PsiTreeUtil.findChildOfType(this, XPathExpression.class); }
getInitializer
49,955
XPathVariable () { return PsiTreeUtil.findChildOfType(this, XPathVariable.class); }
getVariable
49,956
void (XPath2ElementVisitor visitor) { visitor.visitXPathVariableDeclaration(this); }
accept
49,957
Collection<XmlFile> (XmlFile element) { final CommonProcessors.CollectUniquesProcessor<XmlFile> processor = new CommonProcessors.CollectUniquesProcessor<>() { @Override public boolean process(XmlFile file) { if (!getResults().contains(file)) { XsltIncludeIndex.processForwardDependencies(file, this); } return super.proc...
getDependencies
49,958
boolean (XmlFile file) { if (!getResults().contains(file)) { XsltIncludeIndex.processForwardDependencies(file, this); } return super.process(file); }
process
49,959
PsiFile (String name, PsiFile baseFile) { if (baseFile == null) return null; final VirtualFile virtualFile = VfsUtilCore.findRelativeFile(name, baseFile.getVirtualFile()); if (virtualFile != null) { final PsiFile file = baseFile.getManager().findFile(virtualFile); if (file != baseFile && file instanceof XmlFile) { retu...
resolveFile
49,960
PsiFile (XmlAttribute location, PsiFile baseFile) { if (location == null) return null; final XmlAttributeValue valueElement = location.getValueElement(); if (valueElement == null) return null; // prefer direct relative path final String value = valueElement.getValue(); final PsiFile file = resolveFile(value, baseFile);...
resolveFile
49,961
Result (PsiElement element) { return new Result(element); }
create
49,962
Result (Matcher matcher) { return new Result(matcher); }
create
49,963
PsiElement (final Matcher matcher) { if (matcher == null) return null; final List<PsiElement> found = process(matcher, true); return found.size() > 0 ? found.get(0) : null; }
resolve
49,964
PsiElement[] (final Matcher matcher) { if (matcher == null) return PsiElement.EMPTY_ARRAY; final List<PsiElement> found = process(matcher, false); return PsiUtilCore.toPsiElementArray(found); }
collect
49,965
Throwable () { return this; }
fillInStackTrace
49,966
List<PsiElement> (final Matcher matcher, final boolean resolve) { return new ResolveUtil()._process(matcher, resolve); }
process
49,967
List<PsiElement> (final Matcher matcher, final boolean resolve) { final XmlTag root = matcher.getRoot(); if (root == null || myHistory.contains(root)) { return Collections.emptyList(); } myHistory.add(root); final List<PsiElement> found = new ArrayList<>(); try { if (matcher.isRecursive()) { root.accept(new XmlRecursiv...
_process
49,968
void (@NotNull XmlTag tag) { final Matcher.Result match = matcher.match(tag); if (match != null) { if (match.chain != null) { found.addAll(_process(match.chain, resolve)); } else { assert match.result != null; found.add(match.result); if (resolve) throw Stop.DONE; } } super.visitXmlTag(tag); }
visitXmlTag
49,969
void (@NotNull XmlTag tag) { final Matcher.Result match = matcher.match(tag); if (match != null) { if (match.chain != null) { found.addAll(_process(match.chain, resolve)); } else { assert match.result != null; found.add(match.result); if (resolve) throw Stop.DONE; } } }
visitXmlTag
49,970
PsiElement (final XmlProcessor processor, PsiElement elt) { if (elt == null) return null; PsiElement cur = elt; do { if (cur instanceof XmlTag tag) { if (!processor.process(tag)) { if (processor instanceof ResolveProcessor) { return ((ResolveProcessor)processor).getResult(); } return null; } } if (cur instanceof PsiFil...
treeWalkUp
49,971
XPathType () { final XPathStep step = getFirstStep(); if (step != null) { final XPathExpression expr = step.getStep(); if (expr != null) { return expr.getType(); } } return getXPathVersion() == XPathVersion.V1 ? XPathType.NODESET : XPath2Type.SEQUENCE; }
getType
49,972
XPathStep () { return findChildByClass(XPathStep.class); }
getFirstStep
49,973
boolean () { final XPathStep pathExpression = getFirstStep(); return pathExpression != null && pathExpression.isAbsolute(); }
isAbsolute
49,974
void (XPathElementVisitor visitor) { visitor.visitXPathLocationPath(this); }
accept
49,975
XPathExpression () { return findChildrenByClass(XPathExpression.class)[0]; }
getFrom
49,976
XPathExpression () { XPathExpression[] expressions = findChildrenByClass(XPathExpression.class); return expressions.length > 1 ? expressions[1] : null; }
getTo
49,977
XPathExpression () { return getFrom(); }
getLOperand
49,978
XPathExpression () { return getTo(); }
getROperand
49,979
XPathElementType () { return (XPathElementType)XPath2TokenTypes.TO; }
getOperator
49,980
String () { return "to"; }
getOperationSign
49,981
XPathType () { return XPath2SequenceType.create(XPath2Type.INTEGER, XPath2SequenceType.Cardinality.ZERO_OR_MORE); }
getType
49,982
void (XPath2ElementVisitor visitor) { visitor.visitXPath2RangeExpression(this); }
accept
49,983
XPathType () { final QName qName = getXPathContext().getQName(this); final XPath2Type type; if (qName != null) { type = XPath2Type.fromName(qName); } else { final PrefixedName qn = getQName(); if (qn != null) { final String prefix = qn.getPrefix(); if (prefix != null && prefix.equals("xs")) { type = XPath2Type.fromName...
getDeclaredType
49,984
PrefixedName () { final ASTNode[] nodes = getNode().getChildren(TokenSet.create(XPathTokenTypes.NCNAME)); if (nodes.length == 0) { final ASTNode node = getNode().findChildByType(XPathTokenTypes.STAR); if (node != null) { return new PrefixedNameImpl(null, node); } } else if (nodes.length == 1) { return new PrefixedNameI...
getQName
49,985
void (XPath2ElementVisitor visitor) { visitor.visitXPath2TypeElement(this); }
accept
49,986
PsiElement () { final ContextProvider provider = getElement().getXPathContext(); final NamespaceContext namespaceContext = provider.getNamespaceContext(); if (namespaceContext != null) { return namespaceContext.resolve(getCanonicalText(), provider.getContextElement()); } else { return null; } }
resolve
49,987
boolean () { if ("*".equals(getPrefix())) { return true; } final ContextProvider context = getElement().getXPathContext(); if (context instanceof ContextProvider.DefaultProvider) return true; return !canResolve(); }
isSoft
49,988
String () { return getCanonicalText(); }
getPrefix
49,989
boolean () { if (!canResolve()) return true; if (resolve() != null) { return false; } final ContextProvider provider = getElement().getXPathContext(); final NamespaceContext namespaceContext = provider.getNamespaceContext(); assert namespaceContext != null; final String prefix = getCanonicalText(); return !namespaceCon...
isUnresolved
49,990
boolean () { final NamespaceContext namespaceContext = getElement().getXPathContext().getNamespaceContext(); return namespaceContext != null && !"xml".equals(getCanonicalText()); }
canResolve
49,991
XPathType () { return getType(); }
getTargetType
49,992
XPathType () { final XPath2TypeElement node = findChildByClass(XPath2TypeElement.class); return node != null ? node.getDeclaredType() : XPathType.UNKNOWN; }
getType
49,993
void (XPath2ElementVisitor visitor) { visitor.visitXPath2TreatAs(this); }
accept
49,994
XPathType () { if (getNode().getElementType() == XPath2ElementTypes.CONTEXT_ITEM) { final XPathPredicate predicate = PsiTreeUtil.getParentOfType(this, XPathPredicate.class); if (predicate != null) { final PsiElement filter = predicate.getParent(); if (filter instanceof XPathFilterExpression) { final XPathExpression exp...
getType
49,995
XPathAxisSpecifier () { final ASTNode node = getNode().findChildByType(XPathElementTypes.AXIS_SPECIFIER); if (node != null) { return (XPathAxisSpecifier)node.getPsi(); } else { return findFromXPath2FilterExpr(XPathElementTypes.AXIS_SPECIFIER, XPathAxisSpecifier.class); } }
getAxisSpecifier
49,996
XPathNodeTest () { final ASTNode node = getNode().findChildByType(XPathElementTypes.NODE_TEST); if (node != null) { return node.getPsi(XPathNodeTest.class); } else { return findFromXPath2FilterExpr(XPathElementTypes.NODE_TEST, XPathNodeTest.class); } }
getNodeTest
49,997
XPathExpression () { final XPathExpression[] nodes = findChildrenByClass(XPathExpression.class); if (nodes.length > 0) { return nodes[0]; } return null; }
getPreviousStep
49,998
XPathExpression () { final XPathExpression[] nodes = findChildrenByClass(XPathExpression.class); if (nodes.length > 1) { return nodes[1]; } return null; }
getStep
49,999
boolean () { return getPreviousStep() == null && getNode().getChildren(XPathTokenTypes.PATH_OPS).length > 0; }
isAbsolute