Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
303,600
void (@NotNull XmlElement element) { DomElement domElement = getDomElement(element, domManager); if (domElement != null) { DomFileElement<DomElement> root = DomUtil.getFileElement(domElement); DomElementsInspection<DomElement> inspection = getAnnotationsManager(project).getMockInspection(root); if (inspection != null) { runInspection(inspection, root, holder); } } else { super.visitXmlElement(element); } }
visitXmlElement
303,601
int (final AbstractDomChildDescriptionImpl o) { throw new UnsupportedOperationException(); }
compareTo
303,602
void () { try { final XmlTag tag = getXmlTag(); if (tag != null) { deleteTag(tag); detach(); fireUndefinedEvent(); } } catch (Exception e) { LOG.error(e); } }
undefineInternal
303,603
boolean (final Object obj) { if (!(obj instanceof DomRootInvocationHandler handler)) return false; return myParent.equals(handler.myParent); }
equals
303,604
int () { return myParent.hashCode(); }
hashCode
303,605
boolean () { return getStub() != null || getXmlElement() != null; }
exists
303,606
String () { return getXmlName().getNamespace(getFile(), getFile()); }
getXmlElementNamespace
303,607
String () { final XmlTag tag = (XmlTag)getXmlElement(); if (tag != null && !tag.isValid()) { return "invalid root tag"; } final String s = myParent.checkValidity(); if (s != null) { return "root: " + s; } return null; }
checkValidity
303,608
DomElement () { final DomFileElement<?> stableCopy = myParent.createStableCopy(); return getManager().createStableValue((NullableFactory<DomElement>)() -> stableCopy.isValid() ? stableCopy.getRootElement() : null); }
createPathStableCopy
303,609
XmlTag () { final XmlTag[] result = new XmlTag[]{null}; getManager().runChange(() -> { try { final String namespace = getXmlElementNamespace(); final @NonNls String nsDecl = StringUtil.isEmpty(namespace) ? "" : " xmlns=\"" + namespace + "\""; final XmlFile xmlFile = getFile(); final XmlTag tag = XmlElementFactory.getInstance(xmlFile.getProject()).createTagFromText("<" + getXmlElementName() + nsDecl + "/>"); result[0] = ((XmlDocument)xmlFile.getDocument().replace(((XmlFile)tag.getContainingFile()).getDocument())).getRootTag(); } catch (IncorrectOperationException e) { LOG.error(e); } }); return result[0]; }
setEmptyXmlTag
303,610
DomNameStrategy () { final Class<?> rawType = getRawType(); final DomNameStrategy strategy = DomImplUtil.getDomNameStrategy(rawType, isAttribute()); if (strategy != null) { return strategy; } return DomNameStrategy.HYPHEN_STRATEGY; }
getNameStrategy
303,611
void (DomElementVisitor visitor, DomElement element) { final Method method = myMethods.get(element.getClass()); assert method != null : myVisitorClass + " can't accept element of type " + element.getClass(); DomReflectionUtil.invokeMethod(method, visitor, element); }
acceptElement
303,612
void (@NotNull Annotation annotation) { if (myCustomAnnotations == null) { myCustomAnnotations = new HashMap<>(); } myCustomAnnotations.put(annotation.annotationType(), annotation); }
addCustomAnnotation
303,613
boolean () { return myType instanceof Class && DomReflectionUtil.findAnnotationDFS((Class<?>)myType, Stubbed.class) != null || getAnnotation(Stubbed.class) != null; }
calcStubbed
303,614
boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; AbstractDomChildDescriptionImpl that = (AbstractDomChildDescriptionImpl)o; return Objects.equals(myCustomAnnotations, that.myCustomAnnotations) && getType().equals(that.getType()) && Objects.equals(myUserMap, that.myUserMap); }
equals
303,615
int () { int result = getType().hashCode(); result = 31 * result + (myCustomAnnotations != null ? myCustomAnnotations.hashCode() : 0); result = 31 * result + (myUserMap != null ? myUserMap.hashCode() : 0); return result; }
hashCode
303,616
void (final @Nullable Map<Key<?>, Object> userMap) { myUserMap = userMap; }
setUserMap
303,617
Type () { return myType; }
getType
303,618
DomNameStrategy (@NotNull DomElement parent) { final DomNameStrategy strategy = DomImplUtil.getDomNameStrategy(ClassUtil.getRawType(getType()), false); return strategy == null ? parent.getNameStrategy() : strategy; }
getDomNameStrategy
303,619
boolean () { return true; }
isValid
303,620
DomElement () { Supplier<? extends DomElement> domDecl = getUserData(DomExtensionImpl.KEY_DOM_DECLARATION); return domDecl != null ? domDecl.get() : null; }
getDomDeclaration
303,621
boolean () { Boolean stubbed = myStubbed; if (stubbed == null) { myStubbed = stubbed = calcStubbed(); } return stubbed; }
isStubbed
303,622
String () { return myTagName.getLocalName(); }
getName
303,623
String () { return myTagName.getLocalName(); }
getXmlElementName
303,624
XmlName () { return myTagName; }
getXmlName
303,625
String (@NotNull DomElement parent) { return getCommonPresentableName(getDomNameStrategy(parent)); }
getCommonPresentableName
303,626
boolean (final Object o) { if (this == o) return true; if (!super.equals(o)) return false; final DomChildDescriptionImpl that = (DomChildDescriptionImpl)o; if (myTagName != null ? !myTagName.equals(that.myTagName) : that.myTagName != null) return false; return true; }
equals
303,627
int () { int result = super.hashCode(); result = 31 * result + (myTagName != null ? myTagName.hashCode() : 0); return result; }
hashCode
303,628
int (final AbstractDomChildDescriptionImpl o) { return o instanceof DomChildDescriptionImpl ? myTagName.compareTo(((DomChildDescriptionImpl)o).myTagName) : 1; }
compareTo
303,629
void (@NotNull MetaDataRegistrar registrar) { registrar.registerMetaData(new ElementFilter() { @Override public boolean isAcceptable(Object element, PsiElement context) { if (element instanceof XmlTag tag) { final DomElement domElement = DomManager.getDomManager(tag.getProject()).getDomElement(tag); if (domElement != null) { return domElement.getGenericInfo().getNameDomElement(domElement) != null; } } return false; } @Override public boolean isClassAcceptable(Class hintClass) { return XmlTag.class.isAssignableFrom(hintClass); } }, DomMetaData.class); }
contributeMetaData
303,630
boolean (Object element, PsiElement context) { if (element instanceof XmlTag tag) { final DomElement domElement = DomManager.getDomManager(tag.getProject()).getDomElement(tag); if (domElement != null) { return domElement.getGenericInfo().getNameDomElement(domElement) != null; } } return false; }
isAcceptable
303,631
boolean (Class hintClass) { return XmlTag.class.isAssignableFrom(hintClass); }
isClassAcceptable
303,632
List<T> () { final List<T> result = new ArrayList<>(); dumpDescriptions(result); return result; }
getDescriptions
303,633
List<T> () { List<T> cached = myCached; if (cached != null) { return cached; } if (!myMap.isEmpty()) { cached = new SmartList<>(myMap.values()); Collections.sort(cached); } else { cached = Collections.emptyList(); } myCached = cached; return cached; }
getSortedDescriptions
303,634
boolean (Object o) { if (this == o) return true; if (!(o instanceof ChildrenDescriptionsHolder holder)) return false; if (myDelegate != null ? !myDelegate.equals(holder.myDelegate) : holder.myDelegate != null) return false; if (!myMap.equals(holder.myMap)) return false; return true; }
equals
303,635
int () { int result = myMap.hashCode(); result = 31 * result + (myDelegate != null ? myDelegate.hashCode() : 0); return result; }
hashCode
303,636
DomInvocationHandler () { throw new UnsupportedOperationException("Method getParentHandler is not yet implemented in " + getClass().getName()); }
getParentHandler
303,637
XmlTag () { return myFileElement.getRootTag(); }
getXmlElement
303,638
DomParentStrategy (final DomInvocationHandler handler) { return this; }
refreshStrategy
303,639
DomParentStrategy (final @NotNull XmlElement element) { return this; }
setXmlElement
303,640
DomParentStrategy () { return this; }
clearXmlElement
303,641
String () { return myFileElement.checkValidity(); }
checkValidity
303,642
XmlFile (DomInvocationHandler handler) { return myFileElement.getFile(); }
getContainingFile
303,643
boolean () { return true; }
isPhysical
303,644
boolean (final Object o) { if (this == o) return true; if (!(o instanceof RootDomParentStrategy that)) return false; if (!myFileElement.equals(that.myFileElement)) return false; return true; }
equals
303,645
int () { return myFileElement.hashCode(); }
hashCode
303,646
CollectionElementInvocationHandler (XmlTag tag, DomCollectionChildDescription description, DomInvocationHandler parent, XmlTag parentTag) { DomStub parentStub = parent.getStub(); if (parentStub != null) { int index = JBIterable .of(findSubTagsWithoutIncludes(parentTag, tag.getLocalName(), tag.getNamespace())) .filter(t -> !(t instanceof IncludedXmlTag)) .indexOf(t -> t == tag); ElementStub stub = parentStub.getElementStub(tag.getName(), index); if (stub != null) { XmlName name = description.getXmlName(); EvaluatedXmlNameImpl evaluatedXmlName = EvaluatedXmlNameImpl.createEvaluatedXmlName(name, name.getNamespaceKey(), true); return new CollectionElementInvocationHandler(evaluatedXmlName, (AbstractDomChildDescriptionImpl)description, parent.getManager(), stub); } } return new CollectionElementInvocationHandler(description.getType(), tag, (AbstractCollectionChildDescription)description, parent, null); }
createCollectionHandler
303,647
boolean (XmlFile myXmlFile) { return myXmlFile instanceof PsiFileEx && ((PsiFileEx)myXmlFile).isContentsLoaded(); }
isFileParsed
303,648
String (@NotNull PomTarget element, @NotNull ElementDescriptionLocation location) { if (!(element instanceof DomTarget target)) return null; DomElement domElement = target.getDomElement(); final ElementPresentationTemplate template = domElement.getChildDescription().getPresentationTemplate(); final ElementPresentation presentation = template != null ? template.createPresentation(domElement) : domElement.getPresentation(); if (location == UsageViewTypeLocation.INSTANCE) { return presentation.getTypeName(); } if (location == UsageViewNodeTextLocation.INSTANCE || location == UsageViewLongNameLocation.INSTANCE) { return presentation.getTypeName() + " " + StringUtil.notNullize(presentation.getElementName(), "''"); } if (location instanceof HighlightUsagesDescriptionLocation) { return presentation.getTypeName(); } return null; }
getElementDescription
303,649
void (final @NotNull CompletionParameters parameters, final @NotNull CompletionResultSet result) { if (parameters.getCompletionType() != CompletionType.BASIC) return; if (domKnowsBetter(parameters, result)) { result.stopHere(); } }
fillCompletionVariants
303,650
boolean (final CompletionParameters parameters, final CompletionResultSet result) { final XmlAttributeValue element = PsiTreeUtil.getParentOfType(parameters.getPosition(), XmlAttributeValue.class); if (element == null) { return false; } if (isSchemaEnumerated(element)) { return false; } final PsiElement parent = element.getParent(); if (parent instanceof XmlAttribute) { XmlAttributeDescriptor descriptor = ((XmlAttribute)parent).getDescriptor(); if (descriptor != null && descriptor.getDefaultValue() != null) { final PsiReference[] references = myProvider.getReferencesByElement(element, new ProcessingContext()); if (references.length > 0) { return LegacyCompletionContributor.completeReference(parameters, result); } } } return false; }
domKnowsBetter
303,651
boolean (final PsiElement element) { if (element instanceof XmlTag) { final XmlTag simpleContent = XmlUtil.getSchemaSimpleContent((XmlTag)element); if (simpleContent != null && XmlUtil.collectEnumerationValues(simpleContent, new HashSet<>())) { return true; } } if (element instanceof XmlAttributeValue) { final PsiElement parent = element.getParent(); if (parent instanceof XmlAttribute) { final XmlAttributeDescriptor descriptor = ((XmlAttribute)parent).getDescriptor(); if (descriptor != null && descriptor.isEnumerated()) { return true; } String[] enumeratedValues = XmlAttributeValueGetter.getEnumeratedValues((XmlAttribute)parent); if (enumeratedValues.length > 0) { String value = descriptor == null ? null : descriptor.getDefaultValue(); if (value == null || enumeratedValues.length != 1 || !value.equals(enumeratedValues[0])) { return true; } } } } return false; }
isSchemaEnumerated
303,652
boolean (@NotNull PsiElement element, PsiReferenceService.@NotNull Hints hints) { if (hints == PsiReferenceService.Hints.HIGHLIGHTED_REFERENCES) { // DOM model does not provide underlined references in literals return false; } return super.acceptsHints(element, hints); }
acceptsHints
303,653
PsiReference[] (GenericDomValue<?> domValue, XmlElement psiElement, Object converter, DomInvocationHandler handler, DomManager domManager) { final XmlFile file = handler.getFile(); final DomFileDescription<?> description = domManager.getDomFileDescription(file); if (description == null) { // should not happen return PsiReference.EMPTY_ARRAY; } List<PsiReference> result = new ArrayList<>(); ConvertContext context = ConvertContextFactory.createConvertContext(domValue); final List<DomReferenceInjector> injectors = description.getReferenceInjectors(); if (!injectors.isEmpty()) { String unresolvedText = ElementManipulators.getValueText(psiElement); for (DomReferenceInjector each : injectors) { Collections.addAll(result, each.inject(unresolvedText, psiElement, context)); } } Collections.addAll(result, doCreateReferences(domValue, psiElement, converter, context)); return result.toArray(PsiReference.EMPTY_ARRAY); }
createReferences
303,654
List<DomChildrenDescription> () { return Collections.emptyList(); }
getChildrenDescriptions
303,655
List<DomFixedChildDescription> () { return Collections.emptyList(); }
getFixedChildrenDescriptions
303,656
List<DomCollectionChildDescription> () { return Collections.emptyList(); }
getCollectionChildrenDescriptions
303,657
boolean () { return false; }
isTagValueElement
303,658
DomAttributeChildDescription (String attributeName) { return null; }
getAttributeChildDescription
303,659
XmlFile () { return myFile; }
getFile
303,660
XmlFile () { return (XmlFile)myFile.getOriginalFile(); }
getOriginalFile
303,661
boolean (final Object o) { if (this == o) return true; if (!(o instanceof DomFileElementImpl that)) return false; if (myFile != null ? !myFile.equals(that.myFile) : that.myFile != null) return false; if (myRootElementClass != null ? !myRootElementClass.equals(that.myRootElementClass) : that.myRootElementClass != null) return false; if (myRootTagName != null ? !myRootTagName.equals(that.myRootTagName) : that.myRootTagName != null) return false; return true; }
equals
303,662
int () { int result; result = (myFile != null ? myFile.hashCode() : 0); result = 31 * result + (myRootElementClass != null ? myRootElementClass.hashCode() : 0); result = 31 * result + (myRootTagName != null ? myRootTagName.hashCode() : 0); return result; }
hashCode
303,663
DomManagerImpl () { return myManager; }
getManager
303,664
Type () { return getClass(); }
getDomElementType
303,665
AbstractDomChildrenDescription () { throw new UnsupportedOperationException("Method getChildDescription is not yet implemented in " + getClass().getName()); }
getChildDescription
303,666
DomNameStrategy () { return getRootHandler().getNameStrategy(); }
getNameStrategy
303,667
ElementPresentation () { return new ElementPresentation() { @Override public @NonNls String getElementName() { return "<ROOT>"; } @Override public @NonNls String getTypeName() { return "<ROOT>"; } @Override public Icon getIcon() { return null; } }; }
getPresentation
303,668
Icon () { return null; }
getIcon
303,669
GlobalSearchScope () { return myFile.getResolveScope(); }
getResolveScope
303,670
Module () { return ModuleUtilCore.findModuleForPsiElement(getFile()); }
getModule
303,671
void (DomElement other) { throw new UnsupportedOperationException("Method copyFrom is not yet implemented in " + getClass().getName()); }
copyFrom
303,672
String () { return ""; }
getXmlElementNamespace
303,673
T () { if (!isValid()) { PsiUtilCore.ensureValid(myFile); throw new AssertionError(this + " is not equal to " + myManager.getFileElement(myFile)); } return (T)getRootHandler().getProxy(); }
getRootElement
303,674
Class<T> () { return myRootElementClass; }
getRootElementClass
303,675
DomFileDescription<T> () { return myFileDescription; }
getFileDescription
303,676
DomRootInvocationHandler () { return myRootHandler; }
getRootHandler
303,677
XmlTag () { return null; }
getXmlTag
303,678
XmlTag () { return null; }
ensureTagExists
303,679
XmlElement () { return getFile(); }
getXmlElement
303,680
XmlElement () { return ensureTagExists(); }
ensureXmlElementExists
303,681
void () { }
undefine
303,682
boolean () { return checkValidity() == null; }
isValid
303,683
boolean () { return true; }
exists
303,684
DomGenericInfo () { return EMPTY_DOM_GENERIC_INFO; }
getGenericInfo
303,685
String () { return ""; }
getXmlElementName
303,686
void (final DomElementVisitor visitor) { myManager.getApplicationComponent().getVisitorDescription(visitor.getClass()).acceptElement(visitor, this); }
accept
303,687
void (DomElementVisitor visitor) { getRootElement().accept(visitor); }
acceptChildren
303,688
long () { return myFile.getModificationStamp(); }
getModificationCount
303,689
DomElement () { return myHandler.getProxy(); }
getInvocationElement
303,690
Module () { final DomElement domElement = getInvocationElement(); if (domElement.getManager().isMockElement(domElement)) { return getInvocationElement().getModule(); } return super.getModule(); }
getModule
303,691
Object (final DomInvocationHandler handler, final Object[] args) { Map<XmlTag,DomElement> map = new HashMap<>(); for (final CollectionChildDescriptionImpl qname : myQnames) { for (DomElement element : handler.getCollectionChildren(qname)) { map.put(element.getXmlTag(), element); } } final XmlTag tag = handler.getXmlTag(); if (tag == null) return Collections.emptyList(); final List<DomElement> list = new ArrayList<>(); for (final XmlTag subTag : tag.getSubTags()) { ContainerUtil.addIfNotNull(list, map.get(subTag)); } return list; }
invoke
303,692
void (final CollectionChildDescriptionImpl description, final Collection<JavaMethod> methods) { if (methods != null) { for (final JavaMethod method : methods) { myCollectionChildrenAdditionMethods.put(method.getSignature(), description); } } }
addAdders
303,693
boolean () { return buildMethodMaps(); }
checkInitialized
303,694
List<AbstractDomChildDescriptionImpl> () { buildMethodMaps(); List<AbstractDomChildDescriptionImpl> list = new ArrayList<>(); myAttributes.dumpDescriptions(list); myFixed.dumpDescriptions(list); myCollections.dumpDescriptions(list); list.addAll(getCustomNameChildrenDescription()); return list; }
getChildrenDescriptions
303,695
boolean () { buildMethodMaps(); return myValueElement; }
isTagValueElement
303,696
List<AttributeChildDescriptionImpl> () { buildMethodMaps(); return new ArrayList<>(myAttributeChildrenMethods.values()); }
getAttributeChildrenDescriptions
303,697
boolean (Processor<? super AttributeChildDescriptionImpl> processor) { List<AttributeChildDescriptionImpl> descriptions = getAttributeChildrenDescriptions(); return ContainerUtil.process(descriptions, processor); }
processAttributeChildrenDescriptions
303,698
ChildrenDescriptionsHolder<AttributeChildDescriptionImpl> () { return myAttributes; }
getAttributes
303,699
ChildrenDescriptionsHolder<CollectionChildDescriptionImpl> () { return myCollections; }
getCollections