Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
71,000
boolean () { List<OldSwitchStatementBranch> branches = getWithFallthroughBranches(); return ContainerUtil.or(branches, branch -> branch.myLabelStatement.isDefaultCase()); }
isDefault
71,001
boolean () { return myIsFallthrough; }
isFallthrough
71,002
List<PsiCaseLabelElement> () { List<OldSwitchStatementBranch> branches = getWithFallthroughBranches(); Collections.reverse(branches); return StreamEx.of(branches).flatMap(branch -> { final PsiCaseLabelElementList caseLabelElementList = branch.myLabelStatement.getCaseLabelElementList(); if (caseLabelElementList == null)...
getCaseLabelElements
71,003
PsiStatement[] () { return myStatements; }
getStatements
71,004
List<PsiStatement> () { StreamEx<PsiStatement> withoutBreak = StreamEx.of(myStatements).prepend(myLabelStatement); return withoutBreak.prepend(myBreakStatement).toList(); }
getRelatedStatements
71,005
List<OldSwitchStatementBranch> () { List<OldSwitchStatementBranch> withPrevious = new ArrayList<>(); OldSwitchStatementBranch current = this; while (true) { withPrevious.add(current); current = current.myPreviousSwitchBranch; if (current == null || current.myStatements.length != 0 || !current.myIsFallthrough) { return ...
getWithFallthroughBranches
71,006
String () { return JavaBundle.message("inspection.replace.ternary.quickfix", myText); }
getName
71,007
String () { return JavaBundle.message("inspection.surround.if.family"); }
getFamilyName
71,008
void (@NotNull Project project, @NotNull PsiElement element, @NotNull ModPsiUpdater updater) { while (true) { PsiElement parent = element.getParent(); if (parent instanceof PsiCallExpression || parent instanceof PsiJavaCodeReferenceElement) { element = parent; } else { break; } } if (!(element instanceof PsiExpression ...
applyFix
71,009
void (PsiConditionalExpression conditionalExpression, @NotNull ModPsiUpdater updater) { PsiExpression elseExpression = conditionalExpression.getElseExpression(); if (elseExpression != null) { updater.templateBuilder().field(elseExpression, elseExpression.getText()); } }
selectElseBranch
71,010
PsiConditionalExpression (@NotNull Project project, @NotNull String condition, @NotNull PsiExpression expression, @NotNull String defaultValue) { final PsiElementFactory factory = JavaPsiFacade.getElementFactory(project); final PsiElement parent = expression.getParent(); final PsiConditionalExpression conditionalExpres...
replaceWithConditionalExpression
71,011
boolean (@NotNull PsiExpression qualifier, @NotNull PsiExpression expression) { if (!qualifier.isValid() || qualifier.getText() == null) { return false; } return !(expression.getParent() instanceof PsiExpressionStatement) && !PsiUtil.isAccessedForWriting(expression); }
isAvailable
71,012
String (@NotNull PsiExpression expression) { PsiType type = expression.getType(); return PsiTypesUtil.getDefaultValueOfType(type); }
suggestDefaultValue
71,013
String () { return JavaBundle.message("inspection.replace.methodref.ternary.quickfix"); }
getFamilyName
71,014
void (@NotNull Project project, @NotNull PsiElement startElement, @NotNull ModPsiUpdater updater) { PsiMethodReferenceExpression element = ObjectUtils.tryCast(startElement, PsiMethodReferenceExpression.class); if (element == null) return; PsiLambdaExpression lambda = LambdaRefactoringUtil.convertMethodReferenceToLambda...
applyFix
71,015
PsiClass (@NotNull PsiElement element) { // We use java.util.Objects for code generation, but it's absent before Java 7 if (!PsiUtil.isLanguageLevel7OrHigher(element)) return null; PsiJavaFile maybeRecord = (PsiJavaFile)PsiFileFactory.getInstance(element.getProject()) .createFileFromText("Dummy.java", JavaLanguage.INST...
tryMakeRecord
71,016
void (@NotNull ActionContext context, @NotNull PsiElement startElement, @NotNull ModPsiUpdater updater) { PsiClass recordClass; PsiElement toReplace = startElement; if (startElement instanceof PsiJavaCodeReferenceElement ref && ref.textMatches("record")) { PsiMethod method = PsiTreeUtil.getParentOfType(startElement, Ps...
invoke
71,017
String (@NotNull PsiClass recordClass) { PsiField lastField = StreamEx.ofReversed(recordClass.getFields()).findFirst(field -> field.hasModifierProperty(PsiModifier.STATIC)).orElse(null); PsiMethod lastMethod = StreamEx.ofReversed(recordClass.getMethods()).findFirst(method -> !(method instanceof SyntheticElement)).orEls...
generateText
71,018
String (PsiClass recordClass, PsiElement child) { if (child instanceof PsiKeyword && ((PsiKeyword)child).getTokenType().equals(JavaTokenType.RECORD_KEYWORD)) { PsiModifierList modifierList = Objects.requireNonNull(recordClass.getModifierList()); String text = "class"; if (!modifierList.hasExplicitModifier(PsiModifier.F...
getChildText
71,019
void (PsiClass recordClass, PsiClass converted) { PsiRecordComponent[] components = recordClass.getRecordComponents(); Map<String, PsiRecordComponent> componentMap = StreamEx.of(components).toMap(c -> c.getName(), c -> c, (a, b) -> a); boolean serializableRecord = SerializationUtils.isSerializable(recordClass); for (Ps...
postProcessAnnotations
71,020
void (PsiClass recordClass, PsiField convertedField) { // converted field may have wrong annotation fqn, so we have to find the origin field at first PsiField originSerialVersionUIDField = getSerialVersionUIDField(recordClass); if (originSerialVersionUIDField == null || !originSerialVersionUIDField.hasAnnotation(Common...
postProcessSerialVersionUIDFieldAnnotations
71,021
void (Map<String, PsiRecordComponent> componentMap, PsiField field) { if (field.hasModifierProperty(PsiModifier.STATIC)) return; PsiRecordComponent component = componentMap.get(field.getName()); if (component == null) return; copyAnnotations(field, component, PsiAnnotation.TargetType.FIELD); }
postProcessFieldAnnotations
71,022
void (PsiClass recordClass, Map<String, PsiRecordComponent> componentMap, PsiMethod method) { if (method.hasModifierProperty(PsiModifier.STATIC)) return; if (method.isConstructor()) { PsiMethod recordCtor = recordClass.findMethodBySignature(method, false); // Record constructor is generated with all component annotatio...
postProcessMethodAnnotations
71,023
void (PsiModifierListOwner modifierListOwner, PsiRecordComponent component, PsiAnnotation.TargetType targetType) { for (PsiAnnotation annotation : component.getAnnotations()) { String qualifiedName = annotation.getQualifiedName(); if (qualifiedName == null || AnnotationTargetUtil.findAnnotationTarget(annotation, PsiAnn...
copyAnnotations
71,024
void (StringBuilder result, PsiMethod canonicalConstructor, PsiClass psiClass) { if (canonicalConstructor instanceof SyntheticElement) { PsiDocComment docComment = psiClass.getDocComment(); if (docComment != null) { PsiDocTag[] params = docComment.findTagsByName("param"); PsiDocComment ctorComment = JavaPsiFacade.getEl...
insertConstructor
71,025
void (StringBuilder result, PsiClass psiClass, PsiRecordComponent @NotNull [] components) { boolean hasEquals = false, hasHashCode = false, hasToString = false; for (PsiMethod method : psiClass.getMethods()) { if (method instanceof SyntheticElement && JavaPsiRecordUtil.getRecordComponentForAccessor(method) != null) { r...
insertMethods
71,026
String (PsiClass psiClass, PsiRecordComponent @NotNull [] components) { String toStringExpression = components.length == 0 ? '"' + psiClass.getName() + "[]\"" : '"' + psiClass.getName() + "[\"+\n" + StreamEx.of(components).map(c -> '"' + c.getName() + "=\"+" + c.getName()).joining("+\", \"+\n") + "+']'"; return "@" + C...
generateToString
71,027
String (PsiRecordComponent @NotNull [] components) { String hashExpression = components.length == 0 ? "1" : CommonClassNames.JAVA_UTIL_OBJECTS + ".hash(" + StreamEx.of(components).map(c -> c.getName()).joining(",") + ")"; return "@" + CommonClassNames.JAVA_LANG_OVERRIDE + "\n" + "public int hashCode() {\n" + "return " ...
generateHashCode
71,028
String (PsiClass psiClass, PsiRecordComponent @NotNull [] components) { String equalsExpression = StreamEx.of(components).map(c -> generateEqualsExpression(c)).joining(" &&\n"); String body = components.length == 0 ? "return obj == this || obj != null && obj.getClass() == this.getClass();" : "if(obj == this) return tru...
generateEquals
71,029
String (PsiRecordComponent component) { PsiType type = component.getType(); if (type instanceof PsiPrimitiveType) { if (TypeConversionUtil.isIntegralNumberType(type) || type.equals(PsiTypes.booleanType())) { return "this." + component.getName() + "==that." + component.getName(); } if (TypeConversionUtil.isFloatOrDouble...
generateEqualsExpression
71,030
void (StringBuilder result, PsiClass recordClass) { if (SerializationUtils.isSerializable(recordClass)) { if (getSerialVersionUIDField(recordClass) == null) { result.append(AddSerialVersionUIDFix.generateSerialVersionUIDFieldText(0)).append("\n"); } } for (PsiRecordComponent component : recordClass.getRecordComponents(...
insertFields
71,031
PsiField (@NotNull PsiClass recordClass) { return recordClass.findFieldByName(SERIAL_VERSION_UID_FIELD_NAME, false); }
getSerialVersionUIDField
71,032
String () { return InspectionsBundle.message("group.names.language.level.specific.issues.and.migration.aids"); }
getGroupDisplayName
71,033
boolean () { return true; }
isEnabledByDefault
71,034
String () { return "Anonymous2MethodRef"; }
getShortName
71,035
OptPane () { return pane( checkbox("reportNotAnnotatedInterfaces", JavaAnalysisBundle.message("report.when.interface.is.not.annotated.with.functional.interface"))); }
getOptionsPane
71,036
PsiElementVisitor (@NotNull final ProblemsHolder holder, boolean isOnTheFly) { return new JavaElementVisitor() { @Override public void visitAnonymousClass(@NotNull PsiAnonymousClass aClass) { super.visitAnonymousClass(aClass); if (AnonymousCanBeLambdaInspection.canBeConvertedToLambda(aClass, true, reportNotAnnotatedInt...
buildVisitor
71,037
void (@NotNull PsiAnonymousClass aClass) { super.visitAnonymousClass(aClass); if (AnonymousCanBeLambdaInspection.canBeConvertedToLambda(aClass, true, reportNotAnnotatedInterfaces, Collections.emptySet())) { final PsiMethod method = aClass.getMethods()[0]; final PsiCodeBlock body = method.getBody(); MethodReferenceCandi...
visitAnonymousClass
71,038
String () { return JavaBundle.message("quickfix.family.replace.with.method.reference"); }
getFamilyName
71,039
void (@NotNull Project project, @NotNull PsiElement element, @NotNull ModPsiUpdater updater) { if (element instanceof PsiNewExpression newExpression) { final PsiAnonymousClass anonymousClass = newExpression.getAnonymousClass(); if (anonymousClass == null) return; final PsiMethod[] methods = anonymousClass.getMethods();...
applyFix
71,040
void (@NotNull Project project, String methodRefText, PsiType castType, PsiElement replacementTarget) { final Collection<PsiComment> comments = ContainerUtil.map(PsiTreeUtil.findChildrenOfType(replacementTarget, PsiComment.class), comment -> (PsiComment)comment.copy()); if (methodRefText != null) { final String canonic...
replaceWithMethodReference
71,041
String () { return JavaBundle.message("inspection.assert.quickfix", myText); }
getName
71,042
void (@NotNull Project project, @NotNull PsiElement element, @NotNull ModPsiUpdater updater) { PsiExpression expr = PsiTreeUtil.getNonStrictParentOfType(element, PsiExpression.class); if (expr == null) return; CodeBlockSurrounder surrounder = CodeBlockSurrounder.forExpression(expr); if (surrounder == null) return; Code...
applyFix
71,043
String () { return JavaBundle.message("inspection.quickfix.assert.family"); }
getFamilyName
71,044
String () { return QuickFixBundle.message("move.class.to.package.family"); }
getFamilyName
71,045
MoveToPackageFix (@Nullable PsiFile myFile, @Nullable String targetPackage) { if (myFile == null || !myFile.isValid() || !myFile.getManager().isInProject(myFile) || !(myFile instanceof PsiJavaFile) || ((PsiJavaFile)myFile).getClasses().length == 0 || targetPackage == null) { return null; } return new MoveToPackageFix(m...
createIfAvailable
71,046
void (@NotNull Project project, @NotNull PsiFile file, @Nullable Editor editor, @NotNull PsiElement startElement, @NotNull PsiElement endElement) { PsiFile myFile = startElement.getContainingFile(); if (!FileModificationService.getInstance().prepareFileForWrite(myFile)) return; try { String error; PsiDirectory director...
invoke
71,047
boolean () { return false; }
startInWriteAction
71,048
String (Project project) { return DEFAULT_UNTAINTED_ANNOTATION; }
getName
71,049
boolean (PsiModifierListOwner owner) { return (owner instanceof PsiMethod || owner instanceof PsiLocalVariable) && !owner.hasAnnotation(DEFAULT_TAINTED_ANNOTATION) && !owner.hasAnnotation(DEFAULT_POLY_TAINTED_ANNOTATION); }
isAvailable
71,050
String () { return JavaBundle.message("inspection.replace.with.trivial.lambda.fix.name", myValue); }
getName
71,051
String () { return JavaBundle.message("inspection.replace.with.trivial.lambda.fix.family.name"); }
getFamilyName
71,052
void (@NotNull Project project, @NotNull PsiElement element, @NotNull ModPsiUpdater updater) { PsiMethodReferenceExpression methodRef = ObjectUtils.tryCast(element, PsiMethodReferenceExpression.class); if (methodRef == null) return; PsiLambdaExpression lambdaExpression = LambdaRefactoringUtil.convertMethodReferenceToLa...
applyFix
71,053
PsiElementVisitor (@NotNull ProblemsHolder holder, boolean isOnTheFly) { if (!PsiUtil.isLanguageLevel8OrHigher(holder.getFile())) { return PsiElementVisitor.EMPTY_VISITOR; } return new JavaElementVisitor() { @Override public void visitMethodCallExpression(@NotNull PsiMethodCallExpression call) { if (THEN_COMPARING_COMP...
buildVisitor
71,054
void (@NotNull PsiMethodCallExpression call) { if (THEN_COMPARING_COMPARATOR.test(call)) { checkThenComparing(call); } if (COMPARATOR_COMPARING.test(call)) { PsiExpression arg = call.getArgumentList().getExpressions()[0]; PsiElement nameElement = Objects.requireNonNull(call.getMethodExpression().getReferenceNameElement...
visitMethodCallExpression
71,055
void (@NotNull PsiMethodCallExpression call) { PsiMethodCallExpression comparingCall = tryCast(PsiUtil.skipParenthesizedExprDown(call.getArgumentList().getExpressions()[0]), PsiMethodCallExpression.class); String targetMethod = REPLACEMENTS.mapFirst(comparingCall); if (targetMethod == null) return; PsiExpressionList co...
checkThenComparing
71,056
String () { return myTargetMethod.equals("thenComparing") ? JavaBundle.message("inspection.simplifiable.comparator.fix.remove.name", mySourceMethod) : JavaBundle.message("inspection.simplifiable.comparator.fix.replace.name", mySourceMethod, myTargetMethod); }
getName
71,057
String () { return JavaBundle.message("inspection.simplifiable.comparator.fix.comparing.family.name"); }
getFamilyName
71,058
void (@NotNull Project project, @NotNull PsiElement element, @NotNull ModPsiUpdater updater) { PsiMethodCallExpression comparingCall = PsiTreeUtil.getParentOfType(element, PsiMethodCallExpression.class); if (comparingCall == null) return; PsiMethodCallExpression thenComparingCall = PsiTreeUtil.getParentOfType(comparing...
applyFix
71,059
String () { return JavaBundle.message("inspection.simplifiable.comparator.fix.reversed.name", myReplacement); }
getName
71,060
String () { return JavaBundle.message("inspection.simplifiable.comparator.fix.reversed.family.name"); }
getFamilyName
71,061
void (@NotNull Project project, @NotNull PsiElement element, @NotNull ModPsiUpdater updater) { PsiMethodCallExpression call = PsiTreeUtil.getParentOfType(element, PsiMethodCallExpression.class); if (call == null) return; PsiExpression comparator = ArrayUtil.getLastElement(call.getArgumentList().getExpressions()); if (c...
applyFix
71,062
String () { return CommonQuickFixBundle.message("fix.replace.with.x", "Entry."+myReplacementMethod+"()"); }
getName
71,063
String () { return JavaBundle.message("inspection.simplifiable.comparator.fix.entry.comparator.family.name"); }
getFamilyName
71,064
void (@NotNull Project project, @NotNull PsiElement element, @NotNull ModPsiUpdater updater) { PsiMethodCallExpression call = PsiTreeUtil.getParentOfType(element, PsiMethodCallExpression.class); if (call == null) return; String params = getGenericParameters(call); PsiExpression[] args = call.getArgumentList().getExpres...
applyFix
71,065
String (PsiMethodCallExpression call) { PsiClassType callType = tryCast(call.getType(), PsiClassType.class); if (!PsiTypesUtil.classNameEquals(callType, JAVA_UTIL_COMPARATOR)) return ""; PsiType[] parameters = callType.getParameters(); if (parameters.length != 1) return ""; PsiClassType entryClass = tryCast(parameters[...
getGenericParameters
71,066
PsiElementVisitor (@NotNull ProblemsHolder holder, boolean isOnTheFly) { return new JavaElementVisitor() { @Override public void visitMethodCallExpression(@NotNull PsiMethodCallExpression call) { if (!COMPARE_METHOD.test(call)) return; checkComparison(call); PsiElement parent = PsiUtil.skipParenthesizedExprUp(call.getP...
buildVisitor
71,067
void (@NotNull PsiMethodCallExpression call) { if (!COMPARE_METHOD.test(call)) return; checkComparison(call); PsiElement parent = PsiUtil.skipParenthesizedExprUp(call.getParent()); if (parent instanceof PsiLocalVariable var) { PsiCodeBlock block = PsiTreeUtil.getParentOfType(var, PsiCodeBlock.class); PsiExpression init...
visitMethodCallExpression
71,068
void (PsiElement compareExpression) { PsiBinaryExpression binOp = ObjectUtils.tryCast(PsiUtil.skipParenthesizedExprUp(compareExpression.getParent()), PsiBinaryExpression.class); if (binOp == null) return; PsiJavaToken sign = binOp.getOperationSign(); IElementType tokenType = sign.getTokenType(); RelationType relation =...
checkComparison
71,069
boolean (LongRangeSet testedRange, LongRangeSet coveredRange) { LongRangeSet intersection = testedRange.meet(coveredRange); return !intersection.isEmpty() && !coveredRange.subtract(intersection).isEmpty(); }
coversPartially
71,070
void (PsiJavaToken sign, boolean yodaCondition, RelationType relationType) { LocalQuickFix[] fixes = relationType == null ? LocalQuickFix.EMPTY_ARRAY : new LocalQuickFix[]{new ComparatorComparisonFix(yodaCondition, relationType)}; holder.registerProblem(sign, JavaBundle.message("inspection.comparator.result.comparison....
register
71,071
String () { return CommonQuickFixBundle.message("fix.replace.with.x", getReplacement()); }
getName
71,072
String () { return myYodaCondition ? "0 " + myRelation.getFlipped() : myRelation + " 0"; }
getReplacement
71,073
String () { return JavaBundle.message("inspection.comparator.result.comparison.fix.family.name"); }
getFamilyName
71,074
void (@NotNull Project project, @NotNull PsiElement element, @NotNull ModPsiUpdater updater) { PsiBinaryExpression binOp = PsiTreeUtil.getParentOfType(element, PsiBinaryExpression.class); if (binOp == null) return; CommentTracker ct = new CommentTracker(); String replacement; if(myYodaCondition) { PsiExpression operand...
applyFix
71,075
String () { return JavaBundle.message("intention.family.name.move.class.to.test.root"); }
getFamilyName
71,076
boolean (PsiFile file) { if (file == null || !file.isValid() || !(file instanceof PsiJavaFile)) return false; VirtualFile virtualFile = PsiUtilCore.getVirtualFile(file); if (virtualFile == null) return false; Module module = ModuleUtilCore.findModuleForFile(virtualFile, file.getProject()); if (module == null) return fa...
isAvailable
71,077
Stream<SourceFolder> (ModuleRootManager rootManager) { return Arrays.stream(rootManager.getContentEntries()) .flatMap(entry -> Arrays.stream(entry.getSourceFolders())) .filter(SourceFolder::isTestSource); }
getTestRoots
71,078
void (@NotNull Project project, @NotNull PsiFile file, @Nullable Editor editor, @NotNull PsiElement startElement, @NotNull PsiElement endElement) { final PsiFile myFile = startElement.getContainingFile(); if (!FileModificationService.getInstance().prepareFileForWrite(myFile)) return; Module module = ModuleUtilCore.find...
invoke
71,079
boolean () { return false; }
startInWriteAction
71,080
String () { return JavaBundle.message("inspection.unused.assignment.remove.initializer.quickfix"); }
getFamilyName
71,081
ModCommand (@NotNull Project project, @NotNull ProblemDescriptor descriptor) { if (!(descriptor.getPsiElement() instanceof PsiExpression initializer)) return ModCommand.nop(); if (!(initializer.getParent() instanceof PsiVariable variable)) return ModCommand.nop(); List<ModCommandAction> subActions; List<PsiExpression> ...
perform
71,082
void (@NotNull ActionContext context, @NotNull PsiExpression initializer, @NotNull ModPsiUpdater updater) { invoke(initializer); }
invoke
71,083
void (@NotNull PsiExpression initializer) { PsiVariable origVar = initializer.getParent() instanceof PsiVariable v ? v: initializer.getParent() instanceof PsiAssignmentExpression assignment && assignment.getLExpression() instanceof PsiReferenceExpression ref && ref.resolve() instanceof PsiVariable v ? v : null; List<Ps...
invoke
71,084
void (@NotNull PsiExpression initializer, List<PsiExpression> sideEffects) { if (initializer.getParent() instanceof PsiAssignmentExpression assignment) { if (assignment.getParent() instanceof PsiExpressionList list) { for (PsiExpression effect : sideEffects) { list.addBefore(effect, assignment); } assignment.delete(); ...
tryProcessExpressionList
71,085
void (@NotNull PsiExpression expression) { new SideEffectAwareRemove(expression).invoke(expression); }
remove
71,086
String () { return QuickFixBundle.message("extract.side.effects.family.name"); }
getFamilyName
71,087
PsiElementVisitor (@NotNull ProblemsHolder holder, boolean isOnTheFly) { if (!PsiUtil.getLanguageLevel(holder.getFile()).isAtLeast(LanguageLevel.JDK_10)) { return PsiElementVisitor.EMPTY_VISITOR; } return new JavaElementVisitor() { @Override public void visitLocalVariable(@NotNull PsiLocalVariable variable) { PsiTypeEl...
buildVisitor
71,088
void (@NotNull PsiLocalVariable variable) { PsiTypeElement typeElement = variable.getTypeElement(); if (!typeElement.isInferredType()) { PsiElement parent = variable.getParent(); if (parent instanceof PsiDeclarationStatement && ((PsiDeclarationStatement)parent).getDeclaredElements().length > 1) { return; } PsiExpressio...
visitLocalVariable
71,089
void (@NotNull PsiForeachStatement statement) { super.visitForeachStatement(statement); PsiParameter parameter = statement.getIterationParameter(); PsiTypeElement typeElement = parameter.getTypeElement(); if (typeElement != null && !typeElement.isInferredType()) { PsiForeachStatement copy = (PsiForeachStatement)stateme...
visitForeachStatement
71,090
void (@NotNull PsiPatternVariable variable) { PsiPattern deconstructionComponent = variable.getPattern(); if (deconstructionComponent.getParent() instanceof PsiDeconstructionList deconstructionList && deconstructionList.getParent() instanceof PsiDeconstructionPattern deconstruction) { PsiTypeElement typeElement = varia...
visitPatternVariable
71,091
void (PsiVariable variable, PsiVariable copyVariable, PsiTypeElement element2Highlight) { ArrayList<PsiAnnotation> typeUseAnnotations = new ArrayList<>(); AnnotationTargetUtil.collectStrictlyTypeUseAnnotations(copyVariable.getModifierList(), typeUseAnnotations); if (!typeUseAnnotations.isEmpty()) return; PsiTypeElement...
doCheck
71,092
PsiType (PsiVariable copyVariable) { PsiType type = copyVariable.getType(); PsiClass refClass = PsiUtil.resolveClassInType(type); if (refClass instanceof PsiAnonymousClass anonymousClass) { type = anonymousClass.getBaseClassType(); } return type; }
getNormalizedType
71,093
String () { return InspectionGadgetsBundle.message("replace.with.var.fix.family.name"); }
getFamilyName
71,094
void (@NotNull Project project, @NotNull PsiElement element, @NotNull ModPsiUpdater updater) { if (element instanceof PsiTypeElement typeElement) { CodeStyleManager.getInstance(project) .reformat(IntroduceVariableUtil.expandDiamondsAndReplaceExplicitTypeWithVar(typeElement, element)); } }
applyFix
71,095
String () { return JavaBundle.message("inspection.data.flow.filter.notnull.quickfix"); }
getFamilyName
71,096
void (@NotNull Project project, @NotNull PsiElement element, @NotNull ModPsiUpdater updater) { PsiFunctionalExpression function = findFunction(element); if (function == null) return; PsiMethodCallExpression call = PsiTreeUtil.getParentOfType(function, PsiMethodCallExpression.class); if (call == null) return; PsiExpress...
applyFix
71,097
String (@NotNull PsiFunctionalExpression function, @NotNull PsiExpression qualifier) { String name = null; if (function instanceof PsiLambdaExpression) { PsiParameter parameter = ArrayUtil.getFirstElement(((PsiLambdaExpression)function).getParameterList().getParameters()); if (parameter != null) { name = parameter.getN...
suggestVariableName
71,098
PsiFunctionalExpression (PsiElement reference) { if (reference instanceof PsiFunctionalExpression) { return (PsiFunctionalExpression)reference; } if (reference instanceof PsiIdentifier) { // in "str.trim()" go from "trim" to "str" reference = reference.getParent(); if (reference instanceof PsiReferenceExpression) { ref...
findFunction
71,099
StreamFilterNotNullFix (PsiElement reference) { PsiFunctionalExpression fn = findFunction(reference); if (fn == null) return null; PsiExpressionList args = tryCast(PsiUtil.skipParenthesizedExprUp(fn.getParent()), PsiExpressionList.class); if (args == null || args.getExpressionCount() != 1) return null; PsiMethodCallExp...
makeFix