Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
36,200
Applicability (@NotNull List<Argument> arguments, @NotNull PsiMethod method) { for (GroovyApplicabilityProvider applicabilityProvider : EP_NAME.getExtensions()) { Applicability result = applicabilityProvider.isApplicable(arguments, method); if (result != null) return result; } return null; }
checkProviders
36,201
Applicability (PsiType @NotNull [] argumentTypes, @NotNull PsiMethod method) { return checkProviders(ContainerUtil.map(argumentTypes, JustTypeArgument::new), method); }
checkProviders
36,202
void (@NotNull GrCall call, @NotNull GroovyResolveResult resolveResult, @Nullable String argumentName, boolean forCompletion, @NotNull Map<String, NamedArgumentDescriptor> result) { }
getNamedArguments
36,203
NamedArgumentDescriptor (String key, NamedArgumentDescriptor value) { NamedArgumentDescriptor oldValue = super.put(key, value); if (oldValue != null) { super.put(key, oldValue); } return oldValue; }
put
36,204
boolean (PsiParameter parameter) { PsiType type = parameter.getType(); if (parameter instanceof GrParameter && type.equalsToText(CommonClassNames.JAVA_LANG_OBJECT) && ((GrParameter)parameter).getTypeElementGroovy() == null) { return true; } return InheritanceUtil.isInheritor(type, CommonClassNames.JAVA_UTIL_MAP); }
canBeMap
36,205
Collection<String> (@NotNull GrExpression qualifier, @Nullable PsiElement resolve) { throw new UnsupportedOperationException(); }
getKeyVariants
36,206
PsiType (@NotNull GrExpression qualifier, @Nullable PsiElement resolve, @NotNull String key) { return null; }
getValueType
36,207
boolean (@NotNull GrReferenceExpression expression) { for (GroovyUnresolvedHighlightFilter filter : EP_NAME.getExtensions()) { if (filter.isReject(expression)) return false; } return true; }
shouldHighlight
36,208
boolean (@NotNull GrReferenceExpression expression) { PsiFile file = expression.getContainingFile(); Boolean cachedValue = file.getUserData(KEY); if (cachedValue != null) return cachedValue; boolean res = false; for (GroovyUnresolvedHighlightFileFilter filter : GroovyUnresolvedHighlightFileFilter.EP_NAME.getExtensions()) { if (filter.isReject(file)) { res = true; break; } } file.putUserData(KEY, res); return res; }
isReject
36,209
Iterable<String> () { assert !StringUtil.isEmptyOrSpaces(name); return StringUtil.tokenize(name, ATTR_NAMES_DELIMITER); }
getNames
36,210
List<String> () { if (params != null) { assert (checkParamsType == null || checkParamsType); String[] paramsTypeNames = new String[params.length]; for (int i = 0; i < params.length; i++) { String typeName = params[i].type; assert StringUtil.isNotEmpty(typeName); paramsTypeNames[i] = typeName; } return Arrays.asList(paramsTypeNames); } if (checkParamsType != null && checkParamsType) { return Collections.emptyList(); } else { return null; } }
getParams
36,211
NamedArgumentDescriptor (@Nullable Boolean methodFirstFlag, @Nullable Boolean attrFirstFlag, @Nullable String type) { Boolean objShowFirst = attrFirstFlag; if (objShowFirst == null) { objShowFirst = methodFirstFlag; } boolean showFirst = objShowFirst == null || objShowFirst; if (StringUtil.isEmptyOrSpaces(type)) { return showFirst ? NamedArgumentDescriptor.SIMPLE_ON_TOP : NamedArgumentDescriptor.SIMPLE_NORMAL; } return showFirst ? new StringTypeCondition(type.trim()) : new StringTypeCondition(NamedArgumentDescriptor.Priority.NORMAL, type.trim()); }
getDescriptor
36,212
String () { return id; }
getId
36,213
GlobalSearchScope (@NotNull GroovyFile file, @NotNull GlobalSearchScope baseScope) { return baseScope; }
patchResolveScope
36,214
boolean (@NotNull PsiType type, @NotNull GroovyPsiElement context) { return InheritanceUtil.isInheritor(type, myTypeName); }
checkType
36,215
PsiElement () { return myNavigationElement; }
getNavigationElement
36,216
PsiSubstitutor () { return mySubstitutor == null ? PsiSubstitutor.EMPTY : mySubstitutor; }
getSubstitutor
36,217
PsiPolyVariantReference (@NotNull GrArgumentLabel label) { final PsiElement navigationElement = getNavigationElement(); if (navigationElement == null) return null; return new NamedArgumentReference(label, navigationElement, getSubstitutor()); }
createReference
36,218
PsiElement () { return myNavigationElement; }
resolve
36,219
boolean (@NotNull PsiType type, @NotNull GroovyPsiElement context) { return TypesUtil.isAssignable(myType, type, context); }
checkType
36,220
Priority () { return myPriority; }
getPriority
36,221
GantSettings (@NotNull Project project) { return project.getService(GantSettings.class); }
getInstance
36,222
void (@NotNull SdkHomeBean state) { SdkHomeBean oldState = getState(); super.loadState(state); if (oldState != null) { PsiElementFinder.EP.findExtension(GantClassFinder.class, myProject).clearCache(); } }
loadState
36,223
List<VirtualFile> () { return GantSettings.getInstance(myProject).getClassRoots(); }
calcClassRoots
36,224
SpockVariableDescriptor (@Nullable GrExpression expression) { myExpressions.add(expression); return this; }
addExpression
36,225
SpockVariableDescriptor (@Nullable GrExpression expression) { if (myExpressionsOfCollection == null) { myExpressionsOfCollection = new ArrayList<>(); } myExpressionsOfCollection.add(expression); return this; }
addExpressionOfCollection
36,226
String () { return myName; }
getName
36,227
PsiElement () { return myNavigationElement; }
getNavigationElement
36,228
PsiVariable () { if (myVariable == null) { PsiType type = getType(); myVariable = new SpockVariable(myNavigationElement.getManager(), myName, type, myNavigationElement); } return myVariable; }
getVariable
36,229
PsiType () { PsiManager manager = myNavigationElement.getManager(); PsiType type = RecursionManager.doPreventingRecursion(this, true, () -> { PsiType res = null; for (GrExpression expression : myExpressions) { if (expression == null) continue; res = TypesUtil.getLeastUpperBoundNullable(res, expression.getType(), manager); } if (myExpressionsOfCollection != null) { for (GrExpression expression : myExpressionsOfCollection) { if (expression == null) continue; PsiType listType = expression.getType(); PsiType type1 = PsiUtil.extractIterableTypeParameter(listType, true); if (type1 == null) { if (listType == null) continue; if (listType.equalsToText(CommonClassNames.JAVA_LANG_STRING)) { type1 = PsiType.getJavaLangString(expression.getManager(), expression.getResolveScope()); } } res = TypesUtil.getLeastUpperBoundNullable(res, type1, manager); } } return res; }); if (type == null) { return PsiType.getJavaLangObject(manager, myNavigationElement.getResolveScope()); } else { return type; } }
getType
36,230
boolean (PsiElement another) { return super.isEquivalentTo(another) || (another instanceof SpockVariable && getNavigationElement() == another.getNavigationElement()); }
isEquivalentTo
36,231
String () { return myName; }
toString
36,232
void (@NotNull PsiType qualifierType, @Nullable PsiClass aClass, @NotNull PsiScopeProcessor processor, @NotNull PsiElement place, @NotNull ResolveState state) { if (aClass == null) { return; } ElementClassHint classHint = processor.getHint(ElementClassHint.KEY); boolean shouldProcessProperties = ResolveUtil.shouldProcessProperties(classHint); boolean shouldProcessMethods = ResolveUtil.shouldProcessMethods(classHint); if (!shouldProcessMethods && !shouldProcessProperties) return; GrMethod method = PsiTreeUtil.getParentOfType(place, GrMethod.class); if (method == null) return; if (shouldProcessProperties && SpecificationKt.isSpockSpecification(aClass) && aClass == method.getContainingClass()) { Map<String, SpockVariableDescriptor> cachedValue = SpockUtils.getVariableMap(method); String nameHint = ResolveUtil.getNameHint(processor); if (nameHint == null) { for (SpockVariableDescriptor spockVar : cachedValue.values()) { if (!processor.execute(spockVar.getVariable(), state)) return; } } else { SpockVariableDescriptor spockVar = cachedValue.get(nameHint); if (spockVar != null && spockVar.getNavigationElement() != place) { processor.execute(spockVar.getVariable(), state); } if (UNDERSCORES.matcher(nameHint).matches()) { GrLightVariable variable = new GrLightVariable(place.getManager(), nameHint, PsiTypes.nullType(), List.of(), method); processor.execute(variable, state); } } } if (shouldProcessMethods) { processUseAnnotation(qualifierType, place, processor, state); } }
processDynamicElements
36,233
void (@NotNull PsiType qualifierType, @NotNull PsiElement place, @NotNull PsiScopeProcessor processor, @NotNull ResolveState state) { List<PsiAnnotation> annotations = new ArrayList<>(); List<PsiModifierListOwner> parents = PsiTreeUtil.collectParents(place, PsiModifierListOwner.class, true, (element) -> false); for (PsiModifierListOwner parent : parents) { PsiModifierList modifierList = parent.getModifierList(); if (modifierList == null) { continue; } PsiAnnotation anno = modifierList.findAnnotation(SPOCK_UTIL_MOP_USE); if (anno != null) { annotations.add(anno); } } if (annotations.isEmpty()) { return; } List<PsiClass> categoryClasses = ContainerUtil.flatMap(annotations, (annotation) -> GrAnnotationUtil.getClassArrayValue(annotation, "value", true)); if (categoryClasses.isEmpty()) { return; } List<GdkMethodHolder> holders = ContainerUtil.map(categoryClasses, (categoryClass) -> GdkMethodHolder.getHolderForClass(categoryClass, true)); for (GdkMethodHolder categoryHolder : holders) { if (!categoryHolder.processMethods(processor, state, qualifierType, place.getProject())) { return; } } }
processUseAnnotation
36,234
String () { return null; }
getParentClassName
36,235
void (@NotNull PsiElement element, int offsetInElement, @NotNull Consumer<? super PomTarget> consumer) { String name = SpockUtils.getNameByReference(element); if (name == null) return; GrMethod method = PsiTreeUtil.getParentOfType(element, GrMethod.class); if (method == null) return; PsiClass containingClass = method.getContainingClass(); if (containingClass == null) return; if (!InheritanceUtil.isInheritor(containingClass, SpockUtils.SPEC_CLASS_NAME)) return; Map<String, SpockVariableDescriptor> cachedValue = SpockUtils.getVariableMap(method); SpockVariableDescriptor descriptor = cachedValue.get(name); if (descriptor == null) return; if (descriptor.getNavigationElement() == element) { consumer.consume(descriptor.getVariable()); } }
findDeclarationsAt
36,236
PsiElement () { Map<String, SpockVariableDescriptor> variableMap = SpockUtils.getVariableMap(myMethod); String value = getValue(); SpockVariableDescriptor descriptor = variableMap.get(value); if (descriptor == null) return null; return descriptor.getVariable(); }
resolve
36,237
PsiElement (String newName) { return super.handleElementRename(newName); }
superHandleRename
36,238
String (@Nullable PsiElement expression) { if (!(expression instanceof GrReferenceExpression ref)) return null; PsiElement firstChild = expression.getFirstChild(); if (firstChild != expression.getLastChild() || !PsiImplUtil.isLeafElementOfType(firstChild, GroovyTokenTypes.mIDENT)) return null; if (ref.isQualified()) return null; return ref.getReferenceName(); }
getNameByReference
36,239
boolean (PsiElement element) { if (!(element instanceof GrMethod method)) return false; PsiClass clazz = method.getContainingClass(); if (!isSpecification(clazz)) return false; if (isFixtureMethod(method)) return false; return isFeatureMethod(method); }
isTestMethod
36,240
boolean (@Nullable PsiClass clazz) { return clazz instanceof GrTypeDefinition && InheritanceUtil.isInheritor(clazz, SPEC_CLASS_NAME); }
isSpecification
36,241
boolean (@NotNull GrMethod method) { if (method.hasModifierProperty(PsiModifier.STATIC)) return false; return SpockConstants.FIXTURE_METHOD_NAMES.contains(method.getName()); }
isFixtureMethod
36,242
boolean (@NotNull GrMethod method) { if (method.hasModifierProperty(PsiModifier.STATIC)) return false; GrOpenBlock block = method.getBlock(); if (block == null) return false; for (GrStatement statement : block.getStatements()) { if (!(statement instanceof GrLabeledStatement)) { continue; } String label = ((GrLabeledStatement)statement).getName(); if (SpockConstants.FEATURE_METHOD_LABELS.contains(label)) return true; } return false; }
isFeatureMethod
36,243
boolean (@NotNull GrMethod method, @NotNull GlobalUsageHelper helper) { PsiClass containingClass = method.getContainingClass(); return isSpecification(containingClass) && !isTestMethod(method) && !isFixtureMethod(method) && !helper.isLocallyUsed(method); }
isUnusedInSpock
36,244
boolean (PsiElement e) { PsiFile file = e.getContainingFile(); return file instanceof PropertiesFile && Comparing.equal(file.getName(), ORG_CODEHAUS_GROOVY_RUNTIME_EXTENSION_MODULE, file.getViewProvider().getVirtualFile().isCaseSensitive()); }
isInDGMFile
36,245
boolean (@NotNull PsiType qualifierType, @NotNull PsiScopeProcessor processor, @NotNull PsiElement place, @NotNull ResolveState state) { if (!ResolveUtil.shouldProcessMethods(processor.getHint(ElementClassHint.KEY))) return true; final Project project = place.getProject(); ConcurrentMap<GlobalSearchScope, List<GdkMethodHolder>> map = CachedValuesManager.getManager(project).getCachedValue( project, () -> { ConcurrentMap<GlobalSearchScope, List<GdkMethodHolder>> value = ContainerUtil.createConcurrentSoftValueMap(); return CachedValueProvider.Result.create(value, PsiModificationTracker.MODIFICATION_COUNT); }); GlobalSearchScope scope = place.getResolveScope(); List<GdkMethodHolder> gdkMethods = map.get(scope); if (gdkMethods == null) { map.put(scope, gdkMethods = calcGdkMethods(project, scope)); } for (GdkMethodHolder holder : gdkMethods) { if (!holder.processMethods(processor, state, qualifierType, project)) { return false; } } if (!resolvesToMacro(processor, state, place, project)) { return false; } return true; }
processDgmMethods
36,246
boolean (PsiScopeProcessor processor, ResolveState state, @NotNull PsiElement place, Project project) { GroovyMacroRegistryService macroService = project.getService(GroovyMacroRegistryService.class); NameHint nameHint = processor.getHint(NameHint.KEY); String name = nameHint == null ? null : nameHint.getName(state); if (name == null) { return true; } Collection<PsiMethod> macros = macroService.getAllKnownMacros(place); for (PsiMethod macro : macros) { if (!processor.execute(GdkMethodUtil.createMacroMethod(macro), state)) { return false; } } return true; }
resolvesToMacro
36,247
List<GdkMethodHolder> (Project project, GlobalSearchScope resolveScope) { List<GdkMethodHolder> gdkMethods = new ArrayList<>(); JavaPsiFacade facade = JavaPsiFacade.getInstance(project); Couple<List<String>> extensions = collectExtensions(project, resolveScope); for (String category : extensions.getFirst()) { PsiClass clazz = facade.findClass(category, resolveScope); if (clazz != null) { gdkMethods.add(GdkMethodHolder.getHolderForClass(clazz, false)); } } for (String category : extensions.getSecond()) { PsiClass clazz = facade.findClass(category, resolveScope); if (clazz != null) { gdkMethods.add(GdkMethodHolder.getHolderForClass(clazz, true)); } } return gdkMethods; }
calcGdkMethods
36,248
Couple<List<String>> (@NotNull Project project, @NotNull GlobalSearchScope resolveScope) { List<String> instanceClasses = new ArrayList<>(DEFAULT_INSTANCE_EXTENSIONS); List<String> staticClasses = new ArrayList<>(DEFAULT_STATIC_EXTENSIONS); doCollectExtensions(project, resolveScope, instanceClasses, staticClasses, "META-INF.groovy"); doCollectExtensions(project, resolveScope, instanceClasses, staticClasses, "META-INF.services"); return Couple.of(instanceClasses, staticClasses); }
collectExtensions
36,249
void (@NotNull Project project, @NotNull GlobalSearchScope resolveScope, @NotNull List<? super String> instanceClasses, @NotNull List<? super String> staticClasses, @NlsSafe @NotNull String packageName) { PsiPackage aPackage = JavaPsiFacade.getInstance(project).findPackage(packageName); if (aPackage == null) return; for (PsiDirectory directory : aPackage.getDirectories(resolveScope)) { PsiFile file = directory.findFile(DGMUtil.ORG_CODEHAUS_GROOVY_RUNTIME_EXTENSION_MODULE); if (!(file instanceof PropertiesFile)) continue; AstLoadingFilter.forceAllowTreeLoading(file, () -> { IProperty inst = ((PropertiesFile)file).findPropertyByKey("extensionClasses"); IProperty stat = ((PropertiesFile)file).findPropertyByKey("staticExtensionClasses"); if (inst != null) collectClasses(inst, instanceClasses); if (stat != null) collectClasses(stat, staticClasses); }); } }
doCollectExtensions
36,250
void (@NotNull IProperty pr, @NotNull List<? super String> classes) { String value = pr.getUnescapedValue(); if (value == null) return; value = value.trim(); String[] qnames = value.split("\\s*,\\s*"); ContainerUtil.addAll(classes, qnames); }
collectClasses
36,251
boolean (@NotNull Property property) { if (DGMUtil.isInDGMFile(property)) { String name = property.getName(); return ArrayUtil.find(DGMUtil.KEYS, name) >= 0; } return false; }
isUsed
36,252
PsiType (@NotNull PsiMethod method) { final PsiType parameterType = method.getParameterList().getParameters()[0].getType(); return TypeConversionUtil.erasure(parameterType); }
getCategoryTargetType
36,253
boolean (PsiScopeProcessor processor, @NotNull ResolveState state, PsiType qualifierType, Project project) { if (qualifierType == null) return true; if (state.get(ClassHint.STATIC_CONTEXT) == Boolean.TRUE && !myStatic) return true; NameHint nameHint = processor.getHint(NameHint.KEY); String name = nameHint == null ? null : nameHint.getName(state); final MultiMap<String, PsiMethod> map = name != null ? myOriginalMethodsByNameAndType.get(name) : myOriginalMethodByType.getValue(); if (map.isEmpty()) { return true; } for (String superType : ResolveUtil.getAllSuperTypes(qualifierType, project)) { for (PsiMethod method : map.get(superType)) { String info = GdkMethodUtil.generateOriginInfo(method); GrGdkMethod gdk = GrGdkMethodImpl.createGdkMethod(method, myStatic, info); if (!processor.execute(gdk, state)) { return false; } } } return true; }
processMethods
36,254
GdkMethodHolder (final PsiClass categoryClass, final boolean isStatic) { final Project project = categoryClass.getProject(); Key<CachedValue<GdkMethodHolder>> key = isStatic ? CACHED_STATIC : CACHED_NON_STATIC; return CachedValuesManager.getManager(project).getCachedValue(categoryClass, key, () -> { GdkMethodHolder result = new GdkMethodHolder(categoryClass, isStatic); final ProjectRootManager rootManager = ProjectRootManager.getInstance(project); final VirtualFile vfile = categoryClass.getContainingFile().getVirtualFile(); if (vfile != null && rootManager.getFileIndex().isInLibrary(vfile)) { return CachedValueProvider.Result.create(result, rootManager); } return CachedValueProvider.Result.create(result, PsiModificationTracker.MODIFICATION_COUNT, rootManager); }, false); }
getHolderForClass
36,255
String () { return "GDK Method Holder for " + myClassName; }
toString
36,256
boolean (final PsiElement place, @NotNull String toolId) { return getElementToolSuppressedIn(place, toolId) != null; }
isElementToolSuppressedIn
36,257
PsiElement (final PsiElement place, @NotNull String toolId) { if (place == null) return null; if (GroovyUnusedDeclarationInspection.SHORT_NAME.equals(toolId)) { PsiElement forUnused = getElementToolSuppressedIn(place, UNUSED_SYMBOL_SHORT_NAME); if (forUnused != null) { return forUnused; } else { // fallback to checking for old toolId to avoid introducing warnings into old code } } return ReadAction.compute(()->{ final PsiElement statement = PsiUtil.findEnclosingStatement(place); if (statement != null) { PsiElement prev = statement.getPrevSibling(); while (prev != null && StringUtil.isEmpty(prev.getText().trim())) { prev = prev.getPrevSibling(); } if (prev instanceof PsiComment) { String text = prev.getText(); Matcher matcher = SuppressionUtil.SUPPRESS_IN_LINE_COMMENT_PATTERN.matcher(text); if (matcher.matches() && SuppressionUtil.isInspectionToolIdMentioned(matcher.group(1), toolId)) { return prev; } } } PsiElement fileLevelSuppression = SuppressByGroovyFileCommentFixKt.fileLevelSuppression(place, toolId); if (fileLevelSuppression != null) { return fileLevelSuppression; } GrMember member = null; GrDocComment docComment = PsiTreeUtil.getParentOfType(place, GrDocComment.class); if (docComment != null) { GrDocCommentOwner owner = docComment.getOwner(); if (owner instanceof GrMember) { member = (GrMember)owner; } } if (member == null) { member = PsiTreeUtil.getNonStrictParentOfType(place, GrMember.class); } while (member != null) { GrModifierList modifierList = member.getModifierList(); for (String ids : getInspectionIdsSuppressedInAnnotation(modifierList)) { if (SuppressionUtil.isInspectionToolIdMentioned(ids, toolId)) { return modifierList; } } member = PsiTreeUtil.getParentOfType(member, GrMember.class); } return null; }); }
getElementToolSuppressedIn
36,258
Collection<String> (final GrModifierList modifierList) { if (modifierList == null) { return Collections.emptyList(); } PsiAnnotation annotation = modifierList.findAnnotation(BatchSuppressManager.SUPPRESS_INSPECTIONS_ANNOTATION_NAME); if (annotation == null) { return Collections.emptyList(); } final GrAnnotationMemberValue attributeValue = (GrAnnotationMemberValue)annotation.findAttributeValue(null); Collection<String> result = new ArrayList<>(); if (attributeValue instanceof GrAnnotationArrayInitializer) { for (GrAnnotationMemberValue annotationMemberValue : ((GrAnnotationArrayInitializer)attributeValue).getInitializers()) { final String id = getInspectionIdSuppressedInAnnotationAttribute(annotationMemberValue); if (id != null) { result.add(id); } } } else { final String id = getInspectionIdSuppressedInAnnotationAttribute(attributeValue); if (id != null) { result.add(id); } } return result; }
getInspectionIdsSuppressedInAnnotation
36,259
String (GrAnnotationMemberValue element) { if (element instanceof GrLiteral) { final Object value = ((GrLiteral)element).getValue(); if (value instanceof String) { return (String)value; } } return null; }
getInspectionIdSuppressedInAnnotationAttribute
36,260
PsiElement (PsiElement context) { return PsiUtil.findEnclosingStatement(context); }
getContainer
36,261
boolean (@NotNull PsiElement element, @NotNull String name) { return GroovySuppressableInspectionTool.getElementToolSuppressedIn(element, name) != null; }
isSuppressedFor
36,262
String (Object... args) { return null; }
buildErrorString
36,263
boolean () { return false; }
buildQuickFixesOnlyForOnTheFlyErrors
36,264
OptPane () { OptPane pane = getGroovyOptionsPane(); return GrInspectionUIUtil.enhanceInspectionToolPanel(this, pane); }
getOptionsPane
36,265
OptionController () { return super.getOptionController().onPrefix( "fileType", GrInspectionUIUtil.getFileTypeController(explicitlyEnabledFileTypes)); }
getOptionController
36,266
OptPane () { return OptPane.EMPTY; }
getGroovyOptionsPane
36,267
LocalQuickFix (@NotNull PsiElement location) { return null; }
buildFix
36,268
PsiElementVisitor (@NotNull ProblemsHolder holder, boolean isOnTheFly, @NotNull LocalInspectionToolSession session) { BaseInspectionVisitor visitor = buildVisitor(); visitor.initialize(this, holder, isOnTheFly); return new GroovyPsiElementVisitor(visitor) { @Override public void visitElement(@NotNull PsiElement element) { if (GrInspectionUIUtil.checkInspectionEnabledByFileType(BaseInspection.this, element, explicitlyEnabledFileTypes)) { super.visitElement(element); } } }; }
buildVisitor
36,269
void (@NotNull PsiElement element) { if (GrInspectionUIUtil.checkInspectionEnabledByFileType(BaseInspection.this, element, explicitlyEnabledFileTypes)) { super.visitElement(element); } }
visitElement
36,270
String () { return GroovyBundle.message("inspection.bugs"); }
getProbableBugs
36,271
boolean (@NotNull GrExpression expression) { return "null".equals(expression.getText()); }
isNull
36,272
boolean (@NotNull GrBinaryExpression binaryCondition) { final IElementType tokenType = binaryCondition.getOperationTokenType(); return GroovyTokenTypes.mEQUAL == tokenType; }
isEquality
36,273
boolean (@NotNull GrBinaryExpression binaryCondition) { final IElementType tokenType = binaryCondition.getOperationTokenType(); return GroovyTokenTypes.mNOT_EQUAL == tokenType; }
isInequality
36,274
void (GrExpression expression, @NlsSafe String newExpression) { final GroovyPsiElementFactory factory = GroovyPsiElementFactory.getInstance(expression.getProject()); final GrExpression newCall = factory.createExpressionFromText(newExpression, expression.getContext()); expression.replaceWithExpression(newCall, true); }
replaceExpression
36,275
GroovyElementVisitor (@NotNull ProblemsHolder problemsHolder, boolean isOnTheFly) { return new GroovyElementVisitor() { @Override public void visitClosure(@NotNull GrClosableBlock closure) { check(closure, problemsHolder); } @Override public void visitLambdaBody(@NotNull GrLambdaBody body) { check(body, problemsHolder); } @Override public void visitMethod(@NotNull GrMethod method) { final GrOpenBlock block = method.getBlock(); if (block != null) { check(block, problemsHolder); } } @Override public void visitFile(@NotNull GroovyFileBase file) { check(file, problemsHolder); } @Override public void visitClassInitializer(@NotNull GrClassInitializer initializer) { check(initializer.getBlock(), problemsHolder); } }; }
buildGroovyVisitor
36,276
void (@NotNull GrClosableBlock closure) { check(closure, problemsHolder); }
visitClosure
36,277
void (@NotNull GrLambdaBody body) { check(body, problemsHolder); }
visitLambdaBody
36,278
void (@NotNull GrMethod method) { final GrOpenBlock block = method.getBlock(); if (block != null) { check(block, problemsHolder); } }
visitMethod
36,279
void (@NotNull GroovyFileBase file) { check(file, problemsHolder); }
visitFile
36,280
void (@NotNull GrClassInitializer initializer) { check(initializer.getBlock(), problemsHolder); }
visitClassInitializer
36,281
String () { throw new UnsupportedOperationException(); }
getFamilyName
36,282
void (@NotNull Project project, @NotNull ProblemDescriptor descriptor) { final PsiElement problemElement = descriptor.getPsiElement(); if (problemElement == null || !problemElement.isValid()) { return; } try { doFix(project, descriptor); } catch (IncorrectOperationException e) { final Class<? extends GroovyFix> aClass = getClass(); final String className = aClass.getName(); final Logger logger = Logger.getInstance(className); logger.error(e); } }
applyFix
36,283
void (GrStatement statement, @NonNls String newStatement) { final GroovyPsiElementFactory factory = GroovyPsiElementFactory.getInstance(statement.getProject()); final GrStatement newCall = (GrStatement)factory.createTopElementFromText(newStatement); statement.replaceWithStatement(newCall); }
replaceStatement
36,284
void (GrStatement statement, Object... args) { final PsiElement statementToken = statement.getFirstChild(); registerError(statementToken, args); }
registerStatementError
36,285
void (PsiElement location) { if (location == null) { return; } final LocalQuickFix[] fix = createFixes(location); String description = StringUtil.notNullize(inspection.buildErrorString(location)); registerError(location, description, fix, ProblemHighlightType.GENERIC_ERROR_OR_WARNING); }
registerError
36,286
void (GrMethod method, Object... args) { if (method == null) { return; } final LocalQuickFix[] fixes = createFixes(method); String description = StringUtil.notNullize(inspection.buildErrorString(args)); registerError(method.getNameIdentifierGroovy(), description, fixes, ProblemHighlightType.GENERIC_ERROR_OR_WARNING); }
registerMethodError
36,287
void (@NotNull PsiElement element, @NotNull TextRange range, Object... args) { String description = StringUtil.notNullize(inspection.buildErrorString(args)); problemsHolder.registerProblem(element, range, description, createFixes(element)); }
registerRangeError
36,288
void (GrVariable variable, Object... args) { if (variable == null) { return; } final LocalQuickFix[] fix = createFixes(variable); final String description = StringUtil.notNullize(inspection.buildErrorString(args)); registerError(variable.getNameIdentifierGroovy(), description, fix, ProblemHighlightType.GENERIC_ERROR_OR_WARNING); }
registerVariableError
36,289
void (GrMethodCall method, @NlsSafe Object... args) { if (method == null) { return; } final LocalQuickFix[] fixes = createFixes(method); final String description = StringUtil.notNullize(inspection.buildErrorString(args)); final GrExpression invoked = method.getInvokedExpression(); final PsiElement nameElement = ((GrReferenceExpression)invoked).getReferenceNameElement(); assert nameElement != null; registerError(nameElement, description, fixes, ProblemHighlightType.GENERIC_ERROR_OR_WARNING); }
registerMethodCallError
36,290
void (@NotNull PsiElement location, @InspectionMessage @NotNull String description, @NotNull LocalQuickFix @Nullable [] fixes, ProblemHighlightType highlightType) { problemsHolder.registerProblem(location, description, highlightType, fixes); }
registerError
36,291
void (@NotNull PsiElement location, Object... args) { registerError(location, ProblemHighlightType.GENERIC_ERROR_OR_WARNING, args); }
registerError
36,292
void (@NotNull PsiElement location, ProblemHighlightType highlightType, Object... args) { final LocalQuickFix[] fix = createFixes(location); final String description = StringUtil.notNullize(inspection.buildErrorString(args)); registerError(location, description, fix, highlightType); }
registerError
36,293
int () { return problemsHolder.getResultCount(); }
getErrorCount
36,294
GrDocCommentOwner (final PsiElement context) { if (context == null || context instanceof PsiFile) { return null; } GrDocCommentOwner container = null; GrDocComment docComment = PsiTreeUtil.getParentOfType(context, GrDocComment.class); if (docComment != null) { container = docComment.getOwner(); } if (container == null) { container = PsiTreeUtil.getParentOfType(context, GrDocCommentOwner.class); } while (container instanceof GrAnonymousClassDefinition || container instanceof GrTypeParameter) { container = PsiTreeUtil.getParentOfType(container, GrDocCommentOwner.class); if (container == null) return null; } if (myForClass) { while (container != null) { final GrTypeDefinition parentClass = PsiTreeUtil.getParentOfType(container, GrTypeDefinition.class); if (parentClass == null && container instanceof GrTypeDefinition) { return container; } container = parentClass; } } return container; }
getContainer
36,295
String () { return JavaAnalysisBundle.message(myKey); }
getText
36,296
boolean (@NotNull final Project project, @NotNull final PsiElement context) { final GrDocCommentOwner container = getContainer(context); myKey = container instanceof PsiClass ? "suppress.inspection.class" : container instanceof PsiMethod ? "suppress.inspection.method" : "suppress.inspection.field"; return container != null && context.getManager().isInProject(context.getContainingFile().getOriginalFile()); }
isAvailable
36,297
boolean (@NotNull PsiElement container) { return false; }
replaceSuppressionComments
36,298
GroovyQuickFixFactory () { return ApplicationManager.getApplication().getService(GroovyQuickFixFactory.class); }
getInstance
36,299
boolean (@NotNull GrExpression exp) { if (!(exp instanceof GrUnaryExpression prefixExp)) { return false; } final IElementType sign = prefixExp.getOperationTokenType(); return GroovyTokenTypes.mBNOT.equals(sign); }
isNegation