Skip to content

Commit df3c6f2

Browse files
injectivesmeistermeier
authored andcommitted
Update neo4j-java-driver to 5.28.8
This update adjusts method calls accordingly. Signed-off-by: Dmitriy Tverdiakov <[email protected]>
1 parent dc5f975 commit df3c6f2

File tree

2 files changed

+32
-17
lines changed

2 files changed

+32
-17
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
<maven-install-plugin.version>3.1.4</maven-install-plugin.version>
9898
<maven-site-plugin.version>3.7.1</maven-site-plugin.version>
9999
<maven.compiler.release>${java.version}</maven.compiler.release>
100-
<neo4j-java-driver.version>5.28.7</neo4j-java-driver.version>
100+
<neo4j-java-driver.version>5.28.8</neo4j-java-driver.version>
101101
<neo4j-migrations.version>2.17.3</neo4j-migrations.version>
102102
<neo4j.version>4.4.41</neo4j.version>
103103
<objenesis.version>3.0.1</objenesis.version>

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

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
import org.apache.commons.logging.LogFactory;
2525
import org.jspecify.annotations.Nullable;
26-
import org.neo4j.driver.NotificationClassification;
26+
import org.neo4j.driver.NotificationCategory;
2727
import org.neo4j.driver.NotificationSeverity;
2828
import org.neo4j.driver.summary.InputPosition;
2929
import org.neo4j.driver.summary.Notification;
@@ -94,8 +94,9 @@ private static void logNotifications(ResultSummary resultSummary) {
9494
Predicate<Notification> isDeprecationWarningForId;
9595
try {
9696
isDeprecationWarningForId = notification -> supressIdDeprecations
97-
&& notification.classification()
98-
.orElse(NotificationClassification.UNRECOGNIZED) == NotificationClassification.DEPRECATION
97+
&& notification.category()
98+
.orElse(NotificationCategory.UNRECOGNIZED)
99+
.equals(NotificationCategory.DEPRECATION)
99100
&& DEPRECATED_ID_PATTERN.matcher(notification.description()).matches();
100101
}
101102
finally {
@@ -107,7 +108,7 @@ private static void logNotifications(ResultSummary resultSummary) {
107108
.stream()
108109
.filter(Predicate.not(isDeprecationWarningForId))
109110
.forEach(notification -> notification.severityLevel().ifPresent(severityLevel -> {
110-
var category = notification.classification().orElse(null);
111+
var category = notification.category().orElse(null);
111112

112113
var logger = getLogAccessor(category);
113114
Consumer<String> logFunction;
@@ -129,21 +130,35 @@ else if (severityLevel == NotificationSeverity.OFF) {
129130
}));
130131
}
131132

132-
private static LogAccessor getLogAccessor(@Nullable NotificationClassification category) {
133+
private static LogAccessor getLogAccessor(@Nullable NotificationCategory category) {
133134
if (category == null) {
134135
return Neo4jClient.cypherLog;
135136
}
136-
return switch (category) {
137-
case HINT -> cypherHintNotificationLog;
138-
case DEPRECATION -> cypherDeprecationNotificationLog;
139-
case PERFORMANCE -> cypherPerformanceNotificationLog;
140-
case GENERIC -> cypherGenericNotificationLog;
141-
case UNSUPPORTED -> cypherUnsupportedNotificationLog;
142-
case UNRECOGNIZED -> cypherUnrecognizedNotificationLog;
143-
case SECURITY -> cypherSecurityNotificationLog;
144-
case TOPOLOGY -> cypherTopologyNotificationLog;
145-
default -> Neo4jClient.cypherLog;
146-
};
137+
if (category.equals(NotificationCategory.HINT)) {
138+
return cypherHintNotificationLog;
139+
}
140+
else if (category.equals(NotificationCategory.DEPRECATION)) {
141+
return cypherDeprecationNotificationLog;
142+
}
143+
else if (category.equals(NotificationCategory.PERFORMANCE)) {
144+
return cypherPerformanceNotificationLog;
145+
}
146+
else if (category.equals(NotificationCategory.GENERIC)) {
147+
return cypherGenericNotificationLog;
148+
}
149+
else if (category.equals(NotificationCategory.UNSUPPORTED)) {
150+
return cypherUnsupportedNotificationLog;
151+
}
152+
else if (category.equals(NotificationCategory.UNRECOGNIZED)) {
153+
return cypherUnrecognizedNotificationLog;
154+
}
155+
else if (category.equals(NotificationCategory.SECURITY)) {
156+
return cypherSecurityNotificationLog;
157+
}
158+
else if (category.equals(NotificationCategory.TOPOLOGY)) {
159+
return cypherTopologyNotificationLog;
160+
}
161+
return Neo4jClient.cypherLog;
147162
}
148163

149164
/**

0 commit comments

Comments
 (0)