Copilot commented on code in PR #14270:
URL: https://github.com/apache/cloudstack/pull/14270#discussion_r4356793194
##########
api/src/main/java/org/apache/cloudstack/api/command/user/job/ListAsyncJobsCmd.java:
##########
@@ -67,15 +103,56 @@ public String getResourceType() {
return resourceType;
}
+ public List<Long> getJobStatuses() {
+ if (jobStatuses == null) {
+ return null;
+ }
+
+ if (jobStatuses.isEmpty()) {
+ throw new InvalidParameterValueException("Empty job status");
+ }
+
+ List<Long> statuses = new ArrayList<>(jobStatuses.size());
+ for (String status : jobStatuses) {
+ statuses.add((long)parseJobStatus(status).value());
+ }
+ return statuses;
+ }
Review Comment:
`job_status` is represented as an `int` in the DB/VOs, but this accessor
returns `List<Long>`, which can cause avoidable type mismatches downstream
(e.g., IN-clauses built over integer columns). Prefer returning `List<Integer>`
(or `List<Short>`/`List<Long>` consistently across the job layer), and keep the
types aligned with `AsyncJobJoinVO.getStatus()`.
--
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]