Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
34,500
GrImportStatement (@NotNull String qName, boolean isStatic, boolean isOnDemand, String alias) { return createImportStatement(qName, isStatic, isOnDemand, alias, null); }
createImportStatementFromText
34,501
GrImportStatement (@NotNull String text) { PsiFile dummyFile = createGroovyFileChecked(text); return ((GrImportStatement) dummyFile.getFirstChild()); }
createImportStatementFromText
34,502
GrImportStatement (@NotNull String qname, boolean isStatic, boolean isOnDemand, String alias, PsiElement context) { @NlsSafe StringBuilder builder = new StringBuilder(); builder.append("import "); if (isStatic) { builder.append("static "); } builder.append(qname); if (isOnDemand) { builder.append(".*"); } if (StringUtil.isNotEmpty(alias)) { builder.append(" as ").append(alias); } PsiFile dummyFile = createGroovyFileChecked(builder, false, context); return ((GrImportStatement)dummyFile.getFirstChild()); }
createImportStatement
34,503
CharSequence (@Nullable String modifier, @NotNull String name, @Nullable String type, String @NotNull [] paramTypes, String @NotNull [] paramNames, @Nullable String body, boolean isConstructor) { @NlsSafe StringBuilder builder = new StringBuilder(); if (modifier != null) { builder.append(modifier); builder.append(" "); } if (!isConstructor) { builder.append("def "); } //This is for constructor creation if (type != null) { builder.append(type); builder.append(" "); } builder.append(name); builder.append("("); for (int i = 0; i < paramNames.length; i++) { String paramType = paramTypes == null ? null : paramTypes[i]; if (i > 0) builder.append(", "); if (paramType != null) { builder.append(paramType); builder.append(" "); } builder.append(paramNames[i]); } builder.append(")"); if (body != null) { builder.append(body); } else { builder.append("{"); builder.append("}"); } return builder; }
generateMethodText
34,504
GrMethod (@NotNull String modifier, @NotNull String name, @Nullable String type, String @NotNull [] paramTypes, PsiElement context) { PsiType psiType; List<PsiType> res = new ArrayList<>(); final GroovyPsiElementFactory factory = GroovyPsiElementFactory.getInstance(myProject); for (String paramType : paramTypes) { try { psiType = factory.createTypeElement(paramType).getType(); } catch (IncorrectOperationException e) { psiType = TypesUtil.getJavaLangObject(context); } res.add(psiType); } String[] paramNames = GroovyNamesUtil.getMethodArgumentsNames(myProject, res.toArray(PsiType.createArray(res.size()))); final CharSequence text = generateMethodText(modifier, name, type, paramTypes, paramNames, null, false); return createMethodFromText(text.toString(), context); }
createMethodFromText
34,505
GrDocComment (@NotNull String text) { return (GrDocComment)createGroovyFileChecked(text).getFirstChild(); }
createDocCommentFromText
34,506
GrConstructorInvocation (@NotNull String text) { return createConstructorInvocation(text, null); }
createConstructorInvocation
34,507
GrConstructorInvocation (@NotNull String text, @Nullable PsiElement context) { GroovyFile file = createGroovyFileChecked("class Foo{ def Foo(){" + text + "}}", false, context); return PsiImplUtil.getChainingConstructorInvocation((GrMethod)file.getClasses()[0].getConstructors()[0]); }
createConstructorInvocation
34,508
PsiReferenceList (PsiClassType @NotNull [] exceptionTypes) { if (exceptionTypes.length == 0) { return createMethodFromText("def foo(){}", null).getThrowsList(); } String[] types = new String[exceptionTypes.length]; for (int i = 0; i < types.length; i++) { types[i] = exceptionTypes[i].getCanonicalText(); } final String end = StringUtil.join(types, ","); return createMethodFromText("def foo() throws " + end + "{}", null).getThrowsList(); }
createThrownList
34,509
GrCatchClause (@NotNull PsiClassType type, @NotNull String parameterName) { @NonNls StringBuilder buffer = new StringBuilder("try{} catch("); if (type == null) { buffer.append("Throwable "); } else { buffer.append(type.getCanonicalText()).append(" "); } buffer.append(parameterName).append("){\n}"); final GrTryCatchStatement statement = (GrTryCatchStatement)createStatementFromText(buffer); return statement.getCatchClauses()[0]; }
createCatchClause
34,510
GrArgumentList () { return ((GrCall)createExpressionFromText("foo()")).getArgumentList(); }
createArgumentList
34,511
GrArgumentList (@NotNull String argListText) { try { return ((GrCall)createExpressionFromText("foo " + argListText)).getArgumentList(); } catch (IncorrectOperationException e) { LOG.debug(argListText); throw e; } }
createArgumentListFromText
34,512
GrExtendsClause () { final GrTypeDefinition typeDefinition = createTypeDefinition("class A extends B {}"); final GrExtendsClause clause = typeDefinition.getExtendsClause(); clause.getReferenceElementsGroovy()[0].delete(); return clause; }
createExtendsClause
34,513
GrImplementsClause () { final GrTypeDefinition typeDefinition = createTypeDefinition("class A implements B {}"); final GrImplementsClause clause = typeDefinition.getImplementsClause(); clause.getReferenceElementsGroovy()[0].delete(); return clause; }
createImplementsClause
34,514
GrLiteral (@Nullable Object value) { if (value instanceof String) { StringBuilder buffer = GrStringUtil.getLiteralTextByValue((String)value); final GrExpression expr = createExpressionFromText(buffer); LOG.assertTrue(expr instanceof GrLiteral, "value = " + value); return (GrLiteral)expr; } if (value == null) { return (GrLiteral)createExpressionFromText("null"); } if (value instanceof Boolean) { return (GrLiteral)createExpressionFromText(value.toString()); } throw new IncorrectOperationException("Can not create literal from type: " + value.getClass().getName()); }
createLiteralFromValue
34,515
GrTraitTypeDefinition (@NotNull String name) { return (GrTraitTypeDefinition)createTypeDefinition("trait " + name + "{}"); }
createTrait
34,516
GrTraitTypeDefinition (@NotNull String name) { return (GrTraitTypeDefinition)createTypeDefinition("record " + name + "() {}"); }
createRecord
34,517
GrMethod () { return createConstructorFromText("Foo", "Foo(){}", null); }
createConstructor
34,518
PsiMethod (@NotNull @NonNls String name) { return createConstructorFromText(name, name + "(){}", null); }
createConstructor
34,519
PsiMethod (@NotNull @NonNls String name, PsiElement context) { return createConstructorFromText(name, name + "(){}", context); }
createConstructor
34,520
PsiClassType (@NotNull PsiClass resolve, @NotNull PsiSubstitutor substitutor) { return JavaPsiFacade.getElementFactory(myProject).createType(resolve, substitutor); }
createType
34,521
PsiClassType (@NotNull PsiClass resolve, @NotNull PsiSubstitutor substitutor, @Nullable LanguageLevel languageLevel) { return JavaPsiFacade.getElementFactory(myProject).createType(resolve, substitutor, languageLevel); }
createType
34,522
PsiClassType (@NotNull PsiClass aClass, PsiType parameters) { return JavaPsiFacade.getElementFactory(myProject).createType(aClass, parameters); }
createType
34,523
PsiClassType (@NotNull PsiClass aClass, PsiType... parameters) { return JavaPsiFacade.getElementFactory(myProject).createType(aClass, parameters); }
createType
34,524
PsiSubstitutor (@NotNull PsiTypeParameterListOwner owner) { return JavaPsiFacade.getElementFactory(myProject).createRawSubstitutor(owner); }
createRawSubstitutor
34,525
PsiSubstitutor (@NotNull Map<PsiTypeParameter, PsiType> map) { return JavaPsiFacade.getElementFactory(myProject).createSubstitutor(map); }
createSubstitutor
34,526
PsiPrimitiveType (@NotNull String text) { return JavaPsiFacade.getElementFactory(myProject).createPrimitiveType(text); }
createPrimitiveType
34,527
PsiClassType (@NotNull @NonNls String qName) { return JavaPsiFacade.getElementFactory(myProject).createTypeByFQClassName(qName); }
createTypeByFQClassName
34,528
PsiClassType (@NotNull @NonNls String qName, @NotNull GlobalSearchScope resolveScope) { return JavaPsiFacade.getElementFactory(myProject).createTypeByFQClassName(qName, resolveScope); }
createTypeByFQClassName
34,529
boolean (@NotNull String name) { return GroovyNamesUtil.isIdentifier(name); }
isValidClassName
34,530
boolean (@NotNull String name) { return true; }
isValidMethodName
34,531
boolean (@NotNull String name) { return GroovyNamesUtil.isIdentifier(name); }
isValidParameterName
34,532
boolean (@NotNull String name) { return GroovyNamesUtil.isIdentifier(name); }
isValidFieldName
34,533
boolean (@NotNull String name) { return GroovyNamesUtil.isIdentifier(name); }
isValidLocalVariableName
34,534
PsiType (String key) { GrExpression expression = myStringEntries.get(key); return expression != null ? inferTypePreventingRecursion(expression) : null; }
getTypeByStringKey
34,535
Set<String> () { return myStringEntries.keySet(); }
getStringKeys
34,536
boolean () { return myStringEntries.isEmpty() && myOtherEntries.isEmpty(); }
isEmpty
34,537
PsiType (final GrExpression expression) { return RecursionManager.doPreventingRecursion(expression, false, () -> TypesUtil.boxPrimitiveType(expression.getType(), expression.getManager(), myScope)); }
inferTypePreventingRecursion
34,538
List<Couple<PsiType>> () { return myTypesOfOtherEntries.getValue(); }
getOtherEntries
34,539
boolean () { for (GrExpression expression : myStringEntries.values()) { if (!expression.isValid()) return false; } for (Couple<GrExpression> entry : myOtherEntries) { if (!entry.first.isValid()) return false; if (!entry.second.isValid()) return false; } return true; }
isValid
34,540
boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; GrMapTypeFromNamedArgs args = (GrMapTypeFromNamedArgs)o; if (!myStringEntries.equals(args.myStringEntries)) return false; if (!myOtherEntries.equals(args.myOtherEntries)) return false; return true; }
equals
34,541
int () { int result = super.hashCode(); result = 31 * result + myStringEntries.hashCode(); result = 31 * result + myOtherEntries.hashCode(); return result; }
hashCode
34,542
String () { GrPackageDefinition packageDef = getPackageDefinition(); if (packageDef != null) { final String name = packageDef.getPackageName(); if (name != null) { return name; } } return ""; }
getPackageName
34,543
GrPackageDefinition () { final StubElement<?> stub = getStub(); if (stub != null) { for (StubElement element : stub.getChildrenStubs()) { if (element instanceof GrPackageDefinitionStub) return (GrPackageDefinition)element.getPsi(); } return null; } ASTNode node = calcTreeElement().findChildByType(GroovyStubElementTypes.PACKAGE_DEFINITION); return node != null ? (GrPackageDefinition)node.getPsi() : null; }
getPackageDefinition
34,544
GrParameter () { GrParameter parameter = mySyntheticArgsParameter; if (parameter == null) { final PsiType psiType = JavaPsiFacade.getElementFactory(getProject()).createTypeFromText("java.lang.String[]", this); parameter = new GrLightParameter(SYNTHETIC_PARAMETER_NAME, psiType, this); mySyntheticArgsParameter = parameter; } return parameter; }
getSyntheticArgsParameter
34,545
boolean (@NotNull final PsiScopeProcessor processor, @NotNull ResolveState state, @Nullable PsiElement lastParent, @NotNull PsiElement place) { ElementClassHint classHint = processor.getHint(ElementClassHint.KEY); if (getStub() == null) { if (!(lastParent instanceof GrMember)) { // only local usages are traversed here. Having a stub means the clients are outside and won't see our variables if (!processLocals(this, processor, state, lastParent, place)) return false; } if (!processBindings(this, processor, state, lastParent, place)) return false; } if (myContext != null) { return true; } final GroovyScriptClass scriptClass = getScriptClass(); if (scriptClass != null && !(lastParent instanceof GrTypeDefinition)) { if (!ResolveUtil.processClassDeclarations(scriptClass, processor, state, lastParent, place)) return false; } if (!super.processDeclarations(processor, state, lastParent, place)) return false; if (ResolveUtil.shouldProcessProperties(classHint)) { if (lastParent != null && !(lastParent instanceof GrTypeDefinition) && scriptClass != null) { if (!ResolveUtil.processElement(processor, getSyntheticArgsParameter(), state)) return false; } } return true; }
processDeclarations
34,546
boolean () { return true; }
isTopControlFlowOwner
34,547
GrImportStatement[] () { final StubElement<?> stub = getStub(); if (stub != null) { return stub.getChildrenByType(GroovyStubElementTypes.IMPORT, GrImportStatement.ARRAY_FACTORY); } return calcTreeElement().getChildrenAsPsiElements(GroovyStubElementTypes.IMPORT, GrImportStatement.ARRAY_FACTORY); }
getImportStatements
34,548
GrImportStatement (@NotNull PsiClass aClass) { try { // Calculating position GroovyPsiElementFactory factory = GroovyPsiElementFactory.getInstance(getProject()); String qname = aClass.getQualifiedName(); if (qname != null) { GrImportStatement importStatement = factory.createImportStatementFromText(qname, false, false, null); return addImport(importStatement); } } catch (IncorrectOperationException e) { LOG.error(e); } return null; }
addImportForClass
34,549
boolean () { final StubElement stub = getStub(); if (stub instanceof GrFileStub) { return ((GrFileStub)stub).isScript(); } Boolean isScript = myScript; if (isScript == null) { isScript = checkIsScript(); myScript = isScript; } return isScript; }
isScript
34,550
boolean () { final GrTopStatement[] topStatements = findChildrenByClass(GrTopStatement.class); boolean hasClassDefinitions = false; boolean hasTopStatements = false; for (GrTopStatement st : topStatements) { if (st instanceof GrTypeDefinition) { hasClassDefinitions = true; } else if (!(st instanceof GrImportStatement || st instanceof GrPackageDefinition)) { hasTopStatements = true; break; } } return hasTopStatements || !hasClassDefinitions; }
checkIsScript
34,551
void () { myScript = null; super.subtreeChanged(); }
subtreeChanged
34,552
GroovyScriptClass () { if (!isScript()) { return null; } GroovyScriptClass aClass = myScriptClass; if (aClass == null) { aClass = new GroovyScriptClass(this); myScriptClass = aClass; } return aClass; }
getScriptClass
34,553
void (@NotNull String packageName) { final ASTNode fileNode = getNode(); final GrPackageDefinition currentPackage = getPackageDefinition(); if (packageName.isEmpty()) { if (currentPackage != null) { final ASTNode currNode = currentPackage.getNode(); fileNode.removeChild(currNode); } return; } final GroovyPsiElementFactory factory = GroovyPsiElementFactory.getInstance(getProject()); final GrPackageDefinition newPackage = (GrPackageDefinition)factory.createTopElementFromText("package " + packageName); if (currentPackage != null) { final GrCodeReferenceElement packageReference = currentPackage.getPackageReference(); if (packageReference != null) { GrCodeReferenceElement ref = newPackage.getPackageReference(); if (ref != null) { packageReference.replace(ref); } return; } } final ASTNode newNode = newPackage.getNode(); if (currentPackage != null) { final ASTNode currNode = currentPackage.getNode(); fileNode.replaceChild(currNode, newNode); } else { ASTNode anchor = fileNode.getFirstChildNode(); if (anchor != null && anchor.getElementType() == GroovyTokenTypes.mSH_COMMENT) { anchor = anchor.getTreeNext(); fileNode.addLeaf(GroovyTokenTypes.mNLS, "\n", anchor); } fileNode.addChild(newNode, anchor); if (anchor != null && !anchor.getText().startsWith("\n\n")) { fileNode.addLeaf(GroovyTokenTypes.mNLS, "\n", anchor); } } }
setPackageName
34,554
GrPackageDefinition (@Nullable GrPackageDefinition newPackage) { final GrPackageDefinition oldPackage = getPackageDefinition(); if (oldPackage == null) { if (newPackage != null) { final GrPackageDefinition result = (GrPackageDefinition)addAfter(newPackage, null); getNode().addLeaf(GroovyTokenTypes.mNLS, "\n", result.getNode().getTreeNext()); return result; } } else { if (newPackage != null) { return (GrPackageDefinition)oldPackage.replace(newPackage); } else { oldPackage.delete(); } } return null; }
setPackage
34,555
PsiType () { return CachedValuesManager.getCachedValue(this, () -> CachedValueProvider.Result .create(GroovyPsiManager.inferType(this, new MethodTypeInferencer(this)), PsiModificationTracker.MODIFICATION_COUNT)); }
getInferredScriptReturnType
34,556
void () { super.clearCaches(); myScriptClass = null; mySyntheticArgsParameter = null; }
clearCaches
34,557
PsiElement () { return myContext != null && myContext.isValid() ? myContext : super.getContext(); }
getContext
34,558
GroovyFileImpl () { GroovyFileImpl clone = (GroovyFileImpl)super.clone(); clone.myContext = myContext; return clone; }
clone
34,559
void (PsiElement context) { if (context != null) { myContext = context; } }
setContext
34,560
void (PsiElement context) { myContext = context; }
setContextNullable
34,561
PsiElement () { final PsiClass scriptClass = getScriptClass(); if (scriptClass != null) { final PsiElement originalElement = scriptClass.getOriginalElement(); if (originalElement != scriptClass) { return originalElement.getContainingFile(); } } return this; }
getOriginalElement
34,562
boolean (PsiElement place) { if (!isContentsLoaded()) return true; // 1. We actually should never get GrTypeDefinition as a parent, because it is a PsiClass, // and PsiClasses prevent to go up in a tree any further // 2. If place is under a variable then @BaseScript or @Field may be changed, // which actually is a change in Java Structure return !isScript() || PsiTreeUtil.getParentOfType(place, GrTypeDefinition.class, GrVariableDeclaration.class) != null; }
shouldChangeModificationCount
34,563
GroovyFileImports () { return GroovyImports.getFileImports(this); }
getImports
34,564
String () { if (ApplicationManager.getApplication().isUnitTestMode()) { return super.toString(); } return "GroovyFileImpl:" + getName(); }
toString
34,565
PsiSubstitutor () { return mySubstitutor; }
getContextSubstitutor
34,566
PsiSubstitutor () { return mySubstitutor; }
getSubstitutor
34,567
boolean () { return myIsAccessible; }
isAccessible
34,568
boolean () { return myIsStaticsOK; }
isStaticsOK
34,569
boolean () { return myIsApplicable; }
isApplicable
34,570
PsiElement () { return myElement; }
getElement
34,571
boolean () { return isAccessible() && isApplicable() && isStaticsOK(); }
isValidResult
34,572
boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; GroovyResolveResultImpl that = (GroovyResolveResultImpl)o; return myIsAccessible == that.myIsAccessible && myElement.getManager().areElementsEquivalent(myElement, that.myElement); }
equals
34,573
int () { int result = 0; if (myElement instanceof PsiNamedElement) { String name = ((PsiNamedElement)myElement).getName(); if (name != null) { result = name.hashCode(); } } result = 31 * result + (myIsAccessible ? 1 : 0); return result; }
hashCode
34,574
PsiElement () { return myCurrentFileResolveContext; }
getCurrentFileResolveContext
34,575
boolean () { return myIsInvokedOnProperty; }
isInvokedOnProperty
34,576
SpreadState () { return mySpreadState; }
getSpreadState
34,577
String () { return "GroovyResolveResultImpl{" + "myElement=" + myElement + ", mySubstitutor=" + mySubstitutor + '}'; }
toString
34,578
GroovyResolveResult (@NotNull PsiClassType.ClassResolveResult classResolveResult) { if (classResolveResult.getElement() == null) return EmptyGroovyResolveResult.INSTANCE; return new GroovyResolveResultImpl( classResolveResult.getElement(), null, null, classResolveResult.getSubstitutor(), classResolveResult.isAccessible(), classResolveResult.isStaticsScopeCorrect(), false, classResolveResult.isValidResult() ); }
from
34,579
int () { PsiClass resolved = resolve(); return resolved != null && resolved.getTypeParameters().length == 1 ? 1 : 0; }
getParameterCount
34,580
String () { return GroovyCommonClassNames.GROOVY_LANG_CLOSURE; }
getJavaClassName
34,581
PsiClassType () { PsiType[] typeArgs = myTypeArgs.getValue(); if (typeArgs != null && typeArgs.length == 0) { return this; } return new GrClosureType(getLanguageLevel(), getResolveScope(), myFacade, mySignatures, false); }
rawType
34,582
boolean () { return ContainerUtil.all(mySignatures, GrSignature::isValid); }
isValid
34,583
boolean (Object obj) { if (obj instanceof GrClosureType) { return Comparing.equal(mySignatures, ((GrClosureType)obj).mySignatures); } return super.equals(obj); }
equals
34,584
PsiClassType (@NotNull final LanguageLevel languageLevel) { return new GrClosureType(languageLevel, myScope, myFacade, mySignatures, myTypeArgs); }
setLanguageLevel
34,585
GrClosureType (@NotNull Iterable<? extends GroovyResolveResult> results, @NotNull GroovyPsiElement context) { List<GrSignature> signatures = new ArrayList<>(); for (GroovyResolveResult result : results) { if (result.getElement() instanceof PsiMethod) { signatures.add(GrClosureSignatureUtil.createSignature((PsiMethod)result.getElement(), result.getSubstitutor())); } } final GlobalSearchScope resolveScope = context.getResolveScope(); final JavaPsiFacade facade = JavaPsiFacade.getInstance(context.getProject()); return create(signatures, resolveScope, facade, LanguageLevel.JDK_1_5, true); }
create
34,586
GrClosureType (@NotNull GrFunctionalExpression expression, boolean shouldInferTypeParameters) { final GrSignature signature = GrClosureSignatureUtil.createSignature(expression); final GlobalSearchScope resolveScope = expression.getResolveScope(); final JavaPsiFacade facade = JavaPsiFacade.getInstance(expression.getProject()); return create(Collections.singletonList(signature), resolveScope, facade, LanguageLevel.JDK_1_5, shouldInferTypeParameters); }
create
34,587
GrClosureType (@NotNull List<GrSignature> signatures, GlobalSearchScope scope, JavaPsiFacade facade, @NotNull LanguageLevel languageLevel, boolean shouldInferTypeParameters) { return new GrClosureType(languageLevel, scope, facade, signatures, shouldInferTypeParameters); }
create
34,588
PsiType (PsiType @NotNull [] args, int position, @NotNull PsiElement context) { final List<GrSignature> curried = CurryKt.curry(mySignatures, args, position, context); if (curried.isEmpty()) { return null; } return new GrClosureType(myLanguageLevel, myScope, myFacade, curried, myTypeArgs); }
curry
34,589
List<GrSignature> () { return mySignatures; }
getSignatures
34,590
String () { return "PsiType: Closure<*>"; }
toString
34,591
void (@NotNull Runnable runnable) { ourForbidClosureInference = true; try { runnable.run(); } finally { ourForbidClosureInference = false; } }
forbidClosureInference
34,592
List<PsiClass> (PsiClass clazz, GlobalSearchScope scope, boolean includeAnonymous) { final String name = clazz.getName(); if (name == null) return Collections.emptyList(); final ArrayList<PsiClass> inheritors = new ArrayList<>(); for (GrReferenceList list : StubIndex.getElements(GrDirectInheritorsIndex.KEY, name, clazz.getProject(), scope, GrReferenceList.class)) { final PsiElement parent = list.getParent(); if (parent instanceof GrTypeDefinition) { inheritors.add((PsiClass)parent); } } if (includeAnonymous) { inheritors.addAll(StubIndex.getElements(GrAnonymousClassIndex.KEY, name, clazz.getProject(), scope, GrAnonymousClassDefinition.class)); } return inheritors; }
getDerivingClassCandidates
34,593
boolean (@NotNull final DirectClassInheritorsSearch.SearchParameters queryParameters, @NotNull final Processor<? super PsiClass> consumer) { final PsiClass clazz = queryParameters.getClassToProcess(); SearchScope scope = ReadAction.compute(() -> queryParameters.getScope().intersectWith(clazz.getUseScope())); Project project = PsiUtilCore.getProjectInReadAction(clazz); GlobalSearchScope globalSearchScope = GlobalSearchScopeUtil.toGlobalSearchScope(scope, project); DumbService dumbService = DumbService.getInstance(project); List<PsiClass> candidates = dumbService.runReadActionInSmartMode(() -> { if (!clazz.isValid()) return Collections.emptyList(); return getDerivingClassCandidates(clazz, globalSearchScope, queryParameters.includeAnonymous()); }); if (!candidates.isEmpty()) { RelaxedDirectInheritorChecker checker = dumbService.runReadActionInSmartMode(() -> new RelaxedDirectInheritorChecker(clazz)); for (PsiClass candidate : candidates) { if (!queryParameters.isCheckInheritance() || dumbService.runReadActionInSmartMode(() -> checker.checkInheritance(candidate))) { if (!consumer.process(candidate)) { return false; } } } } return true; }
execute
34,594
boolean (PsiElement exp) { if (!(exp instanceof GrBinaryExpression binaryExpression)) { return false; } final IElementType sign = binaryExpression.getOperationTokenType(); return s_comparisonStrings.containsKey(sign); }
isComparison
34,595
String (IElementType str) { return s_comparisonStrings.get(str); }
getStringForComparison
34,596
String (IElementType str) { return s_swappedComparisons.get(str); }
getFlippedComparison
34,597
String (IElementType str) { return s_invertedComparisons.get(str); }
getNegatedComparison
34,598
boolean (GrExpression exp) { GrExpression ancestor = exp; while (ancestor.getParent() instanceof GrParenthesizedExpression) { ancestor = (GrExpression) ancestor.getParent(); } if (ancestor.getParent() instanceof GrUnaryExpression prefixAncestor) { final IElementType sign = prefixAncestor.getOperationTokenType(); if (GroovyTokenTypes.mLNOT.equals(sign)) { return true; } } return false; }
isNegated
34,599
GrExpression (GrExpression exp) { GrExpression ancestor = exp; while (ancestor.getParent() instanceof GrParenthesizedExpression) { ancestor = (GrExpression) ancestor.getParent(); } if (ancestor.getParent() instanceof GrUnaryExpression prefixAncestor) { final IElementType sign = prefixAncestor.getOperationTokenType(); if (GroovyTokenTypes.mLNOT.equals(sign)) { return prefixAncestor; } } return null; }
findNegation