-
Notifications
You must be signed in to change notification settings - Fork 4
fix : post project step order fix #307
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
코드 리뷰에 대해 몇 가지 피드백을 드리겠습니다.
버그 리스크:
requestDto.getStepOrderNumber() - 1변경으로 인해stepOrderNumber가 0일 경우getStepOrder메서드는 -1을 사용하는데, 이 경우 인덱스 범위를 초과할 수 있습니다.orderList의 크기에 따라 NullPointerException이나 ArrayIndexOutOfBoundsException이 발생할 수 있습니다.유효성 검사:
requestDto.getStepOrderNumber()가 0보다 작은 경우에 대한 유효성 검사가 필요합니다. 이를 통해 예외 상황을 방지할 수 있습니다.주석:
메서드 이름:
getStepOrder메서드의 구현이 어떻게 되어 있는지에 따라 몇 가지 개선이 가능합니다. 만약 메서드가 특정 인덱스에 대한 기본값을 리턴한다면 해당 기능이 명확하게 드러나도록 메서드 이름을 변경하는 것도 고려해볼 수 있습니다.예외 처리:
ErrorCode.INVALID_STEP_ORDER와 같은 새로운 예외 처리를 추가하면 사용자가 문제를 더 쉽게 이해할 수 있도록 도와줄 수 있습니다.이와 같은 점들을 고려하여 코드를 수정하면 더욱 안정적이고 가독성 높은 코드를 생성할 수 있을 것입니다.