IsolateClass: a group isolate doesn't compile: interfaces become classes, annotation stubs lack @Target
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Start with util/IsolateClass.java, especially phase 0 around line 324, and reproduce using the fernflower steps in the issue: isolate DomHelper with the types from reachedPerType(), then print and parse the result with failFast(true). Check the emitted nature of isolated interfaces and how annotation stubs preserve @Target; the issue also lists four remaining compile errors that are not yet analyzed. Done means the isolated tree compiles in the described reproduction.
索引モデルが issue の本文から書いたものです。
説明
IsolateClass.isolate(List<TypeInfo>) (maddi-mod, maddi-modification-common, util/IsolateClass.java) produces trees that don't compile once the group holds an interface or the code uses type-use annotations. Found isolating fernflower's DomHelper together with the 33 fernflower types it reaches.
1. An isolated interface is emitted as a class
Phase 0 builds every isolated type with .setTypeNature(runtime.typeNatureClass()) (line 324), and nothing later restores the original's nature. With org.jetbrains.java.decompiler.struct.match.IMatchable in the group:
public abstract class IMatchable { // the original is an interface
so every implements IMatchable fails ("interface expected here"; 4 of 55 errors, plus their follow-ups). The single-type isolate doesn't hit this when the isolated type is a class, and as a stub an interface comes out right. Only an interface that is itself isolated is affected. Enums, records and annotation types are probably affected the same way (not checked).
2. Annotation stubs are not usable in type-use positions
org.jetbrains.annotations.Nullable and NotNull are stubbed without @Target, so a verbatim body using them in a type position (@Nullable String[], a type argument) fails with "annotation @org.jetbrains.annotations.Nullable not applicable in this type context" (8 of the remaining 12 errors). A stub annotation needs its original's @Target, or failing that one that includes TYPE_USE.
3. Remaining
With interfaces kept out of the group and the two annotation stubs replaced by hand, four errors remain, not yet analyzed:
StructClass is not abstract and does not override abstract method getType()in a stubbed supertype;constructor DataInputStream in class java.io.DataInputStream cannot be applied to given types;- two more.
The parse then drops StructClass and DataInputFullStream.
Reproduce
Parse fernflower (JavaToKotlinRatchet.parse("fernflower")), isolate DomHelper alone, take the corpus types in reachedPerType(), isolate [DomHelper] + those, print with the members' verbatim sources and parse the tree back with failFast(true).
- 主要言語
- Java
- スター
- 1
- フォーク
- 1
- 平均マージ
- 1時間 44分
- マージ済み PR(30日)
- 6
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
CodeLaser/maddi のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
CodeLaser/maddi#166 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
build/ci good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 14/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
-
front-end:rust
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
メンテナーはふだん 1 日以内に返信
CodeLaser/maddi の issue をすべて見る
似ている issue
-
[Bug] 资源包列表 与 模组/数据包/世界 列表排列顺序不一致対応中かも @fishdry1000 が 4 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
AtlasOfLivingAustralia/species-lists#882 ·
メンテナーはふだん 1 日以内に返信
-
Type/Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
ballerina-platform/ballerina-library#9458 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
winder/Universal-G-Code-Sender#3242 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
PCL-Community/PCL-CE#3767 ·
メンテナーはふだん 1 日以内に返信