Skip to content

Commit

Permalink
edit comment
Browse files Browse the repository at this point in the history
  • Loading branch information
vga91 committed May 3, 2022
1 parent 892d12c commit ae8f067
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions core/src/main/java/apoc/cypher/CypherInitializer.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import java.util.ConcurrentModificationException;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.TreeMap;

public class CypherInitializer implements AvailabilityListener {
Expand Down Expand Up @@ -91,9 +92,11 @@ public void available() {
}).start();
}

// only for testing purpose
// the visibility is public only for testing purpose, it could be private otherwise
public static boolean isVersionDifferent(List<String> versions, String apocFullVersion) {
return versions.stream().noneMatch(apocFullVersion::startsWith);
return Optional.ofNullable(apocFullVersion)
.map(v -> versions.stream().noneMatch(v::startsWith))
.orElse(true);
}

private Collection<String> collectInitializers(boolean isSystemDatabase, Configuration config) {
Expand Down

0 comments on commit ae8f067

Please sign in to comment.