ferenc-csaky commented on code in PR #36:
URL: 
https://github.com/apache/flink-connector-http/pull/36#discussion_r2982364987


##########
flink-connector-http/src/main/java/org/apache/flink/connector/http/table/lookup/querycreators/GenericJsonAndUrlQueryCreator.java:
##########
@@ -178,6 +162,42 @@ public LookupQueryInfo createLookupQuery(final RowData 
lookupDataRow) {
         return new LookupQueryInfo(lookupQuery, bodyBasedUrlQueryParams, 
pathBasedUrlParams);
     }
 
+    /**
+     * Substitutes placeholders in the template with values from the JSON 
object. Placeholders are
+     * in the format {@code <fieldName>} where fieldName is a top-level field 
in the JSON object.
+     *
+     * @param template the template string with placeholders
+     * @param jsonObject the JSON object containing field values
+     * @return the template with placeholders replaced by actual values
+     */
+    private String substituteTemplate(String template, ObjectNode jsonObject) {
+        java.util.regex.Pattern pattern = 
java.util.regex.Pattern.compile("<([^>]+)>");
+        java.util.regex.Matcher matcher = pattern.matcher(template);
+
+        StringBuffer result = new StringBuffer();

Review Comment:
   Why `StringBuffer`? `StringBuilder` should always be the default choice, 
cause it's thread-safe, unless specific concurrency requirements.



-- 
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