-
Notifications
You must be signed in to change notification settings - Fork 0
Reviewbranch-testingcodereview #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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)) { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
}There was a problem hiding this comment. Choose a reason for hiding this commentThe 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(); | ||
|
|
||
There was a problem hiding this comment.
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.