Consider using all-args constructor automatically when JSpecify is enabled
Maintainer thường phản hồi trong vòng 1 ngày
@sjohnr đang làm issue này rồi.
Từ ngày 1/12/2025.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
It would be nice to omit the default no-arg constructor and use the all-args constructor when JSpecify annotations are generated (see gh-866). This would allow linting and static analysis tools to consider the generated types fully null-safe with no warnings.
Context:
By default, a no-arg constructor is generated for all Java types. Currently, this constructor is generated as private when generating JSpecify annotations on Java types. The all-args constructor is still optional and the no-arg constructor is used in the generated builder's build() method. Static analysis and linting tools cannot see that the no-arg constructor is private, the builder's build() method validates fields, and the all-args constructor is null-safe. This issue is flagged by IntelliJ code intentions with the following message on fields of the generated type:
@NullMarked fields must be initialized
- Ngôn ngữ chính
- Kotlin
- Star
- 220
- Fork
- 123
- Merge trung bình
- 1 ngày 6 giờ
- Pull request đã merge (30 ngày)
- 23
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc 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 Netflix/dgs-codegen
-
Integer default values on `Float` input fields generate code that does not compile (Java and Kotlin)Có thể đã có người làm @0z5a đã nhận 9 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 72/100
Netflix/dgs-codegen#1015 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 45/100
Netflix/dgs-codegen#1002 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Object literal default value on a custom scalar fails with NoSuchElementExceptionCó thể đã có người làm @nboisnea đã nhận 49 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
Netflix/dgs-codegen#982 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
HV000271: Using @Valid on a container (java.util.List) is deprecated. You should apply the annotation on the type argument(s).Có thể đã có người làm @jiholee17 đã nhận 73 ngày trước. Đang mởenhancement
Netflix/dgs-codegen#954 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Support Immutable java Data TypesCó thể làm lại được @jiholee17 đã nhận 184 ngày trước và không có pull request nào đang mở. Đang mởenhancement
Netflix/dgs-codegen#944 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của Netflix/dgs-codegen
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 2 ngày
-
help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
DojoCodingLabs/hermit#23 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
signalapp/Signal-Android#15148 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
PranshulGG/WeatherMaster#1266 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày