Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

J2K judge: kotlinc compiles against JDK 27 while the analysis resolves guava at --release 9 (Ordering.min/max override)

オープン
#173 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
38/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
java, kotlin
領域
testing, tooling

調査の方向性

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:

  1. 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;
  2. or the printer emits override when 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分
マージ済み PR(30日)
8

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

CodeLaser/maddi のほかの issue

CodeLaser/maddi の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。