J2K judge: kotlinc compiles against JDK 27 while the analysis resolves guava at --release 9 (Ordering.min/max override)
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
Start by reading the J2K ratchet and JavaToKotlinRatchet configuration, then trace how source-set sourceRelease is passed to javac and kotlinc. Compare the two proposed approaches for matching Kotlin compilation to the Java build API level. Done means the decision is implemented and the guava J2K ratchet gains the expected compiling file.
由索引模型根据 Issue 内容生成。
描述
Two of guava's remaining kotlinc errors in the J2K ratchet are 'min'/'max' hides member of supertype 'Comparator' and needs an 'override' modifier in Ordering.kt.
Cause. guava's main source set (guava/9) has sourceRelease: 9. The inspection's javac therefore resolves the JDK API as of Java 9, where java.util.Comparator has no min/max, so Ordering.<E extends T> min(E, E) correctly overrides nothing and prints open fun. The judge's kotlinc (JavaToKotlinRatchet, -jvm-target 21, no -jdk-release) compiles against the full JDK 27 API, where Comparator has default <U extends T> U min(U, U) / max (since JDK 26), and demands override.
Checked on the Mac: a guava parse reports overrides=[] for all eight Ordering.min/max while its Comparator lists min and max; a printer test with the same class (with Iterator/Iterable/varargs overloads and a jspecify T extends @Nullable Object bound) and no source release prints override fun <E : T> min(.
Decision needed. Translation and judge disagree on the JDK API:
- the judge compiles each source set's Kotlin with
-jdk-release <sourceRelease>(for guava's main: 9), matching the Java build. kotlinc then also refuses any JDK API newer than 9 in the translation, which is what guava's own javac does. Test source sets have no release and keep the full JDK; - or the printer emits
overridewhen the running JDK's supertype has the member even if the source release's does not. That yields Kotlin that compiles only against new JDKs.
Option 1 looks right to me: the Kotlin is held to the Java build's own API level. It moves the guava J2K ratchet (expected: +1 compiling file), so it waits for your call.
- 主要语言
- Java
- 星标
- 1
- 派生
- 1
- 平均合并
- 1 小时 55 分钟
- 30 天内合并 PR
- 8
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
CodeLaser/maddi 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
build/ci good first issue
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
bug
难度 3/5 1-2 天 新手友好度 67/100
维护者通常 1 天内回复
-
bug
难度 3/5 1-2 天 新手友好度 68/100
维护者通常 1 天内回复
-
Java printer: a nested type prints by simple name when the unit imports another type of that name未关闭bug
难度 3/5 1-2 天 新手友好度 57/100
维护者通常 1 天内回复
相似的 Issue
-
priority: p2 type: bug
难度 2/5 1-3 小时 新手友好度 68/100
googleapis/java-genai#1372 ·
维护者通常 1 天内回复
-
GeoSeries scale and skew tests fail with pytest 9.2.0可能已有人在做 @jiayuasu 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
priority: medium Review effort [1-5]: 3 status: needs-triage type: bug
难度 2/5 1-3 小时 新手友好度 78/100
carlos-emr/carlos#5431 ·
维护者通常 1 天内回复
-
Integration tests: jetty:run fails with WELD-001408 for CountryJpaService可能已有人在做 @viniciusmachak 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 66/100
primefaces/primefaces#15431 ·
维护者通常 1 天内回复
-
test(multi-tenancy): assert cross-tenant vulnerability reads are refused in the CWE isolation test未关闭
难度 2/5 1-3 小时 新手友好度 72/100
OpenAEV-Platform/openaev#8792 ·
维护者通常 2 天内回复