2323
2424import org .apache .commons .logging .LogFactory ;
2525import org .jspecify .annotations .Nullable ;
26- import org .neo4j .driver .NotificationClassification ;
26+ import org .neo4j .driver .NotificationCategory ;
2727import org .neo4j .driver .NotificationSeverity ;
2828import org .neo4j .driver .summary .InputPosition ;
2929import 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