Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
76,000
String () { return getText(); }
getFamilyName
76,001
void (@NotNull Project project, @NotNull CommonProblemDescriptor descriptor) { invoke(project, null, null); }
applyFix
76,002
boolean (@NotNull final Project project, final Editor editor, final PsiFile file) { return myModuleName != null; }
isAvailable
76,003
IntentionPreviewInfo (@NotNull Project project, @NotNull Editor editor, @NotNull PsiFile file) { return new IntentionPreviewInfo.Html(JavaBundle.message("open.settings.dialog.for.module.preview.text", myModuleName)); }
generatePreview
76,004
boolean () { return false; }
startInWriteAction
76,005
ModCommand (@NotNull ActionContext context) { PsiInstanceOfExpression instanceOfExpression = getInstanceOfExpressionAtCaret(context.file(), context.offset()); if (instanceOfExpression == null) return ModCommand.nop(); return ModCommand.psiUpdate(instanceOfExpression, (expr, updater) -> invoke(context, expr, updater)); ...
perform
76,006
void (@NotNull ActionContext context, @NotNull PsiInstanceOfExpression instanceOfExpression, @NotNull ModPsiUpdater updater) { PsiElement decl = createAndInsertCast(context.offset(), instanceOfExpression); if (decl == null) return; decl = CodeInsightUtilCore.forcePsiPostprocessAndRestoreElement(decl); if (decl == null)...
invoke
76,007
String () { return JavaBundle.message("cast.expression"); }
getFamilyName
76,008
String () { return QuickFixBundle.message("remove.qualifier.fix"); }
getFamilyName
76,009
void (@NotNull ActionContext context, @NotNull PsiNewExpression expression, @NotNull ModPsiUpdater updater) { PsiJavaCodeReferenceElement classReference = expression.getClassReference(); PsiExpression qualifier = expression.getQualifier(); if (qualifier != null) { qualifier.delete(); } if (aClass != null && classRefere...
invoke
76,010
String () { return QuickFixBundle.message("collection.to.array.family.name"); }
getFamilyName
76,011
void (@NotNull ActionContext context, @NotNull PsiExpression expressionToReplace, @NotNull ModPsiUpdater updater) { PsiElementFactory factory = JavaPsiFacade.getElementFactory(context.project()); PsiExpression collectionExpression = myCollectionPointer.getElement(); if (collectionExpression == null) return; String repl...
invoke
76,012
String (PsiType componentType) { if (componentType instanceof PsiArrayType arrayType) { return getArrayTypeText(arrayType.getComponentType()) + "[]"; } if (componentType instanceof PsiClassType classType) { return classType.rawType().getCanonicalText() + "[0]"; } return componentType.getCanonicalText() + "[0]"; }
getArrayTypeText
76,013
String () { return QuickFixBundle.message("insert.super.constructor.call.family"); }
getFamilyName
76,014
void (@NotNull ActionContext context, @NotNull PsiMethod constructor, @NotNull ModPsiUpdater updater) { PsiStatement superCall = JavaPsiFacade.getElementFactory(context.project()).createStatementFromText(myCall,null); PsiCodeBlock body = Objects.requireNonNull(constructor.getBody()); PsiJavaToken lBrace = body.getLBrac...
invoke
76,015
void (@NotNull ActionContext context, @NotNull PsiClass subclass, @NotNull ModPsiUpdater updater) { PsiClass parentClass = myParentClassPointer.getElement(); if (parentClass == null) return; PsiElement e = implementOrExtend(parentClass, subclass); if (myExternal && e != null) { updater.moveTo(e); } }
invoke
76,016
Presentation (@NotNull ActionContext context, @NotNull PsiClass element) { return Presentation.of(myName); }
getPresentation
76,017
boolean (@NotNull PsiClass psiClass) { PsiClassType[] extendsListTypes = psiClass.getExtendsListTypes(); if (extendsListTypes.length == 0) return false; if (extendsListTypes.length == 1 && TypeUtils.isJavaLangObject(extendsListTypes[0])) return false; return true; }
hasNonObjectParent
76,018
String () { return CommonQuickFixBundle.message("fix.replace.with.x", "Collections.addAll()"); }
getFamilyName
76,019
void (@NotNull ActionContext context, @NotNull PsiMethodCallExpression call, @NotNull ModPsiUpdater updater) { final PsiElementFactory elementFactory = JavaPsiFacade.getElementFactory(context.project()); final PsiExpression toReplace = elementFactory.createExpressionFromText(getCollectionsMethodCall(call), call); JavaC...
invoke
76,020
String (@NotNull PsiMethodCallExpression call) { final PsiExpression qualifierExpression = call.getMethodExpression().getQualifierExpression(); PsiExpression[] expressions = call.getArgumentList().getExpressions(); return "java.util.Collections.addAll(" + (qualifierExpression != null ? qualifierExpression.getText() : "...
getCollectionsMethodCall
76,021
void (@NotNull ActionContext context, @NotNull PsiReferenceExpression exprToReplace, @NotNull ModPsiUpdater updater) { PsiClass resolvedExprClass = getResolvedExprClass(); if (resolvedExprClass == null) return; PsiExpression newExpr = JavaPsiFacade.getElementFactory(resolvedExprClass.getProject()) .createExpressionFrom...
invoke
76,022
String () { return QuickFixBundle.message("replace.with.type.pattern.fix"); }
getFamilyName
76,023
PsiClass () { return myResolvedExprClass.getElement(); }
getResolvedExprClass
76,024
boolean () { long currentPsiModificationCount = PsiModificationTracker.getInstance(myProject).getModificationCount(); return currentPsiModificationCount != myPsiModificationCount; }
isPsiModificationStampChanged
76,025
String () { return QuickFixBundle.message("insert.new.fix"); }
getFamilyName
76,026
void (@NotNull ActionContext context, @NotNull PsiMethodCallExpression call, @NotNull ModPsiUpdater updater) { PsiElementFactory factory = JavaPsiFacade.getElementFactory(call.getProject()); PsiNewExpression newExpression = (PsiNewExpression)factory.createExpressionFromText("new X()",null); CommentTracker tracker = new...
invoke
76,027
String () { return QuickFixBundle.message("static.import.constant.text"); }
getBaseText
76,028
String (@NotNull PsiField field) { return PsiFormatUtil.formatVariable(field, PsiFormatUtilBase.SHOW_NAME | PsiFormatUtilBase.SHOW_CONTAINING_CLASS | PsiFormatUtilBase.SHOW_FQ_NAME, PsiSubstitutor.EMPTY); }
getMemberPresentableText
76,029
String () { return QuickFixBundle.message("static.import.constant.kind.text"); }
getMemberKindPresentableText
76,030
IntentionPreviewInfo (@NotNull Project project, @NotNull Editor editor, @NotNull PsiFile file) { return generatePreview(file, (__, field) -> AddSingleMemberStaticImportAction.bindAllClassRefs(file, field, field.getName(), field.getContainingClass())); }
generatePreview
76,031
ApplicableType (@NotNull PsiField field, @NotNull PsiElement place) { ProgressManager.checkCanceled(); PsiType fieldType = field.getType(); return isApplicableFor(fieldType); }
isApplicable
76,032
QuestionAction (@NotNull List<? extends PsiField> methodsToImport, @NotNull Project project, Editor editor) { return new StaticImportMemberQuestionAction<PsiField>(project, editor, methodsToImport, myReferencePointer) { @NotNull @Override protected String getPopupTitle() { return QuickFixBundle.message("field.to.import...
createQuestionAction
76,033
String () { return QuickFixBundle.message("field.to.import.chooser.title"); }
getPopupTitle
76,034
PsiElement () { PsiJavaCodeReferenceElement element = myReferencePointer.getElement(); return element != null ? element.getQualifier() : null; }
getQualifierExpression
76,035
PsiElement () { PsiJavaCodeReferenceElement referenceElement = (PsiJavaCodeReferenceElement)getElement(); return referenceElement != null ? referenceElement.advancedResolve(true).getElement() : null; }
resolveRef
76,036
String () { return JavaBundle.message("intention.family.variable.access.from.inner.class"); }
getFamilyName
76,037
void (@NotNull ActionContext context, @NotNull PsiElement element, @NotNull ModPsiUpdater updater) { if (!(element instanceof PsiReferenceExpression referenceExpression)) return; PsiLocalVariable variable = tryCast(referenceExpression.resolve(), PsiLocalVariable.class); if (variable == null) return; final String variab...
invoke
76,038
void (PsiLocalVariable variable, String boxName) { List<PsiReferenceExpression> references = findReferences(variable); PsiElementFactory factory = JavaPsiFacade.getElementFactory(variable.getProject()); PsiExpression expr = factory.createExpressionFromText(boxName + "." + variable.getName(), null); for (PsiReferenceExp...
replaceReferences
76,039
String (PsiLocalVariable variable) { // var x is not allowed as field if (variable.getTypeElement().isInferredType()) { PsiLocalVariable copy = (PsiLocalVariable)variable.copy(); PsiTypesUtil.replaceWithExplicitType(copy.getTypeElement()); return copy.getText(); } else { return variable.getText(); } }
getFieldText
76,040
record (boolean isBefore, @NotNull PsiLocalVariable variable, @NotNull String name) { @Nullable static DeclarationInfo findExistingAnonymousClass(@NotNull PsiVariable variable) { PsiElement varDeclarationStatement = CommonJavaRefactoringUtil.getParentStatement(variable, false); if (varDeclarationStatement == null) retu...
DeclarationInfo
76,041
DeclarationInfo (@NotNull PsiVariable variable) { PsiElement varDeclarationStatement = CommonJavaRefactoringUtil.getParentStatement(variable, false); if (varDeclarationStatement == null) return null; PsiStatement nextStatement = PsiTreeUtil.getNextSiblingOfType(varDeclarationStatement, PsiStatement.class); PsiDeclarati...
findExistingAnonymousClass
76,042
DeclarationInfo (@NotNull PsiVariable variable, @Nullable PsiDeclarationStatement declarationStatement, boolean isBefore) { if (declarationStatement == null) return null; PsiElement[] declaredElements = declarationStatement.getDeclaredElements(); if (declaredElements.length != 1) return null; PsiLocalVariable localVari...
findExistingAnonymousClass
76,043
List<PsiReferenceExpression> (@NotNull PsiLocalVariable variable) { PsiElement outerCodeBlock = PsiUtil.getVariableCodeBlock(variable, null); if (outerCodeBlock == null) return emptyList(); List<PsiReferenceExpression> references = new SmartList<>(); outerCodeBlock.accept(new JavaRecursiveElementVisitor() { @Override p...
findReferences
76,044
void (@NotNull PsiReferenceExpression expression) { super.visitReferenceExpression(expression); if (ExpressionUtils.isReferenceTo(expression, variable)) { references.add(expression); } }
visitReferenceExpression
76,045
ExternalClassResolveResult (@NotNull String shortClassName, @NotNull ThreeState isAnnotation, @NotNull Module contextModule) { if (AnnotationUtil.isJetbrainsAnnotation(shortClassName)) { ExternalLibraryDescriptor libraryDescriptor = getAnnotationsLibraryDescriptor(contextModule); return new ExternalClassResolveResult("...
resolveClass
76,046
ExternalLibraryDescriptor (@NotNull Module contextModule) { boolean java8 = LanguageLevelUtil.getEffectiveLanguageLevel(contextModule).isAtLeast(LanguageLevel.JDK_1_8); return java8 ? JAVA8 : JAVA5; }
getAnnotationsLibraryDescriptor
76,047
String () { return VERSION; }
getVersion
76,048
String () { return QuickFixBundle.message("fix.variable.type.text", JavaElementKind.fromElement(myVar).lessDescriptive().subject(), myVar.getName(), myExpressionType.getPresentableText()); }
getText
76,049
String () { return QuickFixBundle.message("fix.variable.type.family"); }
getFamilyName
76,050
boolean (@NotNull Project project, Editor editor, PsiFile file) { return myExpressionType.isValid() && myVar.isValid() && PsiTypesUtil.allTypeParametersResolved(myVar, myExpressionType); }
isAvailable
76,051
boolean () { return false; }
startInWriteAction
76,052
List<IntentionAction> (@NotNull PsiMethodCallExpression methodCall, @NotNull PsiExpressionList list) { final JavaResolveResult result = methodCall.getMethodExpression().advancedResolve(false); PsiMethod method = (PsiMethod) result.getElement(); final PsiSubstitutor substitutor = result.getSubstitutor(); PsiExpression[]...
getQuickFixActions
76,053
List<IntentionAction> (@NotNull PsiMethod method, @NotNull PsiExpression expression, PsiType parameterType) { if (!(expression instanceof PsiReferenceExpression)) { return Collections.emptyList(); } List<IntentionAction> result = new ArrayList<>(); if (BaseIntentionAction.canModify(method)) { final PsiMethod[] superMet...
getParameterTypeChangeFixes
76,054
String () { return QuickFixBundle.message("make.annotation.applicable.to.0.fix", StringUtil.toLowerCase(myTarget.toString()).replace('_', ' ') + 's'); }
getFamilyName
76,055
ModCommand (@NotNull ActionContext context, @NotNull PsiAnnotation annotation) { PsiClass origAnnoType = annotation.resolveAnnotationType(); if (origAnnoType == null) return ModCommand.nop(); return ModCommand.psiUpdate(origAnnoType, annotationType -> { PsiModifierList modifierList = annotationType.getModifierList(); i...
perform
76,056
String () { return QuickFixBundle.message("fix.receiver.parameter.name.family"); }
getFamilyName
76,057
void (@NotNull ActionContext context, @NotNull PsiReceiverParameter receiver, @NotNull ModPsiUpdater updater) { CommentTracker ct = new CommentTracker(); ct.replaceExpressionAndRestoreComments(receiver.getIdentifier(), myNewName); }
invoke
76,058
String () { return QuickFixBundle.message("fix.parameter.type.text", myName, myParameterType.getCanonicalText() ); }
getText
76,059
String () { return QuickFixBundle.message("fix.parameter.type.family"); }
getFamilyName
76,060
boolean (@NotNull Project project, @NotNull PsiFile file, @NotNull PsiElement startElement, @NotNull PsiElement endElement) { final PsiMethod myMethod = (PsiMethod)startElement; if (!BaseIntentionAction.canModify(myMethod) || myParameterType == null || TypeConversionUtil.isNullType(myParameterType)) { return false; } P...
isAvailable
76,061
void (@NotNull final Project project, @NotNull final PsiFile file, @Nullable Editor editor, @NotNull PsiElement startElement, @NotNull PsiElement endElement) { final PsiMethod myMethod = (PsiMethod)startElement; if (!FileModificationService.getInstance().prepareFileForWrite(myMethod.getContainingFile())) return; try { ...
invoke
76,062
boolean () { return false; }
startInWriteAction
76,063
IntentionPreviewInfo (@NotNull Project project, @NotNull Editor editor, @NotNull PsiFile file) { final PsiMethod method = PsiTreeUtil.findSameElementInCopy((PsiMethod)getStartElement(), file); PsiTypeElement typeElement = method.getParameterList().getParameters()[myIndex].getTypeElement(); if (typeElement == null) retu...
generatePreview
76,064
String () { return QuickFixBundle.message("enable.optimize.imports.on.the.fly"); }
getText
76,065
String () { return getText(); }
getFamilyName
76,066
boolean (@NotNull Project project, Editor editor, PsiFile file) { return BaseIntentionAction.canModify(file) && file instanceof PsiJavaFile && !CodeInsightWorkspaceSettings.getInstance(project).isOptimizeImportsOnTheFly(); }
isAvailable
76,067
void (@NotNull Project project, Editor editor, PsiFile file) { CodeInsightWorkspaceSettings.getInstance(project).setOptimizeImportsOnTheFly(true); SaveAndSyncHandler.getInstance().scheduleProjectSave(project, true); DaemonCodeAnalyzer.getInstance(project).restart(); }
invoke
76,068
boolean () { return false; }
startInWriteAction
76,069
boolean (@NotNull final PsiJavaCodeReferenceElement element) { PsiElement parent = element.getParent(); if (myKind == CreateClassKind.ANNOTATION) { return parent instanceof PsiAnnotation; } if (parent instanceof PsiJavaCodeReferenceCodeFragment) return true; if (parent instanceof PsiTypeElement) { if (parent.getParent(...
isAvailableInContext
76,070
Boolean (@NotNull PsiType type) { return false; }
visitType
76,071
Boolean (@NotNull PsiClassType classType) { PsiClass aClass = classType.resolve(); return aClass != null && aClass.isInterface(); }
visitClassType
76,072
Boolean (@NotNull PsiWildcardType wildcardType) { PsiType bound = wildcardType.getBound(); return bound == null || bound.accept(this); }
visitWildcardType
76,073
boolean (String name) { return Character.isUpperCase(name.charAt(0)); }
checkClassName
76,074
boolean (@NotNull final Project project, final Editor editor, final PsiFile file) { final PsiJavaCodeReferenceElement element = getRefElement(); if (element == null || (!element.getManager().isInProject(element) && !ScratchUtil.isScratch(PsiUtilCore.getVirtualFile(element)))) { return false; } JavaResolveResult[] resul...
isAvailable
76,075
String () { return QuickFixBundle.message("create.class.from.usage.family"); }
getFamilyName
76,076
PsiJavaCodeReferenceElement () { return myRefElement.getElement(); }
getRefElement
76,077
String (final PsiJavaCodeReferenceElement element) { String superClassName = null; PsiElement parent = element.getParent(); final PsiElement ggParent = parent.getParent(); if (ggParent instanceof PsiClass && ((PsiClass)ggParent).getPermitsList() == parent) { return ((PsiClass)ggParent).getQualifiedName(); } else if (gg...
getSuperClassName
76,078
boolean (@NotNull Project project, Editor editor, PsiFile file) { PsiElement element = getElement(); if (element == null || isValidElement(element)) { return false; } int offset = editor.getCaretModel().getOffset(); if (!isAvailableImpl(offset)) { return false; } List<PsiClass> targetClasses = filterTargetClasses(eleme...
isAvailable
76,079
void (@NotNull Project project, @NotNull Editor editor, @NotNull Consumer<? super PsiClass> createInClass) { PsiElement element = getElement(); List<PsiClass> targetClasses = filterTargetClasses(element, project); if (targetClasses.isEmpty()) return; if (targetClasses.size() == 1 || ApplicationManager.getApplication()....
chooseTargetClass
76,080
List<PsiClass> (PsiElement element, Project project) { return ContainerUtil.filter(getTargetClasses(element), psiClass -> JVMElementFactories.getFactory(psiClass.getLanguage(), project) != null); }
filterTargetClasses
76,081
void (final PsiClass targetClass, Consumer<? super PsiClass> invokeImpl) { if (!FileModificationService.getInstance().prepareFileForWrite(targetClass.getContainingFile())) { return; } IdeDocumentHistory.getInstance(targetClass.getProject()).includeCurrentPlaceAsChangePlace(); ApplicationManager.getApplication().runWrit...
doInvoke
76,082
void (List<PsiClass> classes, final Editor editor, Consumer<? super PsiClass> invokeImpl) { final PsiClass firstClass = classes.get(0); final Project project = firstClass.getProject(); final PsiClass preselection = AnonymousTargetClassPreselectionUtil.getPreselection(classes, firstClass); PsiClassListCellRenderer rende...
chooseTargetClass
76,083
String (PsiClass parentClass, @NotNull PsiClass targetClass) { if (parentClass != null && (parentClass.equals(targetClass) || PsiTreeUtil.isAncestor(targetClass, parentClass, true))) { return PsiModifier.PRIVATE; } else { return JavaCodeStyleSettings.getInstance(targetClass.getContainingFile()).VISIBILITY; } }
getVisibility
76,084
boolean (PsiReferenceExpression ref, PsiClass targetClass) { PsiExpression qualifierExpression = ref.getQualifierExpression(); while (qualifierExpression instanceof PsiParenthesizedExpression) { qualifierExpression = ((PsiParenthesizedExpression) qualifierExpression).getExpression(); } if (qualifierExpression instanceo...
shouldCreateStaticMember
76,085
PsiExpression (PsiElement element) { if (element instanceof PsiNewExpression) { PsiJavaCodeReferenceElement ref = ((PsiNewExpression) element).getClassReference(); if (ref instanceof PsiReferenceExpression) { return ((PsiReferenceExpression) ref).getQualifierExpression(); } } else if (element instanceof PsiReferenceExp...
getQualifier
76,086
PsiSubstitutor (@Nullable PsiElement element) { if (element instanceof PsiNewExpression) { PsiJavaCodeReferenceElement reference = ((PsiNewExpression)element).getClassOrAnonymousClassReference(); JavaResolveResult result = reference == null ? JavaResolveResult.EMPTY : reference.advancedResolve(false); return result.get...
getTargetSubstitutor
76,087
boolean () { return true; }
isAllowOuterTargetClass
76,088
List<PsiClass> (PsiElement element) { PsiClass psiClass = null; PsiExpression qualifier = null; if (element instanceof PsiNameValuePair) { final PsiAnnotation annotation = PsiTreeUtil.getParentOfType(element, PsiAnnotation.class); if (annotation != null) { PsiJavaCodeReferenceElement nameRef = annotation.getNameReferen...
getTargetClasses
76,089
void (PsiClass psiClass, ArrayList<? super PsiClass> classes) { classes.add(psiClass); final PsiClass[] supers = psiClass.getSupers(); for (PsiClass aSuper : supers) { if (classes.contains(aSuper)) continue; if (canBeTargetClass(aSuper)) { collectSupers(aSuper, classes); } } }
collectSupers
76,090
boolean (PsiClass psiClass) { return canModify(psiClass); }
canBeTargetClass
76,091
void (@NotNull Editor editor, final Template template, @NotNull final Project project) { startTemplate(editor, template, project, null); }
startTemplate
76,092
void (@NotNull final Editor editor, final Template template, @NotNull final Project project, final TemplateEditingListener listener) { startTemplate(editor, template, project, listener, null); }
startTemplate
76,093
void (@NotNull final Editor editor, final Template template, @NotNull final Project project, final TemplateEditingListener listener, final @NlsContexts.Command String commandName) { Runnable runnable = () -> TemplateManager.getInstance(project).startTemplate(editor, template, listener); if (!ApplicationManager.getAppli...
startTemplate
76,094
boolean () { return false; }
startInWriteAction
76,095
void (PsiClass targetClass, PsiJavaCodeReferenceElement ref) { int numParams = ref.getTypeParameters().length; if (numParams == 0) return; final PsiElementFactory factory = JavaPsiFacade.getElementFactory(ref.getProject()); final Set<String> typeParamNames = new HashSet<>(); for (PsiType type : ref.getTypeParameters())...
setupGenericParameters
76,096
void (@NotNull Project project, @NotNull PsiClass aClass, @NotNull Template template, @Nls @NotNull String text) { aClass = CodeInsightUtilCore.forcePsiPostprocessAndRestoreElement(aClass); template.setToReformat(true); final Editor editor = CodeInsightUtil.positionCursor(project, Objects.requireNonNull(aClass).getCont...
startTemplate
76,097
void (@NotNull ActionContext context, @NotNull PsiTryStatement tryStatement, @NotNull ModPsiUpdater updater) { PsiStatement replacement = JavaPsiFacade.getElementFactory(context.project()) .createStatementFromText(tryStatement.getText() + "finally {\n\n}", tryStatement); PsiTryStatement result = (PsiTryStatement)trySta...
invoke
76,098
void (@NotNull ModPsiUpdater updater, @NotNull PsiCodeBlock block) { PsiFile file = block.getContainingFile(); Document document = file.getViewProvider().getDocument(); Project project = file.getProject(); updater.moveTo(Objects.requireNonNull(block.getRBrace())); PsiDocumentManager.getInstance(project).doPostponedOper...
moveCaretToFinallyBlock
76,099
String () { return QuickFixBundle.message("add.finally.block.family"); }
getFamilyName