Package io.codemodder.codemods
Class ReplaceStreamCollectorsToListCodemod
java.lang.Object
io.codemodder.javaparser.JavaParserChanger
io.codemodder.providers.sonar.SonarPluginJavaParserChanger<com.github.javaparser.ast.expr.MethodCallExpr>
io.codemodder.codemods.ReplaceStreamCollectorsToListCodemod
- All Implemented Interfaces:
io.codemodder.CodeChanger
@Codemod(id="sonar:java/replace-stream-collectors-to-list-s6204",
reviewGuidance=MERGE_WITHOUT_REVIEW,
importance=LOW,
executionPriority=HIGH)
public final class ReplaceStreamCollectorsToListCodemod
extends io.codemodder.providers.sonar.SonarPluginJavaParserChanger<com.github.javaparser.ast.expr.MethodCallExpr>
A codemod for replacing 'Stream.collect(Collectors.toList())' with 'Stream.toList()'
-
Field Summary
Fields inherited from class io.codemodder.javaparser.JavaParserChanger
reporter
-
Constructor Summary
ConstructorsConstructorDescriptionReplaceStreamCollectorsToListCodemod
(io.codemodder.providers.sonar.RuleIssues issues) -
Method Summary
Modifier and TypeMethodDescriptionboolean
onIssueFound
(io.codemodder.CodemodInvocationContext context, com.github.javaparser.ast.CompilationUnit cu, com.github.javaparser.ast.expr.MethodCallExpr methodCallExpr, io.codemodder.providers.sonar.api.Issue issue) Methods inherited from class io.codemodder.providers.sonar.SonarPluginJavaParserChanger
shouldRun, visit
Methods inherited from class io.codemodder.javaparser.JavaParserChanger
dependenciesRequired, getDescription, getIndividualChangeDescription, getReferences, getSummary
-
Constructor Details
-
ReplaceStreamCollectorsToListCodemod
@Inject public ReplaceStreamCollectorsToListCodemod(@ProvidedSonarScan(ruleId="java:S6204") io.codemodder.providers.sonar.RuleIssues issues)
-
-
Method Details
-
onIssueFound
public boolean onIssueFound(io.codemodder.CodemodInvocationContext context, com.github.javaparser.ast.CompilationUnit cu, com.github.javaparser.ast.expr.MethodCallExpr methodCallExpr, io.codemodder.providers.sonar.api.Issue issue) - Specified by:
onIssueFound
in classio.codemodder.providers.sonar.SonarPluginJavaParserChanger<com.github.javaparser.ast.expr.MethodCallExpr>
-