shortenFullyQualifiedTypes does not shorten all the fully qualified types
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 68/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- java
- 領域
- build-system, tooling
調査の方向性
spotless-gradle-plugin の shortenFullyQualifiedTypes ステップから始め、バージョン 8.10.1 を使用して issue の 2 つの Java の例を再現します。ManagementFactory や pkg.models.CustomTypeProperty.TypeEnum などの完全修飾参照が変更されない理由を追跡し、その後、すべての完全修飾型が短縮され、結果のコードがコンパイルできることを確認します。
索引モデルが issue の本文から書いたものです。
説明
Summary
shortenFullyQualifiedTypes shortens a fully-qualified reference into the simple name of a type declared in the same compilation unit. The result does not compile.
Reproducer
spotless-gradle-plugin 8.10.1, with shortenFullyQualifiedTypes as one of the steps:
Test example 1:
import java.lang.management.BufferPoolMXBean;
import java.util.List;
public class ClassA
{
public void methodA()
{
final List<BufferPoolMXBean> pools = java.lang.management.ManagementFactory.getPlatformMXBeans(BufferPoolMXBean.class);
}
}
Actual behavior of example 1:
Type java.lang.management.ManagementFactory used in code is not shortened.
Test example 2:
public class classB {
final List<CustomTypeProperty> connectionProps = List.of(new CustomTypeProperty().name("host")
.type(pkg.models.CustomTypeProperty.TypeEnum.STRING));
}
Actual behavior of example 2:
Type pkg.models.CustomTypeProperty used in code is not shortened.
Expected behavior
All FQT should be shortened.
FYI @maxandersen
- 主要言語
- Java
- スター
- 5.7k
- フォーク
- 560
- 平均マージ
- 1日 13時間
- マージ済み PR(30日)
- 43
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
diffplug/spotless のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 66/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
diffplug/spotless の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
infinispan/infinispan#18150 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
-
untriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
opensearch-project/k-NN#3597 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100