Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
36,600
BaseInspectionVisitor () { return new Visitor(); }
buildVisitor
36,601
LocalQuickFix (@NotNull PsiElement location) { return new ReplaceWithPropertyAccessFix(); }
buildFix
36,602
String () { return GroovyBundle.message("intention.family.name.replace.with.keyed.access"); }
getFamilyName
36,603
void (@NotNull Project project, @NotNull PsiElement referenceName, @NotNull ModPsiUpdater updater) { final GrReferenceExpression invokedExpression = (GrReferenceExpression) referenceName.getParent(); final GrMethodCallExpression callExpression = (GrMethodCallExpression) invokedExpression.getParent(); final GrArgumentLi...
applyFix
36,604
void (@NotNull GrMethodCallExpression grMethodCallExpression) { super.visitMethodCallExpression(grMethodCallExpression); final GrArgumentList args = grMethodCallExpression.getArgumentList(); if (args.getExpressionArguments().length != 1) { return; } if (PsiImplUtil.hasNamedArguments(args)) { return; } final GrExpressio...
visitMethodCallExpression
36,605
String (Object... args) { return GroovyBundle.message("inspection.message.call.to.ref.can.be.keyed.access"); }
buildErrorString
36,606
BaseInspectionVisitor () { return new Visitor(); }
buildVisitor
36,607
LocalQuickFix (@NotNull PsiElement location) { return new ReplaceWithPropertyAccessFix(); }
buildFix
36,608
String () { return GroovyBundle.message("intention.family.name.replace.with.keyed.access"); }
getFamilyName
36,609
void (@NotNull Project project, @NotNull PsiElement referenceName, @NotNull ModPsiUpdater updater) { final GrReferenceExpression invokedExpression = (GrReferenceExpression) referenceName.getParent(); final GrMethodCallExpression callExpression = (GrMethodCallExpression) invokedExpression.getParent(); final GrArgumentLi...
applyFix
36,610
void (@NotNull GrMethodCallExpression grMethodCallExpression) { super.visitMethodCallExpression(grMethodCallExpression); final GrArgumentList args = grMethodCallExpression.getArgumentList(); if (args.getExpressionArguments().length != 2) { return; } if (PsiImplUtil.hasNamedArguments(args)) { return; } final GrExpressio...
visitMethodCallExpression
36,611
String (Object... args) { return GroovyBundle.message("inspection.message.call.to.ref.can.be.keyed.access"); }
buildErrorString
36,612
BaseInspectionVisitor () { return new Visitor(); }
buildVisitor
36,613
LocalQuickFix (@NotNull PsiElement location) { return fix; }
buildFix
36,614
String () { return GroovyBundle.message("intention.family.name.replace.with.keyed.access"); }
getFamilyName
36,615
void (@NotNull Project project, @NotNull PsiElement referenceName, @NotNull ModPsiUpdater updater) { final GrReferenceExpression invokedExpression = (GrReferenceExpression) referenceName.getParent(); final GrMethodCallExpression callExpression = (GrMethodCallExpression) invokedExpression.getParent(); final GrArgumentLi...
applyFix
36,616
void (@NotNull GrMethodCallExpression grMethodCallExpression) { super.visitMethodCallExpression(grMethodCallExpression); final GrArgumentList args = grMethodCallExpression.getArgumentList(); if (args.getExpressionArguments().length != 2) { return; } if (PsiImplUtil.hasNamedArguments(args)) { return; } final GrExpressio...
visitMethodCallExpression
36,617
String (Object... args) { return GroovyBundle.message("inspection.message.call.to.ref.can.be.keyed.access"); }
buildErrorString
36,618
BaseInspectionVisitor () { return new Visitor(); }
buildVisitor
36,619
LocalQuickFix (@NotNull PsiElement location) { return new ReplaceWithPropertyAccessFix(); }
buildFix
36,620
String () { return GroovyBundle.message("intention.family.name.replace.with.keyed.access"); }
getFamilyName
36,621
void (@NotNull Project project, @NotNull PsiElement referenceName, @NotNull ModPsiUpdater updater) { final GrReferenceExpression invokedExpression = (GrReferenceExpression) referenceName.getParent(); final GrMethodCallExpression callExpression = (GrMethodCallExpression) invokedExpression.getParent(); final GrArgumentLi...
applyFix
36,622
void (@NotNull GrMethodCallExpression grMethodCallExpression) { super.visitMethodCallExpression(grMethodCallExpression); final GrArgumentList args = grMethodCallExpression.getArgumentList(); if (args.getExpressionArguments().length != 1) { return; } if (PsiImplUtil.hasNamedArguments(args)) { return; } final GrExpressio...
visitMethodCallExpression
36,623
GroovyElementVisitor (@NotNull ProblemsHolder holder, boolean isOnTheFly) { return new GroovyElementVisitor() { @Override public void visitReferenceExpression(@NotNull GrReferenceExpression refExpression) { checkForSecondUnsafeCall(refExpression, holder); } }; }
buildGroovyVisitor
36,624
void (@NotNull GrReferenceExpression refExpression) { checkForSecondUnsafeCall(refExpression, holder); }
visitReferenceExpression
36,625
void (GrExpression expression, ProblemsHolder holder) { checkForSecondUnsafeCall(expression, holder, null); }
checkForSecondUnsafeCall
36,626
void (GrExpression expression, ProblemsHolder holder, @Nullable PsiElement highlightElement) { if (highlightElement == null) highlightElement = expression; final GrReferenceExpression referenceExpression = (GrReferenceExpression)expression; if (GroovyTokenTypes.mDOT.equals(referenceExpression.getDotTokenType())) { if (...
checkForSecondUnsafeCall
36,627
boolean (GrExpression qualifier) { GrExpression newQualifier = qualifier; while (newQualifier != null) { GrReferenceExpression innerRefExpr = getReferenceExpression(newQualifier); if (innerRefExpr == null) { return false; } IElementType dotToken = innerRefExpr.getDotTokenType(); if (GroovyTokenTypes.mOPTIONAL_CHAIN_DOT...
isNullableQualifier
36,628
BaseInspectionVisitor () { return new BaseInspectionVisitor() { @Override public void visitMethodCallExpression(@NotNull GrMethodCallExpression methodCall) { final GrExpression invokedExpression = methodCall.getInvokedExpression(); if (!(invokedExpression instanceof GrReferenceExpression referenceExpression)) return; i...
buildVisitor
36,629
void (@NotNull GrMethodCallExpression methodCall) { final GrExpression invokedExpression = methodCall.getInvokedExpression(); if (!(invokedExpression instanceof GrReferenceExpression referenceExpression)) return; if (referenceExpression.getDotTokenType() != GroovyTokenTypes.mDOT) return; final PsiElement highlightEleme...
visitMethodCallExpression
36,630
String (@NotNull GrMethodCall methodCall) { PsiMethod method = methodCall.resolveMethod(); if (method == null || method.hasModifierProperty(PsiModifier.STATIC)) return null; return method.getName(); }
getMethodName
36,631
String () { return GroovyBundle.message("replace.with.operator.fix", methodName); }
getFamilyName
36,632
void (@NotNull Project project, @NotNull PsiElement element, @NotNull ModPsiUpdater updater) { PsiElement call = element.getParent(); if (call == null) return; call = call.getParent(); if (!(call instanceof GrMethodCall methodCall)) return; GrExpression invokedExpression = methodCall.getInvokedExpression(); if (!(invok...
applyFix
36,633
OptPane () { return pane( checkbox("useDoubleNegation", GroovyBundle.message("replace.with.operator.double.negation.option")), checkbox("shouldChangeCompareToEqualityToEquals", GroovyBundle.message("replace.with.operator.compareTo.equality.option")), checkbox("withoutAdditionalParentheses", GroovyBundle.message("replac...
getGroovyOptionsPane
36,634
Options () { return new Options(useDoubleNegation, shouldChangeCompareToEqualityToEquals, withoutAdditionalParentheses); }
getOptions
36,635
boolean () { return useDoubleNegation; }
useDoubleNegation
36,636
boolean () { return shouldChangeCompareToEqualityToEquals; }
shouldChangeCompareToEqualityToEquals
36,637
boolean () { return withoutAdditionalParentheses; }
withoutAdditionalParentheses
36,638
void (@NotNull GrMethodCall methodCall, @NotNull Options options) { GrExpression rhs = getRhs(methodCall); GrExpression rhsParenthesized = checkPrecedenceForNonBinaryOps(rhs, RELATIONAL_PRECEDENCE) ? parenthesize(rhs) : rhs; GrExpression replacedElement = methodCall; IElementType changeToOperator = shouldChangeToOperat...
apply
36,639
IElementType (@NotNull GrMethodCall call, Options options) { PsiElement parent = call.getParent(); if (isComparison(parent) && isZero(((GrBinaryExpression)parent).getRightOperand())) { IElementType token = ((GrBinaryExpression)parent).getOperationTokenType(); if (isEquality(token) && !options.shouldChangeCompareToEqual...
shouldChangeToOperator
36,640
boolean (IElementType comparison) { return (comparison == mNOT_EQUAL) || (comparison == mEQUAL); }
isEquality
36,641
boolean (@NotNull GrMethodCall methodCall, @NotNull Options options) { return super.couldApplyInternal(methodCall, options) && shouldChangeToOperator(methodCall, options) != null; }
couldApplyInternal
36,642
boolean (@NotNull GrMethodCall methodCall, @NotNull Options options) { GrExpression rhs = getRhs(methodCall); return checkPrecedenceForNonBinaryOps(rhs, RELATIONAL_PRECEDENCE) || checkPrecedence(RELATIONAL_PRECEDENCE, methodCall); }
needParentheses
36,643
void (@NotNull GrMethodCall methodCall, @NotNull Options options) { String result = format("%s[%s]", getLhs(methodCall).getText(), getRhs(methodCall).getText()); replaceExpression(methodCall, result); }
apply
36,644
boolean (@NotNull GrMethodCall methodCall, @NotNull Options options) { return checkPrecedence(METHOD_CALL_PRECEDENCE, methodCall); }
needParentheses
36,645
String () { return myOperator.toString(); }
getOperatorText
36,646
void (@NotNull GrMethodCall methodCall, @NotNull Options options) { GrExpression rhs = getRhs(methodCall); rhs = checkPrecedenceForBinaryOps(getPrecedence(rhs), myOperator, true) ? parenthesize(rhs) : rhs; replaceExpression(methodCall, format("%s %s %s", getLhs(methodCall).getText(), getOperatorText(), rhs.getText()));...
apply
36,647
boolean (@NotNull GrMethodCall methodCall, @NotNull Options options) { GrExpression rhs = getRhs(methodCall); int rhsPrecedence = getPrecedence(rhs); return checkPrecedenceForBinaryOps(rhsPrecedence, myOperator, true) || checkPrecedence(precedenceForBinaryOperator(myOperator), methodCall); }
needParentheses
36,648
void (@NotNull GrMethodCall methodCall, @NotNull Options options) { GrExpression base = requireNonNull(getBase(methodCall)); GrExpression key = getArgument(methodCall, 0); GrExpression rhs = getArgument(methodCall, 1); rhs = checkPrecedenceForNonBinaryOps(rhs, ASSIGNMENT_PRECEDENCE) ? parenthesize(rhs) : rhs; String re...
apply
36,649
boolean (@NotNull GrMethodCall methodCall, @NotNull Options options) { return getBase(methodCall) != null && checkArgumentsCount(methodCall, 2); }
couldApplyInternal
36,650
boolean (@NotNull GrMethodCall methodCall, @NotNull Options options) { GrExpression rhs = methodCall.getExpressionArguments()[1]; return checkPrecedenceForNonBinaryOps(rhs, ASSIGNMENT_PRECEDENCE) || checkPrecedence(ASSIGNMENT_PRECEDENCE, methodCall); }
needParentheses
36,651
String (@NotNull GrMethodCall methodCall, @NotNull Options options) { if (isImplicitlyBoolean(methodCall)) { return ""; } else if (options.useDoubleNegation()) { return DOUBLE_NEGATION; } else { return null; } }
getPrefix
36,652
void (@NotNull GrMethodCall methodCall, @NotNull Options options) { replaceExpression(methodCall, getPrefix(methodCall, options) + requireNonNull(getBase(methodCall)).getText()); }
apply
36,653
boolean (@NotNull GrMethodCall methodCall, @NotNull Options options) { return getBase(methodCall) != null && methodCall.getExpressionArguments().length == 0 && getPrefix(methodCall, options) != null && methodCall.getClosureArguments().length == 0; }
couldApplyInternal
36,654
boolean (@NotNull GrMethodCall methodCall, @NotNull Options options) { String prefix = getPrefix(methodCall, options); return DOUBLE_NEGATION.equals(prefix) && checkPrecedence(PREFIX_PRECEDENCE, methodCall); }
needParentheses
36,655
boolean (GrMethodCall methodCall) { PsiElement parent = methodCall.getParent(); if (parent instanceof GrIfStatement || parent instanceof GrWhileStatement) return true; if (parent instanceof GrConditionalExpression && ((GrConditionalExpression)parent).getCondition().equals(methodCall)) return true; if (parent instanceof...
isImplicitlyBoolean
36,656
void (@NotNull GrMethodCall methodCall, @NotNull Options options) { GrExpression rhs = getRhs(methodCall); GrExpression rhsParenthesized = checkPrecedenceForBinaryOps(getPrecedence(rhs), GroovyTokenTypes.mEQUAL, true) ? parenthesize(rhs) : rhs; GrExpression replacedElement = methodCall; String operator = "=="; if (isNe...
apply
36,657
boolean (@NotNull GrMethodCall methodCall, @NotNull Options options) { GrExpression rhs = getRhs(methodCall); return checkPrecedenceForBinaryOps(getPrecedence(rhs), GroovyTokenTypes.mEQUAL, true) || checkPrecedence(EQUALITY_PRECEDENCE, methodCall); }
needParentheses
36,658
void (@NotNull GrMethodCall methodCall, @NotNull ChangeToOperatorInspection.Options options) { GrReferenceExpression rhs = (GrReferenceExpression) getRhs(methodCall); GrExpression rhsQualifierExpression = rhs.isQualified() ? rhs.getQualifierExpression() : rhs; if (rhsQualifierExpression == null) return; replaceExpressi...
apply
36,659
boolean (@NotNull GrMethodCall methodCall, @NotNull ChangeToOperatorInspection.Options options) { if (!super.couldApplyInternal(methodCall, options)) return false; GrExpression rhs = getRhs(methodCall); return ResolveUtil.resolvesToClass(rhs); }
couldApplyInternal
36,660
boolean (@NotNull GrMethodCall methodCall, @NotNull Options options) { return couldApplyInternal(methodCall, options) && (!options.withoutAdditionalParentheses() || !needParentheses(methodCall, options)); }
couldApply
36,661
GrExpression (@NotNull GrMethodCall callExpression) { GrExpression expression = callExpression.getInvokedExpression(); GrReferenceExpression invokedExpression = (GrReferenceExpression)expression; GrExpression qualifier = invokedExpression.getQualifierExpression(); if (isSuperExpression(qualifier)) return null; return q...
getBase
36,662
boolean (@NotNull GrMethodCall callExpression, int count) { if (callExpression.getNamedArguments().length != 0) return false; return callExpression.getExpressionArguments().length + callExpression.getClosureArguments().length == count; }
checkArgumentsCount
36,663
GrExpression (@NotNull GrMethodCall callExpression, int index) { GrExpression[] expressionArguments = callExpression.getExpressionArguments(); if (index < expressionArguments.length) { return expressionArguments[index]; } return callExpression.getClosureArguments()[index - expressionArguments.length]; }
getArgument
36,664
String () { return myOperatorText; }
getOperatorText
36,665
void (@NotNull GrMethodCall methodCall, @NotNull Options options) { GrExpression rhs = getRhs(methodCall); GrExpression rhsParenthesized = checkPrecedenceForNonBinaryOps(rhs, RELATIONAL_PRECEDENCE) ? parenthesize(rhs) : rhs; replaceExpression(methodCall, format("%s in %s", rhsParenthesized.getText(), getLhs(methodCall)...
apply
36,666
boolean (@NotNull GrMethodCall methodCall, @NotNull Options options) { GrExpression rhs = getRhs(methodCall); return checkPrecedenceForNonBinaryOps(rhs, RELATIONAL_PRECEDENCE) || checkPrecedence(RELATIONAL_PRECEDENCE, methodCall); }
needParentheses
36,667
void (@NotNull GrMethodCall methodCall, @NotNull Options options) { GrInspectionUtil.replaceExpression(methodCall, myOperator.toString() + requireNonNull(getBase(methodCall)).getText()); }
apply
36,668
boolean (@NotNull GrMethodCall methodCall, @NotNull Options options) { return getBase(methodCall)!= null && checkArgumentsCount(methodCall, 0); }
couldApplyInternal
36,669
boolean (@NotNull GrMethodCall methodCall, @NotNull Options options) { return ParenthesesUtils.checkPrecedence(ParenthesesUtils.PREFIX_PRECEDENCE, methodCall); }
needParentheses
36,670
GrExpression (@NotNull GrMethodCall methodCall) { return Objects.requireNonNull(getBase(methodCall)); }
getLhs
36,671
GrExpression (@NotNull GrMethodCall methodCall) { return getArgument(methodCall, 0); }
getRhs
36,672
boolean (@NotNull GrMethodCall methodCall, @NotNull Options options) { return getBase(methodCall) != null && checkArgumentsCount(methodCall, 1); }
couldApplyInternal
36,673
String () { return GroovyBundle.message("java.style.properties.invocation.intention.name"); }
getName
36,674
String () { return GroovyBundle.message("java.style.properties.invocation.intention.family.name"); }
getFamilyName
36,675
void (@NotNull Project project, @NotNull PsiElement element, @NotNull ModPsiUpdater updater) { final PsiElement pparent = element.getParent().getParent(); if (pparent instanceof GrMethodCall call) { JavaStylePropertiesUtil.fixJavaStyleProperty(call); } }
applyFix
36,676
BaseInspectionVisitor () { return new BaseInspectionVisitor() { @Override public void visitMethodCall(@NotNull GrMethodCall methodCall) { if (isFake(methodCall)) return; if (JavaStylePropertiesUtil.isPropertyAccessor(methodCall)) { final String message = GroovyBundle.message("java.style.property.access"); final GrExpre...
buildVisitor
36,677
void (@NotNull GrMethodCall methodCall) { if (isFake(methodCall)) return; if (JavaStylePropertiesUtil.isPropertyAccessor(methodCall)) { final String message = GroovyBundle.message("java.style.property.access"); final GrExpression expression = methodCall.getInvokedExpression(); if (expression instanceof GrReferenceExpre...
visitMethodCall
36,678
boolean (@NotNull PsiElement element) { PsiElement list = element.getParent(); if (!(list instanceof GrModifierList)) return false; PsiElement parent = list.getParent(); // Do not mark public on fields as unnecessary // It may be put there explicitly to prevent getter/setter generation. if (parent instanceof GrVariable...
isRedundant
36,679
String (Object... args) { return GroovyBundle.message("inspection.message.synchronization.on.non.final.field.ref"); }
buildErrorString
36,680
BaseInspectionVisitor () { return new Visitor(); }
buildVisitor
36,681
void (@NotNull GrSynchronizedStatement synchronizedStatement) { super.visitSynchronizedStatement(synchronizedStatement); final GrExpression lock = synchronizedStatement.getMonitor(); if (!(lock instanceof GrReferenceExpression)) { return; } final PsiElement referent = ((PsiReference) lock).resolve(); if (!(referent ins...
visitSynchronizedStatement
36,682
String (Object... args) { return GroovyBundle.message("inspection.message.synchronization.on.ref"); }
buildErrorString
36,683
BaseInspectionVisitor () { return new Visitor(); }
buildVisitor
36,684
void (@NotNull GrSynchronizedStatement synchronizedStatement) { super.visitSynchronizedStatement(synchronizedStatement); final GrExpression lock = synchronizedStatement.getMonitor(); if (lock == null || !(lock instanceof GrReferenceExpression && PsiUtil.isThisReference(lock))) { return; } registerError(lock); }
visitSynchronizedStatement
36,685
String (Object... infos) { return GroovyBundle.message("inspection.message.ref.loop.spins.on.field"); }
buildErrorString
36,686
OptPane () { return pane( checkbox("ignoreNonEmtpyLoops", GroovyBundle.message("checkbox.only.warn.if.loop.empty"))); }
getGroovyOptionsPane
36,687
BaseInspectionVisitor () { return new WhileLoopSpinsOnFieldVisitor(); }
buildVisitor
36,688
void (@NotNull GrWhileStatement statement) { super.visitWhileStatement(statement); final GrStatement body = statement.getBody(); if (ignoreNonEmtpyLoops && !statementIsEmpty(body)) { return; } final GrExpression condition = statement.getCondition(); if (condition == null || !isSimpleFieldComparison(condition)) { return...
visitWhileStatement
36,689
boolean (GrExpression condition) { condition = (GrExpression)PsiUtil.skipParentheses(condition, false); if (condition == null) { return false; } if (isSimpleFieldAccess(condition)) { return true; } if (condition instanceof GrUnaryExpression postfixExpression && ((GrUnaryExpression)condition).isPostfix()) { final GrExpr...
isSimpleFieldComparison
36,690
boolean (GrExpression expression) { expression = (GrExpression)PsiUtil.skipParentheses(expression, false); if (expression == null) { return false; } return expression instanceof PsiLiteralExpression; }
isLiteral
36,691
boolean (GrExpression expression) { expression = (GrExpression)PsiUtil.skipParentheses(expression, false); if (expression == null) { return false; } if (!(expression instanceof GrReferenceExpression reference)) { return false; } final GrExpression qualifierExpression = reference.getQualifierExpression(); if (qualifierE...
isSimpleFieldAccess
36,692
boolean (GrStatement statement) { if (statement == null) { return false; } if (statement instanceof GrBlockStatement blockStatement) { final GrOpenBlock codeBlock = blockStatement.getBlock(); final GrStatement[] codeBlockStatements = codeBlock.getStatements(); for (GrStatement codeBlockStatement : codeBlockStatements) ...
statementIsEmpty
36,693
String (Object... args) { return GroovyBundle.message("inspection.message.call.to.thread.ref"); }
buildErrorString
36,694
BaseInspectionVisitor () { return new Visitor(); }
buildVisitor
36,695
void (@NotNull GrMethodCallExpression grMethodCallExpression) { super.visitMethodCallExpression(grMethodCallExpression); final GrExpression methodExpression = grMethodCallExpression.getInvokedExpression(); if (!(methodExpression instanceof GrReferenceExpression reference)) { return; } final String name = reference.getR...
visitMethodCallExpression
36,696
String (Object... args) { return GroovyBundle.message("inspection.message.call.to.system.ref"); }
buildErrorString
36,697
BaseInspectionVisitor () { return new Visitor(); }
buildVisitor
36,698
void (@NotNull GrMethodCallExpression grMethodCallExpression) { super.visitMethodCallExpression(grMethodCallExpression); final GrExpression methodExpression = grMethodCallExpression.getInvokedExpression(); if (!(methodExpression instanceof GrReferenceExpression reference)) { return; } final String name = reference.getR...
visitMethodCallExpression
36,699
String (Object... infos) { return GroovyBundle.message("inspection.message.double.checked.locking"); }
buildErrorString