@Condition applied on wrong source parameter while mapping
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
- 52/100
Hướng nghiên cứu
Bắt đầu với bản tái hiện issue-4037 được liên kết trong báo cáo và kiểm tra mapper được sinh ra cho ánh xạ có hai tham số nguồn. Theo dõi cách @Condition được chọn khi nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS; được xem là hoàn thành khi điều kiện sử dụng nguồn bắt nguồn từ requestBean cho browserId thay vì slotId, với một bài kiểm thử hồi quy bao quát trường hợp này.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Expected behavior
@Condition method should be correctly applied on correct source parameters when we are using nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS
Actual behavior
When we have the mapping mapping with 2 source parameters, for eg:
@Mapping(target = "browserId", source = "requestBean.deviceInfo.browserId")
public abstract AudienceProfileRequest map(RequestBean requestBean, String slotId);
If we are mapping some Integer source field from RequestBean to AudienceProfileRequest then the condition is applied on slotId which is not expected. Following is the snippet of the generated code:
Integer browserId = requestBeanDeviceInfoBrowserId( requestBean );
if ( prechecksSupport.isNotBlank( slotId ) ) {
audienceProfileRequest.browserId( browserId );
}
Steps to reproduce the problem
https://github.com/altaiezior/mapstruct-issues/tree/master/issue-4037
MapStruct Version
MapStruct 1.5.5
- Ngôn ngữ chính
- Java
- Star
- 7.7k
- Fork
- 1.1k
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của mapstruct/mapstruct
-
bug test
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 68/100
-
bug JSpecify
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 72/100
Tất cả issue của mapstruct/mapstruct
Issue tương tự
-
bug untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
opensearch-project/ml-commons#5094 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
-
emitter:client:csharp feature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
affects/8.10 affects/8.9 component/clients kind/bug likelihood/mid severity/mid
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Two open-case totals on one screen: the Programs tile says 15,858 and the nav badge says 15,868 Đang mởbug frontend maui-pilot
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100