Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Analysis hints for assertj: assertThat does not modify its argument

Đã đóng
#116 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
45/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
java
Lĩnh vực
devtools

Hướng nghiên cứu

Start with the existing libs/test (JUnit Jupiter) hints as the model: follow how it is wired through a compile dependency in maddi-aapi-archive, an entry in CompileAnalysisHints.LIBRARIES, and one in LoadAnalysisResults.ANALYZED_RESULTS. The annotation targets are the assertThat*/then* entry points of org.assertj.core.api.Assertions, WithAssertions and BDDAssertions. Done when the argument of those methods is marked @NotModified and the langchain4j-core fields named in the issue (UserMessage.contents, ChatRequest.messages, AiMessage.toolExecutionRequests) are no longer reported as modified.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

enhancement

AssertJ has no hints. An unannotated library parameter defaults to modified, so every assertThat(x) in a project's test code makes x modified. Through the reachability pass's shared callee-parameter node, that reaches the fields and parameters behind every argument passed there.

Measured on langchain4j-core (CodeLaser/maddi-mod#24): UserMessage.contents, ChatRequest.messages and AiMessage.toolExecutionRequests are modified only because tests pass them to WithAssertions.assertThat(List) / Assertions.assertThat(List).

Minimum: @NotModified on the argument of the assertThat*/then* entry points of org.assertj.core.api.Assertions, WithAssertions and BDDAssertions. Better: the Abstract*Assert methods, which read the actual value. Like libs/test (JUnit Jupiter), this needs a compile dependency in maddi-aapi-archive, an entry in CompileAnalysisHints.LIBRARIES and one in LoadAnalysisResults.ANALYZED_RESULTS.

Ngôn ngữ chính
Java
Star
1
Fork
1
Merge trung bình
1 giờ 58 phút
Pull request đã merge (30 ngày)
5

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của CodeLaser/maddi

Tất cả issue của CodeLaser/maddi

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.