Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion functions/poll_service_java/Service.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public void runner(HttpServletRequest request, HttpServletResponse response) thr
responseData = getMyVotesOrCompletedPolls(user_id, page);
responseData.remove("pollMap");

} else if (url.equals("/MyPolls") && method.equals(POST)) {
} else if (url.equals("/MyPoll") && method.equals(POST)) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[CRITICAL_BUG] The endpoint change from '/MyPolls' to '/MyPoll' could break backward compatibility. Verify that this update is intentional and that all clients are updated accordingly.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[CRITICAL_BUG] The endpoint change from '/MyPolls' to '/MyPoll' could break backward compatibility. Verify that this update is intentional and that all clients are updated accordingly.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[VALIDATION] Validate that the request parameters (e.g., 'user_id' and 'page') exist and are non-null before calling toString() or parsing them to prevent potential NullPointerExceptions.

String user_id = requestParameters.get("user_id") != null ? requestParameters.get("user_id").toString() : null;
if (user_id == null) {
    // handle missing user_id, e.g., throw exception or return error response
}
Object pageObj = requestParameters.get("page");
Integer page = null;
if (pageObj != null) {
    page = Integer.parseInt(pageObj.toString());
} else {
    // handle missing page, e.g., throw exception or return error response
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[REFACTORING] The endpoint URL has been changed from '/MyPolls' to '/MyPoll' (line 72). Ensure that this update is consistently reflected in client integrations and documentation.


ServletInputStream requestBody = request.getInputStream();
JSONParser jsonParser = new JSONParser();
Expand Down