Copilot commented on code in PR #778:
URL: https://github.com/apache/unomi/pull/778#discussion_r3444172179


##########
pom.xml:
##########
@@ -32,7 +32,7 @@
         event tracking server.
     </description>
     <url>https://unomi.apache.org</url>
-    <version>3.1.0-SNAPSHOT</version>
+    <version>3.0.1-SNAPSHOT</version>

Review Comment:
   This PR is scoped to a REST filtering bugfix (UNOMI-945), but it also 
changes the root project version from 3.1.0-SNAPSHOT to 3.0.1-SNAPSHOT. That is 
a cross-cutting release/build change (affecting artifact coordinates) and 
should either be removed from this PR or clearly justified (e.g., if the PR is 
meant to target the 3.0.x maintenance branch instead of master).



##########
rest/src/main/java/org/apache/unomi/rest/endpoints/ContextJsonEndpoint.java:
##########
@@ -349,19 +349,18 @@ private Object sanitizeValue(Object value) {
             } else {
                 return stringValue;
             }
-        } else if (value instanceof List) {
-            List values = (List) value;
-            List newValues = new ArrayList();
+        } else if (value instanceof List values) {
+            List newValues = new ArrayList(values.size());
             for (Object listObject : values) {
                 Object newObject = sanitizeValue(listObject);
                 if (newObject != null) {

Review Comment:
   The new `instanceof List values` / `instanceof Map values` blocks continue 
to use raw types, which propagates unchecked operations and makes it easier to 
accidentally insert non-`Object` types later. Using `List<?>` / `Map<?, ?>` 
here keeps the code type-safe without changing behavior.



##########
generate-manual-config.sh:
##########
@@ -25,10 +25,10 @@
 # === VERSION CONFIGURATION ===
 # Latest version (master branch)
 LATEST_BRANCH="master"
-LATEST_VERSION="3.1.0-SNAPSHOT"
+LATEST_VERSION="3.0.1-SNAPSHOT"
 LATEST_DIR="latest"
 
-# Stable version (release branch)  
+# Stable version (release branch)
 STABLE_BRANCH="unomi-3.0.x"
 STABLE_VERSION="3.0.0"

Review Comment:
   `LATEST_BRANCH` is set to `master`, but this change also sets 
`LATEST_VERSION` to `3.0.1-SNAPSHOT`. If `master` is meant to track the latest 
development line, `LATEST_VERSION` should match the root `pom.xml` version for 
master; otherwise manual generation may point at the wrong artifacts. Consider 
keeping this file in sync with the branch/version strategy or dropping it from 
this bugfix PR if unrelated.



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