Unnamed: 0
int64 0
305k
| body
stringlengths 7
52.9k
| name
stringlengths 1
185
|
|---|---|---|
292,000
|
void () { try { PsiElement[] psiRoots = file.getPsiRoots(); Set<PsiElement> processed = new HashSet<PsiElement>(psiRoots.length * 2, (float)0.5); for (PsiElement psiRoot : psiRoots) { if (progress != null) progress.checkCanceled(); if (!processed.add(psiRoot)) continue; if (!psiRootProcessor.process(psiRoot)) { canceled.set(true); return; } } myManager.dropResolveCaches(); } catch (ProcessCanceledException e) { canceled.set(true); pceThrown.set(true); } }
|
run
|
292,001
|
void (@NotNull MatchResult result) { }
|
newMatch
|
292,002
|
void (@NotNull PsiFile element) { }
|
processFile
|
292,003
|
void (@NotNull MatchingProcess matchingProcess) { }
|
setMatchingProcess
|
292,004
|
void () { }
|
matchingFinished
|
292,005
|
ProgressIndicator () { return null; }
|
getProgressIndicator
|
292,006
|
boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; final PatternContext other = (PatternContext)o; return myID.equals(other.myID); }
|
equals
|
292,007
|
int () { return myID.hashCode(); }
|
hashCode
|
292,008
|
String () { return myID; }
|
getId
|
292,009
|
String () { return myDisplayName.get(); }
|
getDisplayName
|
292,010
|
String () { return myDisplayName.get() + " (" + myID + ')'; }
|
toString
|
292,011
|
String () { return name; }
|
getName
|
292,012
|
void (@NotNull String name) { this.name = name; }
|
setName
|
292,013
|
String () { return scriptCodeConstraint; }
|
getScriptCodeConstraint
|
292,014
|
void (@NotNull String scriptCodeConstraint) { this.scriptCodeConstraint = "\"\"".equals(scriptCodeConstraint) ? "" : scriptCodeConstraint; }
|
setScriptCodeConstraint
|
292,015
|
void (Element element) { final Attribute attribute = element.getAttribute(NAME); name = attribute != null ? attribute.getValue() : ""; final String script = element.getAttributeValue(SCRIPT); scriptCodeConstraint = script != null ? script : ""; }
|
readExternal
|
292,016
|
void (Element element) { element.setAttribute(NAME,name); if (!scriptCodeConstraint.isEmpty()) element.setAttribute(SCRIPT, scriptCodeConstraint); }
|
writeExternal
|
292,017
|
boolean (Object o) { if (this == o) return true; if (!(o instanceof NamedScriptableDefinition that)) return false; return name.equals(that.name) && scriptCodeConstraint.equals(that.scriptCodeConstraint); }
|
equals
|
292,018
|
int () { return 31 * name.hashCode() + scriptCodeConstraint.hashCode(); }
|
hashCode
|
292,019
|
PatternTreeContext () { return myTreeContext; }
|
getTreeContext
|
292,020
|
PatternContext () { return myPatternContext; }
|
getPatternContext
|
292,021
|
String () { return myContextConstraint; }
|
getContextConstraint
|
292,022
|
boolean (@NotNull String name) { return name.length() > 1 && name.charAt(0) == '$' && name.charAt(name.length() - 1) == '$'; }
|
isTypedVariable
|
292,023
|
boolean (String s) { return s.chars().anyMatch(MatchUtil::isRegExpMetaChar); }
|
containsRegExpMetaChar
|
292,024
|
boolean (int ch) { return REG_EXP_META_CHARS.indexOf(ch) >= 0; }
|
isRegExpMetaChar
|
292,025
|
String (@NotNull String word) { return shieldRegExpMetaChars(word, new StringBuilder(word.length())).toString(); }
|
shieldRegExpMetaChars
|
292,026
|
String (String word) { if (word.trim().isEmpty()) return word; String result = word; if (word.startsWith(" ")) result = "(?:\\s|\\b)" + result.substring(1); if (word.endsWith(" ")) result = result.substring(0, result.length() - 1) + "(?:\\s|\\b)"; return result; }
|
makeExtremeSpacesOptional
|
292,027
|
StringBuilder (String word, StringBuilder out) { for (int i = 0, length = word.length(); i < length; ++i) { if (isRegExpMetaChar(word.charAt(i))) { out.append("\\"); } out.append(word.charAt(i)); } return out; }
|
shieldRegExpMetaChars
|
292,028
|
Pattern[] (String[] prefixes) { final Pattern[] patterns = new Pattern[prefixes.length]; for (int i = 0; i < prefixes.length; i++) { final String s = shieldRegExpMetaChars(prefixes[i]); patterns[i] = Pattern.compile("\\b(" + s + "\\w+)\\b"); } return patterns; }
|
createPatterns
|
292,029
|
String (@NotNull String text) { text = text.trim(); final StringBuilder result = new StringBuilder(); boolean white = false; for (int i = 0, length = text.length(); i < length; i++) { final char c = text.charAt(i); if (StringUtil.isWhiteSpace(c)) { if (!white) { result.append(' '); white = true; } } else { white = false; result.append(c); } } return result.toString(); }
|
normalizeWhiteSpace
|
292,030
|
String (@NotNull String input) { return ACCENTS.matcher(Normalizer.normalize(input, Normalizer.Form.NFD)).replaceAll(""); }
|
stripAccents
|
292,031
|
String (@NotNull String text) { return stripAccents(normalizeWhiteSpace(text)); }
|
normalize
|
292,032
|
MatchVariableConstraint () { return new MatchVariableConstraint(this); }
|
copy
|
292,033
|
String (@NotNull String regexp) { final StringBuilder result = new StringBuilder(); for (int i = 0, length = regexp.length(); i < length; i++) { final int c = regexp.codePointAt(i); if (c == '.') { if (i == length - 1 || !MatchUtil.isRegExpMetaChar(regexp.codePointAt(i + 1))) { result.append('.'); // consider dot not followed by other meta char a mistake } else { return ""; // can't convert } } else if (c == '|') { result.append('|'); } else if (c == '\\') { if (i + 1 < length) { result.appendCodePoint(regexp.codePointAt(i + 1)); i++; } else { result.append('\\'); } } else if (c == ']') { result.append(']'); } else if (c == '(' || c == ')') { // do nothing } else if (MatchUtil.isRegExpMetaChar(c)) { return ""; // can't convert } else { result.appendCodePoint(c); } } return result.toString(); }
|
convertRegExpTypeToTypeString
|
292,034
|
String (@NotNull String typeString) { final StringBuilder result = new StringBuilder(); for (String type : StringUtil.split(typeString, "|")) { if (result.length() > 0) { result.append('|'); } MatchUtil.shieldRegExpMetaChars(type.trim(), result); } return result.toString(); }
|
convertTypeStringToRegExp
|
292,035
|
boolean () { return greedy; }
|
isGreedy
|
292,036
|
void (boolean greedy) { this.greedy = greedy; }
|
setGreedy
|
292,037
|
String () { return regExp; }
|
getRegExp
|
292,038
|
void (@NotNull String regExp) { this.regExp = regExp; }
|
setRegExp
|
292,039
|
boolean () { return invertRegExp; }
|
isInvertRegExp
|
292,040
|
void (boolean invertRegExp) { this.invertRegExp = invertRegExp; }
|
setInvertRegExp
|
292,041
|
boolean () { return withinHierarchy; }
|
isWithinHierarchy
|
292,042
|
void (boolean withinHierarchy) { this.withinHierarchy = withinHierarchy; }
|
setWithinHierarchy
|
292,043
|
int () { return minCount; }
|
getMinCount
|
292,044
|
void (int minCount) { this.minCount = minCount; }
|
setMinCount
|
292,045
|
int () { return maxCount; }
|
getMaxCount
|
292,046
|
void (int maxCount) { this.maxCount = maxCount; }
|
setMaxCount
|
292,047
|
boolean () { return partOfSearchResults; }
|
isPartOfSearchResults
|
292,048
|
void (boolean partOfSearchResults) { this.partOfSearchResults = partOfSearchResults; }
|
setPartOfSearchResults
|
292,049
|
boolean () { return invertReference; }
|
isInvertReference
|
292,050
|
void (boolean invertReference) { this.invertReference = invertReference; }
|
setInvertReference
|
292,051
|
String () { return referenceConstraint; }
|
getReferenceConstraint
|
292,052
|
void (@NotNull String nameOfReferenceVar) { this.referenceConstraint = nameOfReferenceVar; }
|
setReferenceConstraint
|
292,053
|
String () { return referenceConstraintName; }
|
getReferenceConstraintName
|
292,054
|
void (@NotNull String referenceConstraintName) { this.referenceConstraintName = referenceConstraintName; }
|
setReferenceConstraintName
|
292,055
|
boolean () { return strictlyWithinHierarchy; }
|
isStrictlyWithinHierarchy
|
292,056
|
void (boolean strictlyWithinHierarchy) { this.strictlyWithinHierarchy = strictlyWithinHierarchy; }
|
setStrictlyWithinHierarchy
|
292,057
|
String () { return nameOfExprType; }
|
getNameOfExprType
|
292,058
|
String () { return expressionTypes; }
|
getExpressionTypes
|
292,059
|
void (@NotNull String nameOfExprType) { this.nameOfExprType = nameOfExprType; this.expressionTypes = convertRegExpTypeToTypeString(nameOfExprType); }
|
setNameOfExprType
|
292,060
|
void (@NotNull String expressionTypes) { this.expressionTypes = expressionTypes; this.nameOfExprType = convertTypeStringToRegExp(expressionTypes); }
|
setExpressionTypes
|
292,061
|
boolean () { return StringUtil.isEmpty(expressionTypes) && !StringUtil.isEmpty(nameOfExprType); }
|
isRegexExprType
|
292,062
|
boolean () { return invertExprType; }
|
isInvertExprType
|
292,063
|
void (boolean invertExprType) { this.invertExprType = invertExprType; }
|
setInvertExprType
|
292,064
|
boolean () { return exprTypeWithinHierarchy; }
|
isExprTypeWithinHierarchy
|
292,065
|
void (boolean exprTypeWithinHierarchy) { this.exprTypeWithinHierarchy = exprTypeWithinHierarchy; }
|
setExprTypeWithinHierarchy
|
292,066
|
boolean () { return wholeWordsOnly; }
|
isWholeWordsOnly
|
292,067
|
void (boolean wholeWordsOnly) { this.wholeWordsOnly = wholeWordsOnly; }
|
setWholeWordsOnly
|
292,068
|
String () { return nameOfFormalArgType; }
|
getNameOfFormalArgType
|
292,069
|
String () { return expectedTypes; }
|
getExpectedTypes
|
292,070
|
void (@NotNull String nameOfFormalArgType) { this.nameOfFormalArgType = nameOfFormalArgType; this.expectedTypes = convertRegExpTypeToTypeString(nameOfFormalArgType); }
|
setNameOfFormalArgType
|
292,071
|
void (@NotNull String expectedTypes) { this.expectedTypes = expectedTypes; this.nameOfFormalArgType = convertTypeStringToRegExp(expectedTypes); }
|
setExpectedTypes
|
292,072
|
boolean () { return StringUtil.isEmpty(expectedTypes) && !StringUtil.isEmpty(nameOfFormalArgType); }
|
isRegexFormalType
|
292,073
|
boolean () { return invertFormalType; }
|
isInvertFormalType
|
292,074
|
void (boolean invertFormalType) { this.invertFormalType = invertFormalType; }
|
setInvertFormalType
|
292,075
|
boolean () { return formalArgTypeWithinHierarchy; }
|
isFormalArgTypeWithinHierarchy
|
292,076
|
void (boolean formalArgTypeWithinHierarchy) { this.formalArgTypeWithinHierarchy = formalArgTypeWithinHierarchy; }
|
setFormalArgTypeWithinHierarchy
|
292,077
|
String () { return contextConstraint; }
|
getContextConstraint
|
292,078
|
void (@NotNull String contextConstraint) { this.contextConstraint = contextConstraint; }
|
setContextConstraint
|
292,079
|
boolean (String name) { return VALID_CONSTRAINT_NAME.matcher(name).matches(); }
|
isValidConstraintName
|
292,080
|
void (String name, String value) { if (!isValidConstraintName(name)) { throw new IllegalArgumentException("Invalid constraint name"); } if (additionalConstraints == null) { if (value == null) { return; } additionalConstraints = new HashMap<>(); } if (value == null) { additionalConstraints.remove(name); if (additionalConstraints.isEmpty()) { additionalConstraints = null; } } else { additionalConstraints.put(name, value); } }
|
putAdditionalConstraint
|
292,081
|
String (String name) { return (additionalConstraints == null) ? null : additionalConstraints.get(name); }
|
getAdditionalConstraint
|
292,082
|
boolean (Object o) { if (this == o) return true; if (!(o instanceof MatchVariableConstraint other)) return false; if (!super.equals(o)) return false; if (exprTypeWithinHierarchy != other.exprTypeWithinHierarchy) return false; if (formalArgTypeWithinHierarchy != other.formalArgTypeWithinHierarchy) return false; if (greedy != other.greedy) return false; if (invertExprType != other.invertExprType) return false; if (invertFormalType != other.invertFormalType) return false; if (invertReference != other.invertReference) return false; if (invertRegExp != other.invertRegExp) return false; if (maxCount != other.maxCount) return false; if (minCount != other.minCount) return false; if (partOfSearchResults != other.partOfSearchResults) return false; if (strictlyWithinHierarchy != other.strictlyWithinHierarchy) return false; if (wholeWordsOnly != other.wholeWordsOnly) return false; if (withinHierarchy != other.withinHierarchy) return false; if (!nameOfExprType.equals(other.nameOfExprType)) return false; if (!expressionTypes.equals(other.expressionTypes)) return false; if (!nameOfFormalArgType.equals(other.nameOfFormalArgType)) return false; if (!expectedTypes.equals(other.expectedTypes)) return false; if (!referenceConstraint.equals(other.referenceConstraint)) return false; if (!regExp.equals(other.regExp)) return false; if (!withinConstraint.equals(other.withinConstraint)) return false; if (!containsConstraint.equals(other.containsConstraint)) return false; if (invertWithinConstraint != other.invertWithinConstraint) return false; if (invertContainsConstraint != other.invertContainsConstraint) return false; if (!contextConstraint.equals(other.contextConstraint)) return false; if (additionalConstraints != null) { if (!additionalConstraints.equals(other.additionalConstraints)) return false; } else { return other.additionalConstraints == null; } return true; }
|
equals
|
292,083
|
int () { int result = super.hashCode(); result = 29 * result + regExp.hashCode(); result = 29 * result + (invertRegExp ? 1 : 0); result = 29 * result + (withinHierarchy ? 1 : 0); result = 29 * result + (strictlyWithinHierarchy ? 1 : 0); result = 29 * result + (wholeWordsOnly ? 1 : 0); result = 29 * result + minCount; result = 29 * result + maxCount; result = 29 * result + (greedy ? 1 : 0); result = 29 * result + (invertReference ? 1 : 0); result = 29 * result + referenceConstraint.hashCode(); result = 29 * result + (partOfSearchResults ? 1 : 0); result = 29 * result + nameOfExprType.hashCode(); result = 29 * result + expressionTypes.hashCode(); result = 29 * result + (invertExprType ? 1 : 0); result = 29 * result + (exprTypeWithinHierarchy ? 1 : 0); result = 29 * result + nameOfFormalArgType.hashCode(); result = 29 * result + expectedTypes.hashCode(); result = 29 * result + (invertFormalType ? 1 : 0); result = 29 * result + (formalArgTypeWithinHierarchy ? 1 : 0); result = 29 * result + withinConstraint.hashCode(); result = 29 * result + containsConstraint.hashCode(); result = 29 * result + contextConstraint.hashCode(); if (invertContainsConstraint) result = 29 * result + 1; if (invertWithinConstraint) result = 29 * result + 1; if (additionalConstraints != null) result = 29 * result + additionalConstraints.hashCode(); return result; }
|
hashCode
|
292,084
|
void (Element element) { super.readExternal(element); regExp = StringUtil.notNullize(element.getAttributeValue(REGEXP)); withinHierarchy = getBooleanValue(element, WITHIN_HIERARCHY, false); invertRegExp = getBooleanValue(element, NEGATE_NAME_CONDITION, false); wholeWordsOnly = getBooleanValue(element, WHOLE_WORDS_ONLY, false); nameOfExprType = StringUtil.notNullize(element.getAttributeValue(NAME_OF_EXPRTYPE)); expressionTypes = convertRegExpTypeToTypeString(nameOfExprType); exprTypeWithinHierarchy = getBooleanValue(element, EXPRTYPE_WITHIN_HIERARCHY, false); invertExprType = getBooleanValue(element, NEGATE_EXPRTYPE_CONDITION, false); nameOfFormalArgType = StringUtil.notNullize(element.getAttributeValue(NAME_OF_FORMALTYPE)); expectedTypes = convertRegExpTypeToTypeString(nameOfFormalArgType); formalArgTypeWithinHierarchy = getBooleanValue(element, FORMALTYPE_WITHIN_HIERARCHY, false); invertFormalType = getBooleanValue(element, NEGATE_FORMALTYPE_CONDITION, false); minCount = getIntValue(element, MIN_OCCURS, 1); maxCount = getIntValue(element, MAX_OCCURS, 1); referenceConstraint = StringUtil.notNullize(element.getAttributeValue(REFERENCE_CONDITION)); invertReference = getBooleanValue(element, NEGATE_REFERENCE_CONDITION, false); containsConstraint = StringUtil.notNullize(element.getAttributeValue(CONTAINS_CONDITION)); invertContainsConstraint = getBooleanValue(element, NEGATE_CONTAINS_CONDITION, false); withinConstraint = StringUtil.notNullize(element.getAttributeValue(WITHIN_CONDITION)); invertWithinConstraint = getBooleanValue(element, NEGATE_WITHIN_CONDITION, false); partOfSearchResults = getBooleanValue(element, TARGET, false); contextConstraint = StringUtil.notNullize(element.getAttributeValue(CONTEXT)); for (Attribute attribute : element.getAttributes()) { final String mangledName = attribute.getName(); if (!StringUtil.startsWith(mangledName, "_")) { continue; } final String name = mangledName.substring(1); if (!isValidConstraintName(name)) { throw new InvalidDataException(); } if (additionalConstraints == null) { additionalConstraints = new HashMap<>(); } additionalConstraints.put(name, attribute.getValue()); } }
|
readExternal
|
292,085
|
boolean (Element element, String attributeName, boolean defaultValue) { final Attribute attribute = element.getAttribute(attributeName); if (attribute != null) { try { return attribute.getBooleanValue(); } catch (DataConversionException ignored) {} } return defaultValue; }
|
getBooleanValue
|
292,086
|
int (Element element, String attributeName, int defaultValue) { final Attribute attribute = element.getAttribute(attributeName); if (attribute != null) { try { return attribute.getIntValue(); } catch (DataConversionException ignored) { } } return defaultValue; }
|
getIntValue
|
292,087
|
void (Element element) { super.writeExternal(element); if (!regExp.isEmpty()) element.setAttribute(REGEXP, regExp); if (!nameOfExprType.isEmpty()) element.setAttribute(NAME_OF_EXPRTYPE, nameOfExprType); if (!referenceConstraint.isEmpty()) element.setAttribute(REFERENCE_CONDITION, referenceConstraint); if (!nameOfFormalArgType.isEmpty()) element.setAttribute(NAME_OF_FORMALTYPE, nameOfFormalArgType); if (withinHierarchy) element.setAttribute(WITHIN_HIERARCHY, TRUE); if (exprTypeWithinHierarchy) element.setAttribute(EXPRTYPE_WITHIN_HIERARCHY, TRUE); if (formalArgTypeWithinHierarchy) element.setAttribute(FORMALTYPE_WITHIN_HIERARCHY, TRUE); if (minCount != 1) element.setAttribute(MIN_OCCURS, String.valueOf(minCount)); if (maxCount != 1) element.setAttribute(MAX_OCCURS, String.valueOf(maxCount)); if (partOfSearchResults) element.setAttribute(TARGET, TRUE); if (invertRegExp) element.setAttribute(NEGATE_NAME_CONDITION, TRUE); if (invertExprType) element.setAttribute(NEGATE_EXPRTYPE_CONDITION, TRUE); if (invertFormalType) element.setAttribute(NEGATE_FORMALTYPE_CONDITION, TRUE); if (invertReference) element.setAttribute(NEGATE_REFERENCE_CONDITION, TRUE); if (wholeWordsOnly) element.setAttribute(WHOLE_WORDS_ONLY, TRUE); if (invertContainsConstraint) element.setAttribute(NEGATE_CONTAINS_CONDITION, TRUE); if (invertWithinConstraint) element.setAttribute(NEGATE_WITHIN_CONDITION, TRUE); element.setAttribute(WITHIN_CONDITION, withinConstraint); element.setAttribute(CONTAINS_CONDITION, containsConstraint); if (!contextConstraint.isEmpty()) element.setAttribute(CONTEXT, contextConstraint); if (additionalConstraints != null && !additionalConstraints.isEmpty()) { List<String> list = ContainerUtil.sorted(additionalConstraints.keySet()); for (String key : list) { final String value = additionalConstraints.get(key); if (value != null) { element.setAttribute('_' + key, value); } } } }
|
writeExternal
|
292,088
|
String () { return withinConstraint; }
|
getWithinConstraint
|
292,089
|
void (@NotNull String withinConstraint) { this.withinConstraint = withinConstraint; }
|
setWithinConstraint
|
292,090
|
String () { return containsConstraint; }
|
getContainsConstraint
|
292,091
|
void (@NotNull String containsConstraint) { this.containsConstraint = containsConstraint; }
|
setContainsConstraint
|
292,092
|
boolean () { return invertContainsConstraint; }
|
isInvertContainsConstraint
|
292,093
|
void (boolean invertContainsConstraint) { this.invertContainsConstraint = invertContainsConstraint; }
|
setInvertContainsConstraint
|
292,094
|
boolean () { return invertWithinConstraint; }
|
isInvertWithinConstraint
|
292,095
|
void (boolean invertWithinConstraint) { this.invertWithinConstraint = invertWithinConstraint; }
|
setInvertWithinConstraint
|
292,096
|
ReplacementVariableDefinition () { return new ReplacementVariableDefinition(this); }
|
copy
|
292,097
|
boolean (Object o) { return o instanceof ReplacementVariableDefinition && super.equals(o); }
|
equals
|
292,098
|
void (@NotNull FileTypeEvent event) { clearCaches(); }
|
fileTypesChanged
|
292,099
|
void () { ourPredefinedConfigurations = null; ourDefaultFileType = null; ourNames2FileTypes = null; cache.clear(); }
|
clearCaches
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.