Skip to content

Conversation

@move-hoon
Copy link
Member

Related issue 🛠

Work Description ✏️

  • 불변 리스트라 직접 정렬 안되는 문제를 가변 리스트로 변경해서 해결했습니다.

Trouble Shooting ⚽️

Related ScreenShot 📷

Uncompleted Tasks 😅

To Reviewers 📢

@move-hoon move-hoon linked an issue Aug 7, 2025 that may be closed by this pull request
1 task
@coderabbitai
Copy link

coderabbitai bot commented Aug 7, 2025

Summary by CodeRabbit

  • 버그 수정
    • 일정 목록 변환 과정에서 발생할 수 있는 호환성 문제를 해결하였습니다.

Walkthrough

이 변경 사항은 두 서비스 클래스에서 Java Stream의 .toList() 메서드를 .collect(Collectors.toList())로 대체하였습니다. 이 변경은 공연 등록 및 수정 시 스케줄 리스트를 수집하는 부분에만 적용되었으며, 그 외의 로직이나 제어 흐름에는 영향을 주지 않습니다.

Changes

Cohort / File(s) Change Summary
Stream 수집 방식 변경
src/main/java/com/beat/domain/performance/application/PerformanceManagementService.java, src/main/java/com/beat/domain/performance/application/PerformanceModifyService.java
Stream의 .toList() 사용을 .collect(Collectors.toList())로 변경. 관련 import 추가. 기타 로직 변화 없음.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Assessment against linked issues

Objective Addressed Explanation
공연 등록 500 에러 해결 (#338)

Poem

토끼는 코드를 살펴보며 깡총깡총 뛰었네,
Collectors로 바꾼 리스트, 에러는 멀리 갔네!
공연 등록도 문제없고,
리뷰 시간도 짧으니,
오늘은 토끼도 한가롭네 🐇✨

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fcb1043 and 6b1f495.

📒 Files selected for processing (2)
  • src/main/java/com/beat/domain/performance/application/PerformanceManagementService.java (2 hunks)
  • src/main/java/com/beat/domain/performance/application/PerformanceModifyService.java (2 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/main/java/com/beat/domain/performance/application/PerformanceModifyService.java (1)
src/main/java/com/beat/domain/schedule/domain/Schedule.java (2)
  • Schedule (28-103)
  • update (82-86)
🔇 Additional comments (4)
src/main/java/com/beat/domain/performance/application/PerformanceModifyService.java (2)

8-8: Collectors import 추가가 적절합니다.

불변 리스트 문제를 해결하기 위해 필요한 import입니다.


181-197: 중요한 버그 수정: 불변 리스트 문제 해결

Java 9+에서 Stream.toList()는 불변 리스트를 반환하는데, Line 199에서 performance.assignScheduleNumbers(schedules)가 리스트를 수정하려고 시도하면 UnsupportedOperationException이 발생합니다. Collectors.toList()로 변경하여 가변 리스트를 반환하도록 한 것이 올바른 해결책입니다.

이 변경사항으로 공연 등록 시 발생하던 500 에러가 해결될 것입니다.

src/main/java/com/beat/domain/performance/application/PerformanceManagementService.java (2)

7-7: Collectors import 추가가 적절합니다.

불변 리스트 문제를 해결하기 위해 필요한 import입니다.


86-100: 일관성 있는 버그 수정

PerformanceModifyService와 동일한 문제를 해결했습니다. Stream.toList()가 반환하는 불변 리스트는 Line 102의 performance.assignScheduleNumbers(schedules) 호출 시 UnsupportedOperationException을 발생시킬 수 있었습니다. Collectors.toList()로 변경하여 가변 리스트를 사용하도록 한 것이 올바른 해결책입니다.

두 서비스 클래스에서 일관성 있게 적용된 것도 좋습니다.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/#338

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@move-hoon move-hoon changed the title [#338] fix: 불변 리스트라 직접 정렬 안되는 문제를 가변 리스트로 변경해서 해결 fix #338 - 불변 리스트라 직접 정렬 안되는 문제를 가변 리스트로 변경해서 해결 Aug 7, 2025
@move-hoon move-hoon changed the title fix #338 - 불변 리스트라 직접 정렬 안되는 문제를 가변 리스트로 변경해서 해결 [fix] #338 - 불변 리스트라 직접 정렬 안되는 문제를 가변 리스트로 변경해서 해결 Aug 7, 2025
@move-hoon move-hoon self-assigned this Aug 7, 2025
@move-hoon move-hoon added the fix 🛠️ fix label Aug 7, 2025
Copy link
Collaborator

@hyerinhwang-sailin hyerinhwang-sailin left a comment

Choose a reason for hiding this comment

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

LGTM!!

@move-hoon move-hoon merged commit af233d8 into develop Aug 7, 2025
2 checks passed
@move-hoon move-hoon deleted the fix/#338 branch August 7, 2025 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] 공연 등록 500 에러 해결

3 participants