Skip to content

Commit

Permalink
refactor: Spaces
Browse files Browse the repository at this point in the history
Use this link to re-run the recipe: https://app.moderne.io/recipes/org.openrewrite.java.format.Spaces?organizationId=T3BlblJld3JpdGU%3D

Co-authored-by: Moderne <team@moderne.io>
  • Loading branch information
jkschneider and TeamModerne committed Sep 26, 2023
1 parent 30a6f5c commit f18729f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ private MavenVisitor<ExecutionContext> scanMaven(
@Override
public Xml.Document visitDocument(Xml.Document document, ExecutionContext ctx) {
List<ResolvedDependency> scopeDependencies = getResolutionResult().getDependencies().get(aScope);
if(scopeDependencies != null) {
if (scopeDependencies != null) {
for (ResolvedDependency resolvedDependency : scopeDependencies) {
analyzeDependency(resolvedDependency, licenses);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ public TreeVisitor<?, ExecutionContext> getVisitor() {
return new TreeVisitor<Tree, ExecutionContext>() {
@Override
public @Nullable Tree visit(@Nullable Tree tree, ExecutionContext ctx) {
if(tree == null) {
if (tree == null) {
return null;
}
Markers m = tree.getMarkers();
m.findFirst(GradleProject.class).ifPresent(gradle -> {
GradleDependencyConfiguration conf = gradle.getConfiguration(scope.asGradleConfigurationName());
if(conf != null) {
if (conf != null) {
for (ResolvedDependency dep : conf.getResolved()) {
insertDependency(ctx, gradle, dep, true);
}
Expand All @@ -93,7 +93,7 @@ private void insertDependency(ExecutionContext ctx, GradleProject gradle, Resolv
dep.getVersion(),
direct
));
if(includeTransitive) {
if (includeTransitive) {
for (ResolvedDependency transitive : dep.getDependencies()) {
insertDependency(ctx, gradle, transitive, false);
}
Expand All @@ -111,7 +111,7 @@ private void insertDependency(ExecutionContext ctx, MavenResolutionResult maven,
dep.getVersion(),
direct
));
if(includeTransitive) {
if (includeTransitive) {
for (ResolvedDependency transitive : dep.getDependencies()) {
insertDependency(ctx, maven, transitive, false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class Range {
@Nullable
public String getIntroduced() {
for (Event event : events) {
if(event.getIntroduced() != null) {
if (event.getIntroduced() != null) {
return event.getIntroduced();
}
}
Expand All @@ -37,7 +37,7 @@ public String getIntroduced() {
@Nullable
public String getFixed() {
for (Event event : events) {
if(event.getFixed() != null) {
if (event.getFixed() != null) {
return event.getFixed();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ void basic() {
.dataTable(DependencyListReport.Row.class, rows -> {
assertThat(rows).isNotEmpty();
assertThat(rows)
.filteredOn( it -> it.getBuildTool().equals("Maven") && it.getDependencyArtifactId().equals("rewrite-core"))
.filteredOn(it -> it.getBuildTool().equals("Maven") && it.getDependencyArtifactId().equals("rewrite-core"))
.hasSize(1);
assertThat(rows)
.filteredOn( it -> it.getBuildTool().equals("Gradle") && it.getDependencyArtifactId().equals("rewrite-core"))
.filteredOn(it -> it.getBuildTool().equals("Gradle") && it.getDependencyArtifactId().equals("rewrite-core"))
.hasSize(1);
}),
//language=groovy
Expand Down

0 comments on commit f18729f

Please sign in to comment.