Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
mnhock committed Jun 21, 2024
1 parent 674f360 commit 5b2d738
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
8 changes: 3 additions & 5 deletions src/main/java/com/enofex/taikai/Taikai.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,9 @@ private Taikai(Builder builder) {
this.namespace = builder.namespace;
this.excludedClasses = requireNonNullElse(builder.excludedClasses, Collections.emptySet());
this.rules = Stream.concat(
builder.configurers.all()
.stream()
.flatMap(configurer -> configurer.rules().stream()),
builder.rules.stream()
).toList();
builder.configurers.all().stream().flatMap(configurer -> configurer.rules().stream()),
builder.rules.stream())
.toList();

ArchConfiguration.get()
.setProperty("archRule.failOnEmptyShould", Boolean.toString(this.failOnEmpty));
Expand Down
8 changes: 3 additions & 5 deletions src/main/java/com/enofex/taikai/TaikaiRule.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ private Set<String> allExcludedClasses(Set<String> excludedClasses) {
this.configuration.excludedClasses != null
? this.configuration.excludedClasses.stream() : Stream.empty(),
excludedClasses != null
? excludedClasses.stream() : Stream.empty()).collect(Collectors.toSet());
? excludedClasses.stream() : Stream.empty())
.collect(Collectors.toSet());
}

public static final class Configuration {
Expand All @@ -88,8 +89,7 @@ public static final class Configuration {
private Configuration(String namespace, Namespace.IMPORT namespaceImport,
JavaClasses javaClasses, Set<String> excludedClasses) {
this.namespace = namespace;
this.namespaceImport = requireNonNullElse(namespaceImport,
Namespace.IMPORT.WITHOUT_TESTS);
this.namespaceImport = requireNonNullElse(namespaceImport, Namespace.IMPORT.WITHOUT_TESTS);
this.javaClasses = javaClasses;
this.excludedClasses = excludedClasses != null ? excludedClasses : Collections.emptySet();
}
Expand Down Expand Up @@ -150,7 +150,5 @@ public static Configuration of(JavaClasses javaClasses, Set<String> excludedClas
public static Configuration of(Set<String> excludedClasses) {
return new Configuration(null, null, null, excludedClasses);
}


}
}

0 comments on commit 5b2d738

Please sign in to comment.