maddi-java-openjdk: type-use annotations dropped from a nested class's field typed by the enclosing generic class
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 42/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Lĩnh vực
- compilers, devtools, testing-qa
Hướng nghiên cứu
Start with the reduced case exercised through JavaInspectorImpl as TestNullabilityPass, then trace how nested-class field types are represented in FieldInfo.type(). Compare the enclosing-class, nested-library-type, and enclosing-generic-type cases, and inspect where ParameterizedType type-use annotations are copied or lost. Done means AS<@Nullable Object> retains the annotation for the nested Holder field and the Kotlin translation no longer produces the nullability mismatch.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
In a static nested class, a field whose type is the enclosing generic class loses the type-use annotations on its type arguments. guava's Ordering:
public abstract class Ordering<T> implements Comparator<T> {
private static final class ArbitraryOrderingHolder {
static final Ordering<@Nullable Object> ARBITRARY_ORDERING = new ArbitraryOrdering();
}
...
}
ARBITRARY_ORDERING's FieldInfo.type() arrives as Ordering<Object>, and the type argument's annotations() is empty.
Reduced, through JavaInspectorImpl as TestNullabilityPass in maddi-mod runs it:
package a.b;
import java.util.Comparator;
@java.lang.annotation.Target(java.lang.annotation.ElementType.TYPE_USE) @interface Nullable {}
abstract class AS<T> implements Comparator<T> {
static final AS<@Nullable Object> ARBITRARY = new Arbitrary(); // AS<@Nullable Object> (kept)
static AS<@Nullable Object> plain; // AS<@Nullable Object> (kept)
private static final class Holder {
static final AS<@Nullable Object> ARBITRARY = new Arbitrary(); // AS<Object> (dropped)
}
static class Arbitrary extends AS<@Nullable Object> {
public int compare(@Nullable Object a, @Nullable Object b) { return 0; }
}
}
The same annotation is kept on:
- a field of the outer class itself;
- a field of the nested class typed by a library class, e.g.
Comparator<@Nullable Object>inHolder.
The annotation is not needed on the @interface either: a top-level annotation type and one nested in AS give the same result.
Effect: the Kotlin translation prints internal val ARBITRARY_ORDERING: Ordering<Any> = ArbitraryOrdering(), while arbitrary(): Ordering<Any?> returns it. kotlinc reports "type mismatch: expected Ordering<Any?>, actual Ordering" (guava Ordering.kt:214).
Expected: the field's ParameterizedType carries the type-use annotations as written, as it does for the outer class's own fields.
Found while reducing guava's KotlinConf scoreboard compile errors, together with the printer session. Related: #144 (anonymous class creation types).
🤖 Generated with Claude Code
- 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
- Không có Dockerfile hay tệp Docker Compose
- 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 CodeLaser/maddi
-
build/ci good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
Maintainer thường phản hồi trong vòng 1 ngày
-
C# printer: a self-bounded interface's wildcard interface and companion class share a name (CS0102)Đang mởfront-end:csharp
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 64/100
CodeLaser/maddi#160 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
C# printer: an inner class of a generic class needs the outer type's arguments (Outer<A>.Inner)Đang mởfront-end:csharp
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 30/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của CodeLaser/maddi
Issue tương tự
-
Optimize consumer version heatmap aggregation to avoid repeated scansCó thể đã có người làm @praykaria31 đã nhận hôm nay. Đang mởtype/enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Apicurio/apicurio-registry#10662 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
a:false-positive
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
Maintainer thường phản hồi trong vòng 1 ngày
-
status: waiting-for-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
spring-projects/spring-boot#52347 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
bug untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
opensearch-project/opensearch-migrations#3480 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
[Bug] Certificate expiry sorting can reverse UTC order across a viewer daylight-saving gapCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
apache/rocketmq-dashboard#7318 ·
Maintainer thường phản hồi trong vòng 3 ngày