mapstruct / mapstruct/mapstruct-idea
Converter implementation is not refreshed in IDEA
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Java
- Star
- 168
- Fork
- 41
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
Using https://github.com/mapstruct/mapstruct-examples/tree/master/mapstruct-lombok as a reference, I tried to add a field to both Source and Target and then modified the test to cover the new field.
@Test
public void testMapping() {
Source s = new Source();
s.setTest( "5" );
s.setField( "5" );
Target t = Mappers.getMapper(SourceTargetMapper.class).toTarget( s );
assertEquals( 5, (long) t.getTesting() );
assertEquals( "5", t.getField() );
}
However this leads to the test to fail, being t.getField() still null.
Another relevant change I did (which I am not sure about) is to add mapstruct-processor to the compile configuration in build.gradle, ie: compile "org.mapstruct:mapstruct-jdk8:${mapstructVersion}", "org.mapstruct:mapstruct-processor:${mapstructVersion}", "org.projectlombok:lombok:${lombokVersion}" as per http://mapstruct.org/documentation/ide-support/
Also removing a field from both objects leads to an error, this time a java.lang.NoSuchMethodError.
Versions used:
- IDEA 2017.2.5 (with annotation processor manually enabled, no other customization)
- lombok 1.16.18 (instead of 1.16.14)
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
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.
Hướng nghiên cứu
Sử dụng ví dụ mapstruct-lombok cùng với Source, Target và test của nó để tái hiện; trước tiên hãy kiểm tra build.gradle và thiết lập bộ xử lý annotation của IDEA. Tái hiện các trường hợp thêm trường và xóa trường, sau đó xác minh rằng converter được tạo phản ánh các thay đổi và test không còn báo cáo null hoặc NoSuchMethodError.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- java
- Lĩnh vực
- developer-experience, tooling
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 25/100