Java printer: a nested type prints by simple name when the unit imports another type of that name
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ó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 57/100
Hướng nghiên cứu
Start at the Java printer and the importComputer call shown in the issue, then trace how it decides whether a nested type can print by its simple name. Reproduce the case with the two Builder types and confirm the printed source resolves to the wrong one. Done when the nested type remains unambiguous in printed output and the example can be reparsed successfully.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
A nested type of an imported type, written Outer.Impl.Builder, prints by its simple name Builder when the unit also imports another type named Builder. The printed unit then means the imported type.
package a.c;
public class Builder { }
package a.d;
public class Outer {
public static class Impl {
public static class Builder { public Builder set(int i) { return this; } }
}
}
package a.b;
import a.c.Builder;
import a.d.Outer;
public class X {
Builder own;
Object make() {
return new Outer.Impl.Builder().set(0);
}
}
javaInspector.print2(cu, null, javaInspector.importComputer(4, cu.sourceSet())) prints
public class X { Builder own; Object make() { return new Builder().set(0); } }
so new Builder() is a.c.Builder, which has no set. It looks as if the printer takes the simple name as visible because some type of that simple name is imported, without checking it is the same type. (#114 was the converse: a nested type qualified by an outer name the unit had taken.)
Found re-parsing printed sources of jenkins core: hudson.model.Build, Project, hudson.Functions and jenkins.model.Jenkins import hudson.tasks.Builder and use another nested Builder; all four units are dropped (the re-parse then fails with "Unexpected javac type in convert: 'recovery'"). Jenkins alone held 8 of the idiom sites lost in that run.
maddi 0.9.6-alpha.4.
- Ngôn ngữ chính
- Java
- Star
- 1
- Fork
- 1
- Merge trung bình
- 1 giờ 55 phút
- Pull request đã merge (30 ngày)
- 8
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
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
CodeLaser/maddi#166 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
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
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 67/100
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
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 66/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ự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
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 67/100
quarkiverse/quarkus-google-cloud-services#1188 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Component: Frontend Component: Web Component Type: Maintenance
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
it-at-m/refarch-templates#1944 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
priority: p2 type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
googleapis/java-genai#1372 ·
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 60/100