Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
63,500
void (@NotNull Project project, @NotNull ProblemDescriptor descriptor) { super.applyFix(project, descriptor); myElement.setStringValue(Extensions.DEFAULT_PREFIX); }
applyFix
63,501
void (Extensions.UnresolvedExtension unresolvedExtension, DomElementAnnotationHolder holder) { final Module module = unresolvedExtension.getModule(); if (module == null) return; final Extensions extensions = unresolvedExtension.getParentOfType(Extensions.class, true); assert extensions != null; String qualifiedExtensio...
annotateUnresolvedExtension
63,502
void (@NotNull Project project, @NotNull ProblemDescriptor descriptor) { DomElement domElement = DomUtil.getDomElement(descriptor.getPsiElement()); if (domElement == null) return; final IdeaPlugin ideaPlugin = domElement.getParentOfType(IdeaPlugin.class, true); assert ideaPlugin != null; final Dependency dependency = i...
applyFix
63,503
void (IdeaVersion ideaVersion, DomElementAnnotationHolder holder) { //noinspection deprecation highlightAttributeNotUsedAnymore(ideaVersion.getMin(), holder); //noinspection deprecation highlightAttributeNotUsedAnymore(ideaVersion.getMax(), holder); highlightUntilBuild(ideaVersion, holder); GenericAttributeValue<BuildN...
annotateIdeaVersion
63,504
void (IdeaVersion ideaVersion, DomElementAnnotationHolder holder) { String untilBuild = ideaVersion.getUntilBuild().getStringValue(); if (untilBuild != null && isStarSupported(ideaVersion.getSinceBuild().getStringValue())) { Matcher matcher = PluginManager.EXPLICIT_BIG_NUMBER_PATTERN.matcher(untilBuild); if (matcher.ma...
highlightUntilBuild
63,505
boolean (String buildNumber) { if (buildNumber == null) return false; Matcher matcher = Holder.BASE_LINE_EXTRACTOR.matcher(buildNumber); if (matcher.matches()) { int branch = Integer.parseInt(matcher.group(1)); return branch >= FIRST_BRANCH_SUPPORTING_STAR; } return false; }
isStarSupported
63,506
void (Extension extension, DomElementAnnotationHolder holder, ComponentModuleRegistrationChecker componentModuleRegistrationChecker) { final ExtensionPoint extensionPoint = extension.getExtensionPoint(); if (extensionPoint == null) return; final Module module = extension.getModule(); final String effectiveQualifiedName...
annotateExtension
63,507
void (DomElementAnnotationHolder holder, Extension extension, ExtensionPoint extensionPoint, String effectiveQualifiedName, @Nullable Module module) { final ExtensionPoint.Status status = extensionPoint.getExtensionPointStatus(); ExtensionPoint.Status.Kind kind = status.getKind(); if (kind == ExtensionPoint.Status.Kind...
annotateExtensionPointStatus
63,508
void (DomElementAnnotationHolder holder, Extension extension, String effectiveQualifiedName, @Nullable Module module) { if (IdeErrorsDialog.ERROR_HANDLER_EP.getName().equals(effectiveQualifiedName)) { String implementation = extension.getXmlTag().getAttributeValue("implementation"); if (ITNReporter.class.getName().equa...
annotateErrorHandler
63,509
void (DomElementAnnotationHolder holder, Extension extension, DomAttributeChildDescription<?> attributeDescription, GenericAttributeValue<?> attributeValue, @Nullable Module module) { final PsiElement declaration = attributeDescription.getDeclaration(extension.getManager().getProject()); if (declaration instanceof PsiF...
annotateReferencedFieldStatus
63,510
void (Component component, DomElementAnnotationHolder holder, ComponentModuleRegistrationChecker componentModuleRegistrationChecker) { Module module = component.getModule(); GenericDomValue<PsiClass> implementationClassElement = component.getImplementationClass(); PsiClass implementationClass = implementationClassEleme...
annotateComponent
63,511
void (Vendor vendor, DomElementAnnotationHolder holder) { //noinspection deprecation highlightAttributeNotUsedAnymore(vendor.getLogo(), holder); checkTemplateText(vendor, "YourCompany", holder); checkMaxLength(vendor, 255, holder); //noinspection HttpUrlsUsage checkTemplateText(vendor.getUrl(), "http://www.yourcompany....
annotateVendor
63,512
void (ProductDescriptor productDescriptor, DomElementAnnotationHolder holder) { checkMaxLength(productDescriptor.getCode(), 15, holder); String releaseDate = productDescriptor.getReleaseDate().getValue(); if (releaseDate != null && !isPlaceHolder(releaseDate)) { try { SimpleDateFormat dateFormat = new SimpleDateFormat(...
annotateProductDescriptor
63,513
boolean (@Nullable String value) { return value != null && value.length() > 4 && value.startsWith("__") && value.endsWith("__"); }
isPlaceHolder
63,514
void (AddToGroup addToGroup, DomElementAnnotationHolder holder) { if (!DomUtil.hasXml(addToGroup.getRelativeToAction())) return; if (!DomUtil.hasXml(addToGroup.getAnchor())) { holder.createProblem(addToGroup, DevKitBundle.message("inspections.plugin.xml.anchor.must.have.relative-to-action"), new AddDomElementQuickFix<>...
annotateAddToGroup
63,515
void (Group group, DomElementAnnotationHolder holder) { final GenericAttributeValue<String> iconAttribute = group.getIcon(); if (DomUtil.hasXml(iconAttribute)) { annotateResolveProblems(holder, iconAttribute); } GenericAttributeValue<PsiClass> clazz = group.getClazz(); if (DomUtil.hasXml(clazz) && !DomUtil.hasXml(group...
annotateGroup
63,516
void (Action action, DomElementAnnotationHolder holder, ComponentModuleRegistrationChecker componentModuleRegistrationChecker) { final GenericAttributeValue<String> iconAttribute = action.getIcon(); if (DomUtil.hasXml(iconAttribute)) { annotateResolveProblems(holder, iconAttribute); } Module module = action.getModule()...
annotateAction
63,517
void (Synonym synonym, DomElementAnnotationHolder holder) { boolean hasKey = DomUtil.hasXml(synonym.getKey()); boolean hasText = DomUtil.hasXml(synonym.getText()); if (!hasKey && !hasText) { holder.createProblem(synonym, ProblemHighlightType.GENERIC_ERROR, DevKitBundle.message("inspections.plugin.xml.synonym.missing.ke...
annotateSynonym
63,518
void (Component.Project projectComponent, DomElementAnnotationHolder holder) { //noinspection deprecation GenericDomValue<Boolean> skipForDefault = projectComponent.getSkipForDefaultProject(); if (skipForDefault.exists()) { highlightDeprecated(skipForDefault, DevKitBundle.message("inspections.plugin.xml.skipForDefaultP...
annotateProjectComponent
63,519
void (DomElementAnnotationHolder holder, GenericAttributeValue<?> attributeValue) { String orderValue = attributeValue.getStringValue(); if (StringUtil.isEmpty(orderValue)) { return; } try { LoadingOrder.readOrder(orderValue); } catch (AssertionError ignore) { holder.createProblem(attributeValue, HighlightSeverity.ERRO...
annotateOrderAttributeProblems
63,520
void (DomElementAnnotationHolder holder, GenericAttributeValue<?> attributeValue) { final XmlAttributeValue value = attributeValue.getXmlAttributeValue(); if (value != null) { for (PsiReference reference : value.getReferences()) { if (reference.resolve() == null) { holder.createResolveProblem(attributeValue, reference)...
annotateResolveProblems
63,521
void (DomElement element, @InspectionMessage String message, DomElementAnnotationHolder holder) { highlightRedundant(element, message, ProblemHighlightType.GENERIC_ERROR_OR_WARNING, holder); }
highlightRedundant
63,522
void (GenericAttributeValue<?> attributeValue, DomElementAnnotationHolder holder) { if (!DomUtil.hasXml(attributeValue)) return; highlightDeprecated(attributeValue, DevKitBundle.message("inspections.plugin.xml.attribute.not.used.anymore", attributeValue.getXmlElementName()), holder, true, true); }
highlightAttributeNotUsedAnymore
63,523
void (DomElement element, @InspectionMessage String message, DomElementAnnotationHolder holder, boolean useRemoveQuickfix, boolean highlightWholeElement) { doHighlightDeprecatedElement(element, message, holder, useRemoveQuickfix, highlightWholeElement, false); }
highlightDeprecated
63,524
void (DomElement element, @InspectionMessage String message, DomElementAnnotationHolder holder, boolean highlightWholeElement) { doHighlightDeprecatedElement(element, message, holder, false, highlightWholeElement, true); }
highlightDeprecatedMarkedForRemoval
63,525
void (DomElement element, @InspectionMessage String message, DomElementAnnotationHolder holder, boolean useRemoveQuickfix, boolean highlightWholeElement, boolean forRemoval) { DomElementProblemDescriptor problem; ProblemHighlightType problemHighlightType = forRemoval ? ProblemHighlightType.LIKE_MARKED_FOR_REMOVAL : Pro...
doHighlightDeprecatedElement
63,526
void (DomElement element, DomElementAnnotationHolder holder) { holder.createProblem(element, ProblemHighlightType.WARNING, DevKitBundle.message("inspections.plugin.xml.jetbrains.only.api", ApiStatus.Experimental.class.getCanonicalName()), null) .highlightWholeElement(); }
highlightJetbrainsOnly
63,527
void (DomElement element, DomElementAnnotationHolder holder) { holder.createProblem(element, ProblemHighlightType.WARNING, DevKitBundle.message("inspections.plugin.xml.usage.of.experimental.api", ApiStatus.Experimental.class.getCanonicalName()), null) .highlightWholeElement(); }
highlightExperimental
63,528
void (DomElement element, DomElementAnnotationHolder holder) { holder.createProblem(element, ProblemHighlightType.WARNING, DevKitBundle.message("inspections.plugin.xml.usage.of.internal.api", ApiStatus.Internal.class.getCanonicalName()), null) .highlightWholeElement(); }
highlightInternal
63,529
void (DomElement element, DomElementAnnotationHolder holder) { holder.createProblem(element, ProblemHighlightType.LIKE_DEPRECATED, DevKitBundle.message("inspections.plugin.xml.usage.of.obsolete.api", ApiStatus.Obsolete.class.getCanonicalName()), null) .highlightWholeElement(); }
highlightObsolete
63,530
void (GenericDomValue<String> domValue, @NonNls String templateText, DomElementAnnotationHolder holder) { if (templateText.equals(domValue.getValue())) { holder.createProblem(domValue, DevKitBundle.message("inspections.plugin.xml.do.not.use.template.text", templateText)); } }
checkTemplateText
63,531
void (GenericDomValue<String> domValue, @NonNls String containsText, DomElementAnnotationHolder holder) { String text = domValue.getStringValue(); if (text != null && StringUtil.containsIgnoreCase(text, containsText)) { holder.createProblem(domValue, DevKitBundle.message("inspections.plugin.xml.must.not.contain.templat...
checkTemplateTextContains
63,532
void (GenericDomValue<String> domValue, DomElementAnnotationHolder holder, @NonNls String... templateWords) { String text = domValue.getStringValue(); if (text == null) return; for (String word : StringUtil.getWordsIn(text)) { for (String templateWord : templateWords) { if (StringUtil.equalsIgnoreCase(word, templateWor...
checkTemplateTextContainsWord
63,533
void (GenericDomValue<String> domValue, int maxLength, DomElementAnnotationHolder holder) { String value = domValue.getStringValue(); if (value != null && value.length() > maxLength) { holder.createProblem(domValue, DevKitBundle.message("inspections.plugin.xml.value.exceeds.max.length", maxLength)); } }
checkMaxLength
63,534
void (GenericDomValue<String> domValue, DomElementAnnotationHolder holder) { if (!DomUtil.hasXml(domValue)) return; String value = StringUtil.removeHtmlTags(StringUtil.notNullize(domValue.getStringValue())); value = StringUtil.replace(value, CommonXmlStrings.CDATA_START, ""); value = StringUtil.replace(value, CommonXml...
checkHasRealText
63,535
String () { return DevKitBundle.message("inspections.plugin.xml.change.until.build.name", myCorrectValue); }
getName
63,536
String () { return DevKitBundle.message("inspections.plugin.xml.change.until.build.family.name"); }
getFamilyName
63,537
void (@NotNull Project project, @NotNull ProblemDescriptor descriptor) { final XmlAttribute attribute = PsiTreeUtil.getParentOfType(descriptor.getPsiElement(), XmlAttribute.class, false); GenericAttributeValue<?> domElement = DomManager.getDomManager(project).getDomElement(attribute); LOG.assertTrue(domElement != null)...
applyFix
63,538
String () { return myFamilyName; }
getFamilyName
63,539
void (@NotNull Project project, @NotNull ProblemDescriptor descriptor) { PsiFile file = descriptor.getPsiElement().getContainingFile(); IdeaPlugin root = DescriptorUtil.getIdeaPlugin((XmlFile)file); if (root == null) return; XmlTag rootTag = root.getXmlTag(); if (rootTag == null) return; XmlTag after = getLastSubTag(ro...
applyFix
63,540
XmlTag (@NotNull XmlTag rootTag, DomElement... children) { Set<XmlTag> childrenTags = new HashSet<>(); for (DomElement child : children) { if (child != null) { childrenTags.add(child.getXmlTag()); } } XmlTag[] subTags = rootTag.getSubTags(); for (int i = subTags.length - 1; i >= 0; i--) { if (childrenTags.contains(subT...
getLastSubTag
63,541
void (DomElement element) { element.acceptChildren(this); if (!declarationBeforeComponentFound && element instanceof Component checkedComponent && isFirstDuplicateDeclaration(checkedComponent)) { declarationBeforeComponentFound = true; } }
visitDomElement
63,542
boolean (Component checkedComponent) { if (checkedComponent == component) return false; XmlElement element = checkedComponent.getXmlElement(); if (element != null && element.getTextOffset() >= componentTextOffset) return false; // do not check after component's offset if (componentLevelsEqual(component, checkedComponen...
isFirstDuplicateDeclaration
63,543
boolean (Component component, Component checkedComponent) { return (component instanceof Component.Application && checkedComponent instanceof Component.Application) || (component instanceof Component.Project && checkedComponent instanceof Component.Project) || (component instanceof Component.Module && checkedComponent ...
componentLevelsEqual
63,544
String (Component component) { return component.getOptions().stream() .filter(option -> "type".equals(option.getName().getValue())) .map(Option::getValue) .map(GenericValue::getValue) .filter(Objects::nonNull) .findFirst() .orElse(null); }
getComponentType
63,545
boolean (PsiClass epClass) { return isAnyPathMethodOverridden(epClass); }
skipIfNotRegistered
63,546
boolean (ProblemsHolder holder, Module module, PsiClass psiClass) { final InspectionDescriptionInfo info = InspectionDescriptionInfo.create(module, psiClass); return info.isValid() && info.hasDescriptionFile(); }
checkDynamicDescription
63,547
boolean (PsiClass psiClass) { return !(isLastMethodDefinitionIn("getStaticDescription", psiClass) && isLastMethodDefinitionIn("getDescriptionContextClass", psiClass) && isLastMethodDefinitionIn("getDescriptionFileName", psiClass)); }
isAnyPathMethodOverridden
63,548
boolean (@NotNull String methodName, @Nullable PsiClass psiClass) { if (psiClass == null) return false; for (PsiMethod method : psiClass.findMethodsByName(methodName, false)) { final PsiClass containingClass = method.getContainingClass(); if (containingClass == null) return false; return INSPECTION_PROFILE_ENTRY.equals...
isLastMethodDefinitionIn
63,549
PsiElementVisitor (@NotNull ProblemsHolder holder, boolean isOnTheFly) { if (!DevKitInspectionUtil.isAllowed(holder.getFile())) { return PsiElementVisitor.EMPTY_VISITOR; } return UastHintedVisitorAdapter.create(holder.getFile().getLanguage(), new AbstractUastNonRecursiveVisitor() { @Override public boolean visitLiteral...
buildVisitor
63,550
boolean (@NotNull ULiteralExpression uLiteralExpression) { visit(uLiteralExpression); return super.visitExpression(uLiteralExpression); }
visitLiteralExpression
63,551
void (ULiteralExpression uLiteralExpression) { PsiElement element = uLiteralExpression.getSourcePsi(); PsiLanguageInjectionHost expression = UastLiteralUtils.getSourceInjectionHost(uLiteralExpression); if (element == null || expression == null) return; for (PsiReference reference : expression.getReferences()) { if (ref...
visit
63,552
Set<PsiClass> (@NotNull PsiClass psiClass, @NotNull RegistrationType registrationType) { final Project project = psiClass.getProject(); final PsiFile psiFile = psiClass.getContainingFile(); assert psiFile != null; final VirtualFile virtualFile = psiFile.getVirtualFile(); if (virtualFile == null) return null; final Modu...
getRegistrationTypes
63,553
Set<PsiClass> (Project project, RegistrationTypeFinder finder) { finder.processScope(GlobalSearchScopesCore.projectProductionScope(project)); return finder.getTypes(); }
checkIdeaProject
63,554
Set<PsiClass> (Module module, RegistrationTypeFinder finder) { final DomFileElement<IdeaPlugin> pluginXml = getPluginXmlFile(module); if (pluginXml == null) { return null; } // "main" plugin.xml XmlFile pluginXmlFile = pluginXml.getFile(); if (!finder.processScope(GlobalSearchScope.fileScope(pluginXmlFile))) { return f...
checkModule
63,555
DomFileElement<IdeaPlugin> (Module module) { XmlFile pluginXml = PluginModuleType.getPluginXml(module); if (pluginXml == null) { return null; } return DescriptorUtil.getIdeaPluginFileElement(pluginXml); }
getPluginXmlFile
63,556
boolean (GlobalSearchScope scope) { final boolean findAll = myRegistrationType == RegistrationType.ALL; final boolean allComponents = findAll || myRegistrationType == RegistrationType.ALL_COMPONENTS; if (allComponents || myRegistrationType == RegistrationType.APPLICATION_COMPONENT) { if (IdeaPluginRegistrationIndex.isR...
processScope
63,557
void (String fqn) { final PsiClass psiClass = JavaPsiFacade.getInstance(myPsiClass.getProject()) .findClass(fqn, myPsiClass.getResolveScope()); ContainerUtil.addIfNotNull(myTypes, psiClass); }
addType
63,558
Set<PsiClass> () { return myTypes.isEmpty() ? null : myTypes; }
getTypes
63,559
boolean (@NotNull PsiClass psiClass) { if (psiClass instanceof PsiAnonymousClass) return false; return DevKitImplicitUsageProvider.isDomElementClass(psiClass); }
isApplicableTo
63,560
SubclassingInfo (@NotNull PsiClass psiClass) { if (DevKitImplicitUsageProvider.isDomElementClass(psiClass)) { return new SubclassingInfo(DevKitBundle.message("implemented.at.runtime.dom")); } return null; }
getSubclassingInfo
63,561
PsiElementVisitor (@NotNull ProblemsHolder holder, boolean isOnTheFly) { if (!DevKitInspectionUtil.isAllowed(holder.getFile())) return PsiElementVisitor.EMPTY_VISITOR; if (!DevKitInspectionUtil.isClassAvailable(holder, PsiElementFactory.class.getName())) { return PsiElementVisitor.EMPTY_VISITOR; } return new JavaElemen...
buildVisitor
63,562
void (@NotNull PsiMethodCallExpression call) { String methodName = call.getMethodExpression().getReferenceName(); if (methodName == null || !methodName.startsWith("create")) return; PsiExpression[] args = call.getArgumentList().getExpressions(); if (args.length == 0) return; PsiExpression arg = args[0]; PsiType argType...
visitMethodCallExpression
63,563
void (@Nullable PsiExpression operand, Set<PsiExpression> visited) { if (operand == null || !visited.add(operand)) return; if (operand instanceof PsiReferenceExpression) { PsiElement element = ((PsiReferenceExpression)operand).resolve(); if (element instanceof PsiLocalVariable && ((PsiLocalVariable)element).getType().e...
checkOperand
63,564
String () { return DevKitBundle.message("inspections.psi.element.concat.add.get.text.name", myMethodName); }
getName
63,565
String () { return DevKitBundle.message("inspections.psi.element.concat.add.get.text.family.name"); }
getFamilyName
63,566
void (@NotNull Project project, @NotNull ProblemDescriptor descriptor) { PsiElement element = descriptor.getStartElement(); if (!(element instanceof PsiExpression expression)) return; PsiElementFactory factory = JavaPsiFacade.getElementFactory(project); PsiExpression replacement = factory.createExpressionFromText(Paren...
applyFix
63,567
void (@NotNull DomElement element, @NotNull DomElementAnnotationHolder holder, @NotNull DomHighlightingHelper helper) { if (!(element instanceof Extension extension)) { return; } if (!isAllowed(holder)) return; ExtensionPoint extensionPoint = extension.getExtensionPoint(); if (extensionPoint == null) { return; } String...
checkDomElement
63,568
void (DomElement element, DomElementAnnotationHolder holder) { IdeaPlugin plugin = DomUtil.getParentOfType(element, IdeaPlugin.class, true); if (plugin != null && !DomUtil.hasXml(plugin.getResourceBundle())) { holder.createProblem(element, DevKitBundle.message("inspections.inspection.mapping.consistency.specify.bundle"...
checkDefaultBundle
63,569
void (DomElement element, DomElementAnnotationHolder holder, @InspectionMessage String message, @NonNls String... attributeNames) { if (holder.isOnTheFly()) { holder.createProblem(element, message, ContainerUtil.map(attributeNames, attributeName -> { return new DefineAttributeQuickFix(attributeName); }, new LocalQuickF...
registerDefineAttributeProblem
63,570
boolean (ExtensionPoint extensionPoint) { final String extensionBeanClass = extensionPoint.getBeanClass().getStringValue(); return PsiReferenceContributorEP.class.getName().equals(extensionBeanClass) || PsiReferenceProviderBean.class.getName().equals(extensionBeanClass) || IntentionActionBean.class.getName().equals(ext...
isExtensionPointWithLanguage
63,571
String () { return DevKitBundle.message("inspection.plugin.xml.extension.registration.should.define.language.tag.family.name"); }
getFamilyName
63,572
void (@NotNull Project project, @NotNull ProblemDescriptor descriptor) { Extension fixExtension = DomUtil.findDomElement(descriptor.getPsiElement(), Extension.class, false); if (fixExtension == null) return; XmlTag xmlTag = fixExtension.getXmlTag(); XmlTag languageTag = xmlTag.createChildTag("language", null, myAnyLang...
applyFix
63,573
PsiElementVisitor (@NotNull ProblemsHolder holder, boolean isOnTheFly) { @SuppressWarnings("unchecked") Class<? extends UElement>[] hint = new Class[]{UMethod.class, ULambdaExpression.class}; return UastHintedVisitorAdapter.create(holder.getFile().getLanguage(), new MissingAccessibleContextVisitor(holder), hint); }
buildInternalVisitor
63,574
boolean (@NotNull ULambdaExpression lambda) { List<UParameter> parameters = lambda.getValueParameters(); if (parameters.size() == 5 || parameters.size() == 6) { PsiClass lambdaClass = PsiUtil.resolveClassInClassTypeOnly(lambda.getFunctionalInterfaceType()); if (lambdaClass != null) { String qualifiedName = lambdaClass....
visitLambdaExpression
63,575
boolean (@NotNull UMethod method) { if (method.getName().equals("getListCellRendererComponent") || method.getName().equals("getTableCellRendererComponent")) { PsiMethod psi = method.getJavaPsi(); PsiMethod[] methods = psi.findDeepestSuperMethods(); if (methods.length == 1) { PsiClass aClass = methods[0].getContainingCl...
visitMethod
63,576
void (@Nullable UExpression body, UElement context) { if (body == null) return; List<PsiElement> anchors = new ArrayList<>(); for (UExpression expression : findReturnedExpressions(body, context)) { PsiClass panelClass = findReturnedClass(expression); if (panelClass == null || hasRedefinedContext(panelClass)) continue; ...
processBody
63,577
boolean (UExpression body) { var visitor = new AbstractUastVisitor() { boolean myHasAccessibilityMethodCall = false; private static boolean isAccessibilityMethod(@NotNull UCallExpression call) { if (call.isMethodNameOneOf(List.of("setAccessibleName", "setAccessibleDescription"))) { return true; } PsiMethod target = cal...
hasAccessibilityMethodCalls
63,578
boolean (@NotNull UCallExpression call) { if (call.isMethodNameOneOf(List.of("setAccessibleName", "setAccessibleDescription"))) { return true; } PsiMethod target = call.resolve(); if (target != null) { PsiClass aClass = target.getContainingClass(); if (aClass != null && "com.intellij.util.ui.accessibility.AccessibleCon...
isAccessibilityMethod
63,579
boolean (@NotNull UCallExpression call) { if (isAccessibilityMethod(call)) { myHasAccessibilityMethodCall = true; return false; } return true; }
visitCallExpression
63,580
Set<UExpression> (@NotNull UExpression body, @NotNull UElement context) { Queue<UExpression> workList = findDirectExpressions(body, context); Set<UExpression> processed = new HashSet<>(); Set<UExpression> leafs = new HashSet<>(); while (!workList.isEmpty() && processed.size() < MAX_EXPRESSIONS_TO_PROCESS) { UExpression...
findReturnedExpressions
63,581
Queue<UExpression> (@NotNull UExpression body, @NotNull UElement context) { Queue<UExpression> direct = new ArrayDeque<>(); if (body instanceof UBlockExpression) { body.accept(new AbstractUastVisitor() { @Override public boolean visitReturnExpression(@NotNull UReturnExpression node) { if (context.equals(node.getJumpTar...
findDirectExpressions
63,582
boolean (@NotNull UReturnExpression node) { if (context.equals(node.getJumpTarget())) { ContainerUtil.addIfNotNull(direct, node.getReturnExpression()); } return true; }
visitReturnExpression
63,583
boolean (PsiClass panelClass) { MethodSignature signature = MethodSignatureUtil .createMethodSignature("getAccessibleContext", PsiType.EMPTY_ARRAY, PsiTypeParameter.EMPTY_ARRAY, PsiSubstitutor.EMPTY); PsiMethod found = MethodSignatureUtil.findMethodBySignature(panelClass, signature, true); if (found != null) { PsiClass...
hasRedefinedContext
63,584
PsiClass (UExpression result) { PsiClass panelClass = null; if (result instanceof UObjectLiteralExpression) { panelClass = ((UObjectLiteralExpression)result).getDeclaration().getJavaPsi(); } else if (result instanceof UCallExpression call) { if (call.getKind() == UastCallKind.CONSTRUCTOR_CALL) { UReferenceExpression re...
findReturnedClass
63,585
PsiElementVisitor (@NotNull final ProblemsHolder holder, boolean isOnTheFly) { return UastHintedVisitorAdapter.create(holder.getFile().getLanguage(), new AbstractUastNonRecursiveVisitor() { @Override public boolean visitCallExpression(@NotNull UCallExpression expression) { if (isAwtColorConstructor(expression) && isJBC...
buildInternalVisitor
63,586
boolean (@NotNull UCallExpression expression) { if (isAwtColorConstructor(expression) && isJBColorClassAccessible(holder) && !isUsedAsJBColorConstructorParameter(expression)) { PsiElement sourcePsi = expression.getSourcePsi(); if (sourcePsi != null) { LocalQuickFix[] fixes = sourcePsi.getLanguage().is(JavaLanguage.INST...
visitCallExpression
63,587
boolean (@NotNull UCallExpression constructorCall) { return isColorTypeConstructor(constructorCall, AWT_COLOR_CLASS_NAME); }
isAwtColorConstructor
63,588
boolean (@NotNull UCallExpression call, @NotNull String colorClassName) { PsiMethod constructor = call.resolve(); if (constructor == null || !constructor.isConstructor()) return false; PsiClass constructorClass = constructor.getContainingClass(); if (constructorClass == null) return false; return colorClassName.equals(...
isColorTypeConstructor
63,589
boolean (@NotNull ProblemsHolder holder) { return DevKitInspectionUtil.isClassAvailable(holder, JB_COLOR_CLASS_NAME); }
isJBColorClassAccessible
63,590
boolean (@NotNull UExpression expression) { UCallExpression containingCall = UastContextKt.getUastParentOfType(expression.getSourcePsi(), UCallExpression.class, true); return containingCall != null && isJBColorConstructor(containingCall); }
isUsedAsJBColorConstructorParameter
63,591
boolean (@NotNull UCallExpression call) { return isColorTypeConstructor(call, JB_COLOR_CLASS_NAME); }
isJBColorConstructor
63,592
boolean (@NotNull UQualifiedReferenceExpression node) { if (!(node.getUastParent() instanceof UImportStatement)) { inspectExpression(node); } return super.visitQualifiedReferenceExpression(node); }
visitQualifiedReferenceExpression
63,593
boolean (@NotNull USimpleNameReferenceExpression node) { inspectExpression(node); return super.visitSimpleNameReferenceExpression(node); }
visitSimpleNameReferenceExpression
63,594
void (@NotNull UReferenceExpression expression) { if (isAwtColorConstantReference(expression) && isJBColorClassAccessible(holder) && !isUsedAsJBColorConstructorParameter(expression)) { PsiElement sourcePsi = expression.getSourcePsi(); if (sourcePsi != null) { holder.registerProblem(sourcePsi, DevKitBundle.message("insp...
inspectExpression
63,595
boolean (@NotNull UReferenceExpression expression) { // avoid double warning for qualified and simple reference in Kotlin: if (expression.getUastParent() instanceof UQualifiedReferenceExpression) return false; PsiElement colorField = expression.resolve(); if (colorField instanceof PsiField && ((PsiField)colorField).has...
isAwtColorConstantReference
63,596
void (@NotNull Project project, @NotNull ProblemDescriptor descriptor) { PsiElement element = descriptor.getPsiElement(); UReferenceExpression awtColorConstantReference = getReferenceExpression(element); if (awtColorConstantReference == null) return; UastCodeGenerationPlugin generationPlugin = UastCodeGenerationPlugin....
applyFix
63,597
UReferenceExpression (PsiElement element) { UReferenceExpression expression = UastContextKt.toUElement(element, UQualifiedReferenceExpression.class); if (expression == null) { expression = UastContextKt.toUElement(element, USimpleNameReferenceExpression.class); } return expression; }
getReferenceExpression
63,598
void (@NotNull Project project, @NotNull ProblemDescriptor descriptor) { final PsiElement element = descriptor.getPsiElement(); final PsiElementFactory factory = JavaPsiFacade.getInstance(project).getElementFactory(); final String newJBColor = String.format("new %s(%s, new java.awt.Color())", JBColor.class.getName(), e...
applyFix
63,599
boolean (@NotNull ProblemsHolder holder) { return super.isAllowed(holder) && DevKitInspectionUtil.isClassAvailable(holder, BASE_VISITOR_NAME); }
isAllowed