|
15 | 15 | */ |
16 | 16 | package org.springframework.data.neo4j.core; |
17 | 17 |
|
| 18 | +import java.util.List; |
18 | 19 | import java.util.function.Consumer; |
19 | 20 | import java.util.function.Predicate; |
20 | 21 | import java.util.regex.Pattern; |
@@ -68,11 +69,12 @@ final class ResultSummaries { |
68 | 69 | private static final LogAccessor cypherSchemaNotificationLog = new LogAccessor( |
69 | 70 | LogFactory.getLog("org.springframework.data.neo4j.cypher.schema")); |
70 | 71 |
|
71 | | - private static final Pattern DEPRECATED_ID_PATTERN = Pattern |
72 | | - .compile("(?im)The query used a deprecated function[.:] \\(?[`']id.+"); |
73 | | - |
74 | | - private static final Pattern DEPRECATED_ID_PATTERN_GQL = Pattern |
75 | | - .compile("(?im).*id is deprecated and will be removed without a replacement\\."); |
| 72 | + private static final List<Pattern> STUFF_THAT_MIGHT_INFORM_THAT_THE_ID_FUNCTION_IS_PROBLEMATIC = Stream.of( |
| 73 | + "(?im)The query used a deprecated function[.:] \\(?[`']id.+", |
| 74 | + "(?im).*id is deprecated and will be removed without a replacement\\.", |
| 75 | + "(?im).*feature deprecated with replacement\\. id is deprecated\\. It is replaced by elementId or consider using an application-generated id\\.") |
| 76 | + .map(Pattern::compile) |
| 77 | + .toList(); |
76 | 78 |
|
77 | 79 | private ResultSummaries() { |
78 | 80 | } |
@@ -103,8 +105,8 @@ private static void logNotifications(ResultSummary resultSummary) { |
103 | 105 | .filter(cat -> cat == NotificationClassification.UNRECOGNIZED |
104 | 106 | || cat == NotificationClassification.DEPRECATION) |
105 | 107 | .isPresent() |
106 | | - && (DEPRECATED_ID_PATTERN.matcher(notification.statusDescription()).matches() |
107 | | - || DEPRECATED_ID_PATTERN_GQL.matcher(notification.statusDescription()).matches()); |
| 108 | + && STUFF_THAT_MIGHT_INFORM_THAT_THE_ID_FUNCTION_IS_PROBLEMATIC.stream() |
| 109 | + .anyMatch(p -> p.matcher(notification.statusDescription()).matches()); |
108 | 110 | } |
109 | 111 | finally { |
110 | 112 | Neo4jClient.SUPPRESS_ID_DEPRECATIONS.setRelease(supressIdDeprecations); |
|
0 commit comments