Unnamed: 0 int64 0 305k | body stringlengths 7 52.9k | name stringlengths 1 185 |
|---|---|---|
75,000 | boolean (@Nullable PsiElement e) { return e instanceof PsiIfStatement ifStatement && ifStatement.getCondition() != null && ifStatement.getThenBranch() != null; } | isWellFormedIf |
75,001 | String () { return JavaBundle.message("intention.family.swap.if.statements"); } | getFamilyName |
75,002 | String () { return JavaBundle.message("intention.family.name.make.sealed"); } | getFamilyName |
75,003 | boolean (@NotNull ActionContext context, @NotNull PsiClass aClass) { if (!HighlightingFeature.SEALED_CLASSES.isAvailable(aClass)) return false; int offset = context.offset(); PsiElement lBrace = aClass.getLBrace(); if (lBrace == null) return false; if (offset >= lBrace.getTextRange().getStartOffset()) return false; if ... | isAvailable |
75,004 | void (@NotNull ActionContext context, @NotNull PsiClass aClass, @NotNull ModPsiUpdater updater) { sealClass(context.project(), updater, aClass); } | invoke |
75,005 | void (@NotNull Project project, ModPsiUpdater updater, PsiClass psiClass) { PsiJavaFile parentFile = (PsiJavaFile)psiClass.getContainingFile(); if (psiClass.isInterface()) { if (FunctionalExpressionSearch.search(psiClass).findFirst() != null) { updater.cancel(JavaBundle.message("intention.error.make.sealed.class.is.use... | sealClass |
75,006 | boolean (List<PsiClass> inheritors, PsiFile parentFile) { return !ContainerUtil.and(inheritors, psiClass -> psiClass.getContainingFile() == parentFile); } | shouldCreatePermitsList |
75,007 | void (List<PsiClass> inheritors) { for (PsiClass inheritor : inheritors) { PsiModifierList modifierList = inheritor.getModifierList(); assert modifierList != null; // ensured by absence of anonymous classes if (modifierList.hasModifierProperty(PsiModifier.SEALED) || modifierList.hasModifierProperty(PsiModifier.NON_SEAL... | setInheritorsModifiers |
75,008 | void (@NotNull Project project, PsiClass aClass, List<String> nonNullNames) { String permitsClause = StreamEx.of(nonNullNames).sorted().joining(",", "permits ", ""); PsiReferenceList permitsList = createPermitsClause(project, permitsClause); PsiReferenceList implementsList = Objects.requireNonNull(aClass.getImplementsL... | addPermitsClause |
75,009 | PsiReferenceList (@NotNull Project project, String permitsClause) { PsiFileFactory factory = PsiFileFactory.getInstance(project); PsiJavaFile javaFile = (PsiJavaFile)factory.createFileFromText(JavaLanguage.INSTANCE, "class __Dummy " + permitsClause + "{}"); PsiClass newClass = javaFile.getClasses()[0]; return Objects.r... | createPermitsClause |
75,010 | void (@NotNull ActionContext context, @NotNull PsiKeyword elseKeyword, @NotNull ModPsiUpdater updater) { PsiElement parent = elseKeyword.getParent(); if (parent instanceof PsiIfStatement ifStatement) { PsiStatement elseBranch = ifStatement.getElseBranch(); PsiElement grandParent = ifStatement.getParent(); if (elseBranc... | invoke |
75,011 | boolean (PsiStatement statement) { PsiStatement nextStatement = PsiTreeUtil.getNextSiblingOfType(statement, PsiStatement.class); if (nextStatement != null) { return !(nextStatement instanceof PsiSwitchLabelStatement); } PsiElement parent = statement.getParent(); if (parent instanceof PsiIfStatement ifStatement) { PsiSt... | nextStatementMayBecomeUnreachable |
75,012 | String () { return JavaBundle.message("intention.unwrap.else.branch"); } | getFamilyName |
75,013 | void (@NotNull ActionContext context, @NotNull PsiJavaToken token, @NotNull ModPsiUpdater updater) { if (token.getTokenType() != JavaTokenType.STRING_LITERAL) return; final String text = token.getText(); if (text == null) return; final PsiElementFactory factory = JavaPsiFacade.getElementFactory(context.project()); toke... | invoke |
75,014 | String (@NotNull String string) { final String result = StringUtil.replace( string, Arrays.asList("\\n\\r", "\\n"), Arrays.asList("\\n\\r\" + \n\"", "\\n\" + \n\"") ); final String redundantSuffix = " + \n\"\""; return result.endsWith(redundantSuffix) ? result.substring(0, result.length() - redundantSuffix.length()) : ... | breakOnLineBreaks |
75,015 | String () { return JavaBundle.message("intention.break.string.on.line.breaks.text"); } | getFamilyName |
75,016 | String () { return JavaBundle.message("intention.family.copy.abstract.method.implementation"); } | getFamilyName |
75,017 | String (final PsiMethod method) { return JavaBundle.message("copy.abstract.method.intention.name", method.getName()); } | getIntentionName |
75,018 | boolean (final MyElementProcessor processor) { return processor.hasMissingImplementations() && processor.hasExistingImplementations(); } | isAvailable |
75,019 | void (final Project project, final Editor editor, final PsiMethod method) { new CopyAbstractMethodImplementationHandler(project, editor, method).invoke(); } | invokeHandler |
75,020 | String () { return JavaBundle.message("intention.implement.abstract.method.family"); } | getFamilyName |
75,021 | boolean (@NotNull Project project, Editor editor, PsiFile file) { int offset = editor.getCaretModel().getOffset(); final PsiMethod method = findMethod(file, offset); if (method == null || !method.isValid() || method.isConstructor()) return false; setText(getIntentionName(method)); if (!canModify(method)) return false; ... | isAvailable |
75,022 | boolean (PsiFile file, int offset) { final PsiElement psiElement = file.findElementAt(offset); if (psiElement instanceof PsiIdentifier){ if (psiElement.getParent() instanceof PsiMethod) { return true; } } return false; } | isOnIdentifier |
75,023 | boolean () { return myHasMissingImplementations; } | hasMissingImplementations |
75,024 | boolean () { return myHasExistingImplementations; } | hasExistingImplementations |
75,025 | boolean (@NotNull PsiClass element) { final PsiMethod existingImplementation = findExistingImplementation(element, myMethod); if (existingImplementation != null && !existingImplementation.hasModifierProperty(PsiModifier.ABSTRACT)) { myHasExistingImplementations = true; } else if (existingImplementation == null) { myHas... | execute |
75,026 | boolean (final MyElementProcessor processor) { return processor.hasMissingImplementations(); } | isAvailable |
75,027 | PsiMethod (final PsiClass aClass, PsiMethod method) { final PsiMethod[] methods = aClass.findMethodsByName(method.getName(), false); for(PsiMethod candidate: methods) { final PsiMethod[] superMethods = candidate.findSuperMethods(false); if (ArrayUtil.contains(method, superMethods)) { return candidate; } } return null; ... | findExistingImplementation |
75,028 | PsiMethod (PsiFile file, int offset) { PsiMethod method = _findMethod(file, offset); if (method == null) { method = _findMethod(file, offset - 1); } return method; } | findMethod |
75,029 | PsiMethod (PsiFile file, int offset) { return PsiTreeUtil.getParentOfType(file.findElementAt(offset), PsiMethod.class); } | _findMethod |
75,030 | void (final Project project, final Editor editor, final PsiMethod method) { new ImplementAbstractMethodHandler(project, editor, method).invoke(); } | invokeHandler |
75,031 | boolean () { return false; } | startInWriteAction |
75,032 | String () { return JavaBundle.message("intention.replace.concatenation.with.formatted.output.family"); } | getFamilyName |
75,033 | void (@NotNull ActionContext context, @NotNull PsiElement element, @NotNull ModPsiUpdater updater) { PsiPolyadicExpression concatenation = getEnclosingLiteralConcatenation(element); if (concatenation == null) return; List<PsiExpression> args = new ArrayList<>(); final String formatString = StringUtil.escapeStringCharac... | invoke |
75,034 | PsiPolyadicExpression (final PsiElement element) { PsiPolyadicExpression binaryExpression = PsiTreeUtil.getParentOfType(element, PsiPolyadicExpression.class, false, PsiMember.class); if (binaryExpression == null) return null; final PsiClassType stringType = PsiType.getJavaLangString(element.getManager(), element.getRes... | getEnclosingLiteralConcatenation |
75,035 | String () { return JavaBundle.message("intention.add.on.demand.static.import.family"); } | getFamilyName |
75,036 | PsiClass (@NotNull PsiElement element) { if (!PsiUtil.isLanguageLevel5OrHigher(element)) return null; if (!(element instanceof PsiIdentifier) || !(element.getParent() instanceof PsiJavaCodeReferenceElement refExpr)) { return null; } if (PsiTreeUtil.getParentOfType(element, PsiErrorElement.class, PsiImportStatementBase.... | getClassToPerformStaticImport |
75,037 | boolean (final Project project, PsiFile file, final Editor editor, @NotNull PsiElement element) { List<PsiJavaCodeReferenceElement> dequalifiedElements = new ArrayList<>(); boolean conflicts = addStaticImports(file, element, dequalifiedElements); if (editor != null) { ApplicationManager.getApplication().invokeLater(() ... | invoke |
75,038 | boolean (@NotNull PsiFile file, @NotNull PsiElement element, @NotNull List<@NotNull PsiJavaCodeReferenceElement> dequalifiedElements) { final PsiJavaCodeReferenceElement refExpr = (PsiJavaCodeReferenceElement)element.getParent(); final PsiClass aClass = (PsiClass)refExpr.resolve(); if (aClass == null) { return false; }... | addStaticImports |
75,039 | void (@NotNull PsiJavaCodeReferenceElement expression) { PsiElement qualifierExpression; if (!isParameterizedReference(expression) && !(expression instanceof PsiMethodReferenceExpression) && !(expression.getParent() instanceof PsiErrorElement) && (qualifierExpression = expression.getQualifier()) instanceof PsiJavaCodeR... | visitReferenceElement |
75,040 | boolean (@NotNull PsiManager manager, JavaResolveResult @NotNull [] resolved, JavaResolveResult @NotNull [] resolvedAfter) { // returns true if there's at least one element from "resolved" which is the same as one of "resolvedAfter" for (JavaResolveResult result : resolved) { if (!result.isAccessible()) continue; for (... | resolvesToSame |
75,041 | boolean (Project project, Editor editor, @NotNull List<? extends PsiJavaCodeReferenceElement> expressionsToDequalify) { boolean found = false; for (PsiJavaCodeReferenceElement expression : expressionsToDequalify) { if (!expression.isValid()) continue; found = true; HighlightManager.getInstance(project).addRangeHighligh... | collectChangedPlaces |
75,042 | void (@NotNull ActionContext context, @NotNull PsiIdentifier element, @NotNull ModPsiUpdater updater) { List<PsiJavaCodeReferenceElement> dequalifiedElements = new ArrayList<>(); addStaticImports(element.getContainingFile(), element, dequalifiedElements); for (PsiJavaCodeReferenceElement ref : dequalifiedElements) { up... | invoke |
75,043 | boolean (final PsiJavaCodeReferenceElement expression) { PsiReferenceParameterList parameterList = expression.getParameterList(); return parameterList != null && parameterList.getFirstChild() != null; } | isParameterizedReference |
75,044 | ModCommand (@NotNull ActionContext context, @NotNull PsiIdentifier startElement) { PsiClass psiClass = PsiTreeUtil.getParentOfType(startElement, PsiClass.class); if (psiClass == null) return ModCommand.nop(); PsiJavaFile psiJavaFile = tryCast(psiClass.getContainingFile(), PsiJavaFile.class); if (psiJavaFile == null) re... | perform |
75,045 | ModCommand (@NotNull PsiJavaFile psiJavaFile, @NotNull PsiClass psiClass, @NotNull Set<PsiClass> permittedClasses) { Collection<String> missingInheritors = new SmartList<>(); PsiJavaModule module = JavaModuleGraphUtil.findDescriptorByElement(psiClass); for (PsiClass inheritor : DirectClassInheritorsSearch.search(psiCla... | getMissingInheritors |
75,046 | String () { return JavaBundle.message("change.uid.action.name"); } | getFamilyName |
75,047 | void (@NotNull ActionContext context, @NotNull PsiField field, @NotNull ModPsiUpdater updater) { PsiElementFactory factory = JavaPsiFacade.getElementFactory(context.project()); Application application = ApplicationManager.getApplication(); Random random = application.isUnitTestMode() ? new Random(42) : new SecureRandom... | invoke |
75,048 | LocalQuickFixAndIntentionActionOnPsiElement (@NotNull PsiModifierList modifierList, @NotNull String modifier, boolean shouldHave, boolean showContainingClass) { return LocalQuickFixAndIntentionActionOnPsiElement.from(new ModifierFix(modifierList, modifier, shouldHave, showContainingClass), modifierList.getParent()); } | createModifierListFix |
75,049 | LocalQuickFixAndIntentionActionOnPsiElement (@NotNull PsiModifierListOwner owner, @NotNull final String modifier, final boolean shouldHave, final boolean showContainingClass) { return LocalQuickFixAndIntentionActionOnPsiElement.from(new ModifierFix(owner, modifier, shouldHave, showContainingClass), owner); } | createModifierListFix |
75,050 | LocalQuickFixAndIntentionActionOnPsiElement (@NotNull PsiMethod method, @NotNull PsiType toReturn, boolean fixWholeHierarchy) { return new MethodReturnTypeFix(method, toReturn, fixWholeHierarchy); } | createMethodReturnFix |
75,051 | LocalQuickFixAndIntentionActionOnPsiElement (@NotNull PsiMethod method, @NotNull PsiType toReturn, boolean fixWholeHierarchy, boolean suggestSuperTypes) { return new MethodReturnTypeFix(method, toReturn, fixWholeHierarchy, suggestSuperTypes); } | createMethodReturnFix |
75,052 | LocalQuickFixAndIntentionActionOnPsiElement (@NotNull PsiMethod method, @NotNull PsiType toReturn, boolean fromDefaultValue) { return new AnnotationMethodReturnTypeFix(method, toReturn, fromDefaultValue); } | createAnnotationMethodReturnFix |
75,053 | LocalQuickFixAndIntentionActionOnPsiElement (@NotNull PsiClass aClass) { return new ImplementMethodsFix(aClass); } | createImplementMethodsFix |
75,054 | LocalQuickFixAndIntentionActionOnPsiElement (@NotNull PsiElement psiElement) { return new ImplementMethodsFix(psiElement); } | createImplementMethodsFix |
75,055 | IntentionAction (@NotNull PsiAssignmentExpression expr) { return new ReplaceAssignmentWithComparisonFix(expr).asIntention(); } | createAssignmentToComparisonFix |
75,056 | LocalQuickFixAndIntentionActionOnPsiElement (@NotNull PsiMethod method, @NotNull PsiClassType exceptionClass, boolean shouldThrow, boolean showContainingClass) { ModCommandAction action = shouldThrow ? new MethodThrowsFix.Add(method, exceptionClass, showContainingClass) : new MethodThrowsFix.Remove(method, exceptionCla... | createMethodThrowsFix |
75,057 | LocalQuickFixAndIntentionActionOnPsiElement (@NotNull PsiClass aClass) { return LocalQuickFixAndIntentionActionOnPsiElement.from(new AddDefaultConstructorFix(aClass), aClass); } | createAddDefaultConstructorFix |
75,058 | LocalQuickFixAndIntentionActionOnPsiElement (@NotNull PsiMethod method, int index, @NotNull PsiType newType, boolean fixWholeHierarchy) { return new MethodParameterFix(method, newType, index, fixWholeHierarchy); } | createMethodParameterTypeFix |
75,059 | LocalQuickFixAndIntentionActionOnPsiElement (@NotNull PsiClass aClass, @NotNull PsiClassType typeToExtendFrom, boolean toAdd) { return new ExtendsListFix(aClass, typeToExtendFrom, toAdd); } | createExtendsListFix |
75,060 | LocalQuickFixAndIntentionActionOnPsiElement (@NotNull PsiParameter parameter) { return new RemoveUnusedParameterFix(parameter); } | createRemoveUnusedParameterFix |
75,061 | IntentionAction (@NotNull PsiVariable variable) { return new RemoveUnusedVariableFix(variable).asIntention(); } | createRemoveUnusedVariableFix |
75,062 | IntentionAction (@NotNull PsiElement context, @NotNull String qualifiedName, boolean createClass, String superClass) { return CreateClassOrPackageFix.createFix(qualifiedName, context, createClass ? ClassKind.CLASS : null, superClass); } | createCreateClassOrPackageFix |
75,063 | IntentionAction (@NotNull PsiElement context, @NotNull String qualifiedName, boolean createClass, String superClass) { return CreateClassOrPackageFix.createFix(qualifiedName, context, createClass ? ClassKind.CLASS : ClassKind.INTERFACE, superClass); } | createCreateClassOrInterfaceFix |
75,064 | IntentionAction (@NotNull PsiClass aClass, @NotNull String name, @NotNull PsiType type, @NotNull PropertyMemberType targetMember, PsiAnnotation @NotNull ... annotations) { return new CreateFieldOrPropertyFix(aClass, name, type, targetMember, annotations).asIntention(); } | createCreateFieldOrPropertyFix |
75,065 | IntentionAction () { return new AddExceptionToCatchFix(true).asIntention(); } | createAddExceptionToCatchFix |
75,066 | IntentionAction (@NotNull PsiElement element) { return new AddExceptionToThrowsFix(element).asIntention(); } | createAddExceptionToThrowsFix |
75,067 | IntentionAction (@NotNull PsiElement element) { return new AddExceptionFromFieldInitializerToConstructorThrowsFix(element).asIntention(); } | createAddExceptionFromFieldInitializerToConstructorThrowsFix |
75,068 | IntentionAction (@NotNull PsiElement element) { return new SurroundWithTryCatchFix(element).asIntention(); } | createSurroundWithTryCatchFix |
75,069 | IntentionAction (@NotNull PsiElement element) { return new AddExceptionToExistingCatchFix(element).asIntention(); } | createAddExceptionToExistingCatch |
75,070 | IntentionAction (@NotNull IElementType sign, @NotNull PsiType type, @NotNull PsiAssignmentExpression assignment) { return new ChangeToAppendFix(sign, type, assignment).asIntention(); } | createChangeToAppendFix |
75,071 | IntentionAction (@NotNull PsiType type, @NotNull PsiExpression expression) { return new AddTypeCastFix(type, expression).asIntention(); } | createAddTypeCastFix |
75,072 | IntentionAction (@NotNull PsiLocalVariable variable) { return new ReuseVariableDeclarationFix(variable).asIntention(); } | createReuseVariableDeclarationFix |
75,073 | IntentionAction (@NotNull PsiVariable variable) { return new NavigateToAlreadyDeclaredVariableFix(variable).asIntention(); } | createNavigateToAlreadyDeclaredVariableFix |
75,074 | IntentionAction (@NotNull NavigatablePsiElement element) { return new NavigateToDuplicateElementFix(element).asIntention(); } | createNavigateToDuplicateElementFix |
75,075 | IntentionAction () { return new ConvertToStringLiteralAction().asIntention(); } | createConvertToStringLiteralAction |
75,076 | IntentionAction (@NotNull PsiMethod method, @NotNull PsiReturnStatement returnStatement) { return new DeleteReturnFix(method, returnStatement).asIntention(); } | createDeleteReturnFix |
75,077 | IntentionAction (@NotNull PsiParameter parameter) { return new DeleteCatchFix(parameter).asIntention(); } | createDeleteCatchFix |
75,078 | IntentionAction (@NotNull PsiTypeElement element) { return new DeleteMultiCatchFix(element).asIntention(); } | createDeleteMultiCatchFix |
75,079 | IntentionAction (@NotNull PsiSwitchStatement statement) { return new ConvertSwitchToIfIntention(statement).asIntention(); } | createConvertSwitchToIfIntention |
75,080 | IntentionAction (@NotNull PsiPrefixExpression expr) { return new NegationBroadScopeFix(expr).asIntention(); } | createNegationBroadScopeFix |
75,081 | IntentionAction (@NotNull PsiReferenceExpression place) { return new CreateFieldFromUsageFix(place); } | createCreateFieldFromUsageFix |
75,082 | IntentionAction (@NotNull PsiArrayAccessExpression expression) { return new ReplaceWithListAccessFix(expression).asIntention(); } | createReplaceWithListAccessFix |
75,083 | IntentionAction (@NotNull PsiArrayInitializerExpression expression) { return new AddNewArrayExpressionFix(expression).asIntention(); } | createAddNewArrayExpressionFix |
75,084 | IntentionAction (@NotNull PsiCatchSection section, @NotNull PsiCatchSection section1) { return new MoveCatchUpFix(section, section1).asIntention(); } | createMoveCatchUpFix |
75,085 | IntentionAction (@NotNull PsiReferenceExpression ref) { return new RenameWrongRefFix(ref); } | createRenameWrongRefFix |
75,086 | IntentionAction (@NotNull PsiExpression qualifier, @NotNull PsiReferenceExpression expression, @NotNull PsiClass resolved) { return new RemoveQualifierFix(expression, resolved).asIntention(); } | createRemoveQualifierFix |
75,087 | IntentionAction (@NotNull PsiMethod parent) { return new RemoveParameterListFix(parent).asIntention(); } | createRemoveParameterListFix |
75,088 | IntentionAction (@NotNull PsiElement element) { return new ShowModulePropertiesFix(element); } | createShowModulePropertiesFix |
75,089 | IntentionAction (@NotNull Module module) { return new ShowModulePropertiesFix(module); } | createShowModulePropertiesFix |
75,090 | IntentionAction (@NotNull LanguageLevel level) { return new IncreaseLanguageLevelFix(level); } | createIncreaseLanguageLevelFix |
75,091 | IntentionAction (@NotNull LanguageLevel level) { return new UpgradeSdkFix(level); } | createUpgradeSdkFor |
75,092 | IntentionAction (@NotNull PsiClass aClass, @NotNull PsiClassType type) { return new ChangeParameterClassFix(aClass, type); } | createChangeParameterClassFix |
75,093 | IntentionAction (@NotNull PsiReferenceExpression element, @NotNull PsiMethod getter, boolean isSetter) { return new ReplaceInaccessibleFieldWithGetterSetterFix(element, getter, isSetter).asIntention(); } | createReplaceInaccessibleFieldWithGetterSetterFix |
75,094 | IntentionAction (@Nullable PsiCall methodCall, @Nullable PsiExpression expression) { return new SurroundWithArrayFix(methodCall, expression).asIntention(); } | createSurroundWithArrayFix |
75,095 | IntentionAction (@NotNull PsiElement elementToHighlight) { return new ImplementAbstractClassMethodsFix(elementToHighlight); } | createImplementAbstractClassMethodsFix |
75,096 | IntentionAction (@NotNull PsiClass aClass) { return new MoveClassToSeparateFileFix(aClass).asIntention(); } | createMoveClassToSeparateFileFix |
75,097 | IntentionAction (@NotNull String newName) { return new RenameFileFix(newName); } | createRenameFileFix |
75,098 | IntentionAction (@NotNull PsiElement element) { PsiFile file = element.getContainingFile(); if (file == null) return null; ProblemDescriptor descriptor = new ProblemDescriptorBase(element, element, "", null, ProblemHighlightType.GENERIC_ERROR_OR_WARNING, false, null, true, false); return new LocalQuickFixAsIntentionAda... | createRenameFix |
75,099 | LocalQuickFixAndIntentionActionOnPsiElement (@NotNull PsiNamedElement element) { return new RenameElementFix(element); } | createRenameElementFix |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.