Skip to content

Commit ebd5db4

Browse files
injectivesmeistermeier
authored andcommitted
Update neo4j-java-driver to 5.28.8
This update adjusts method calls accordingly. Signed-off-by: Dmitriy Tverdiakov <dmitriy.tverdiakov@neo4j.com> (cherry picked from commit df3c6f2)
1 parent 5332810 commit ebd5db4

File tree

2 files changed

+36
-22
lines changed

2 files changed

+36
-22
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
<maven-install-plugin.version>3.1.4</maven-install-plugin.version>
8989
<maven-site-plugin.version>3.7.1</maven-site-plugin.version>
9090
<maven.compiler.release>${java.version}</maven.compiler.release>
91-
<neo4j-java-driver.version>5.28.7</neo4j-java-driver.version>
91+
<neo4j-java-driver.version>5.28.8</neo4j-java-driver.version>
9292
<neo4j-migrations.version>1.16.3</neo4j-migrations.version>
9393
<neo4j.version>4.4.8</neo4j.version>
9494
<objenesis.version>3.0.1</objenesis.version>

src/main/java/org/springframework/data/neo4j/core/ResultSummaries.java

Lines changed: 35 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import java.util.stream.Stream;
2323

2424
import org.apache.commons.logging.LogFactory;
25-
import org.neo4j.driver.NotificationClassification;
25+
import org.neo4j.driver.NotificationCategory;
2626
import org.neo4j.driver.NotificationSeverity;
2727
import org.neo4j.driver.summary.InputPosition;
2828
import org.neo4j.driver.summary.Notification;
@@ -75,18 +75,20 @@ private static void logNotifications(ResultSummary resultSummary) {
7575
Predicate<Notification> isDeprecationWarningForId;
7676
try {
7777
isDeprecationWarningForId = notification -> supressIdDeprecations
78-
&& notification.classification().orElse(NotificationClassification.UNRECOGNIZED)
79-
== NotificationClassification.DEPRECATION && DEPRECATED_ID_PATTERN.matcher(notification.description())
80-
.matches();
78+
&& notification.category()
79+
.orElse(NotificationCategory.UNRECOGNIZED)
80+
.equals(NotificationCategory.DEPRECATION)
81+
&& DEPRECATED_ID_PATTERN.matcher(notification.description()).matches();
8182
} finally {
8283
Neo4jClient.SUPPRESS_ID_DEPRECATIONS.setRelease(supressIdDeprecations);
8384
}
8485

8586
String query = resultSummary.query().text();
8687
resultSummary.notifications()
87-
.stream().filter(Predicate.not(isDeprecationWarningForId))
88-
.forEach(notification -> notification.severityLevel().ifPresent(severityLevel -> {
89-
var category = notification.classification().orElse(null);
88+
.stream()
89+
.filter(Predicate.not(isDeprecationWarningForId))
90+
.forEach(notification -> notification.severityLevel().ifPresent(severityLevel -> {
91+
var category = notification.category().orElse(null);
9092

9193
var logger = getLogAccessor(category);
9294
Consumer<String> logFunction;
@@ -105,21 +107,35 @@ private static void logNotifications(ResultSummary resultSummary) {
105107
}));
106108
}
107109

108-
private static LogAccessor getLogAccessor(@Nullable NotificationClassification category) {
110+
private static LogAccessor getLogAccessor(@Nullable NotificationCategory category) {
109111
if (category == null) {
110112
return Neo4jClient.cypherLog;
111113
}
112-
return switch (category) {
113-
case HINT -> cypherHintNotificationLog;
114-
case DEPRECATION -> cypherDeprecationNotificationLog;
115-
case PERFORMANCE -> cypherPerformanceNotificationLog;
116-
case GENERIC -> cypherGenericNotificationLog;
117-
case UNSUPPORTED -> cypherUnsupportedNotificationLog;
118-
case UNRECOGNIZED -> cypherUnrecognizedNotificationLog;
119-
case SECURITY -> cypherSecurityNotificationLog;
120-
case TOPOLOGY -> cypherTopologyNotificationLog;
121-
default -> Neo4jClient.cypherLog;
122-
};
114+
if (category.equals(NotificationCategory.HINT)) {
115+
return cypherHintNotificationLog;
116+
}
117+
if (category.equals(NotificationCategory.DEPRECATION)) {
118+
return cypherDeprecationNotificationLog;
119+
}
120+
if (category.equals(NotificationCategory.PERFORMANCE)) {
121+
return cypherPerformanceNotificationLog;
122+
}
123+
if (category.equals(NotificationCategory.GENERIC)) {
124+
return cypherGenericNotificationLog;
125+
}
126+
if (category.equals(NotificationCategory.UNSUPPORTED)) {
127+
return cypherUnsupportedNotificationLog;
128+
}
129+
if (category.equals(NotificationCategory.UNRECOGNIZED)) {
130+
return cypherUnrecognizedNotificationLog;
131+
}
132+
if (category.equals(NotificationCategory.SECURITY)) {
133+
return cypherSecurityNotificationLog;
134+
}
135+
if (category.equals(NotificationCategory.TOPOLOGY)) {
136+
return cypherTopologyNotificationLog;
137+
}
138+
return Neo4jClient.cypherLog;
123139
}
124140

125141
/**
@@ -180,6 +196,4 @@ private static void printPlan(Consumer<String> log, Plan plan, int level) {
180196
}
181197
}
182198

183-
private ResultSummaries() {
184-
}
185199
}

0 commit comments

Comments
 (0)