davsclaus commented on code in PR #28213:
URL: https://github.com/apache/camel/pull/28213#discussion_r4344998299


##########
core/camel-xml-io/src/main/java/org/apache/camel/xml/LwModelToXMLDumper.java:
##########
@@ -320,33 +359,74 @@ private static void 
extractSourceLocations(RouteDefinition route, Map<String, Ke
         }
     }
 
+    /**
+     * The URI of an endpoint DSL builder, for the checksum without the hash 
of its options that are objects: an
+     * identity hash, another one in every run. The objects are beans, which 
the checksum leaves out.
+     */
+    static String rawUri(String uri, boolean checksum) {
+        return checksum && uri != null ? withoutParameter(uri, "hash", 
"[0-9a-f]+") : uri;
+    }
+
+    /** The URI without the query parameter of that name whose value matches 
the regular expression. */
+    static String withoutParameter(String uri, String name, String valueRegex) 
{
+        Matcher matcher = Pattern.compile("([?&])" + Pattern.quote(name) + "=" 
+ valueRegex + "(&|$)").matcher(uri);

Review Comment:
   Applied in fff625a36ea1: `HASH_PARAMETER` and `ROUTE_ID_PARAMETER` are 
static constants now. The routeId pattern captures the value, which 
`withoutRouteId` compares to the id, so nothing is compiled per call. The `&` 
after a parameter is a lookahead now, so a `routeId` of another value no longer 
hides the one after it (covered in `LwModelToXMLDumperRawUriTest`). 
`KameletRouteChecksumTest` and the camel-xml-io tests pass.
   
   _Claude Code on behalf of davsclaus_



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to