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

Block-like array initializers are not preserved

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

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
java
領域
tooling

調査の方向性

報告にある2つの Java スニペットを使って問題を再現し、google-java-format の出力を要求されたブロック風のレイアウトと比較します。次に、フォーマッタの動作と、適切な回帰テストまたはオプション/デフォルト値に関する判断を特定します。フォーマット時に報告されたイニシャライザが上書きされなくなり、フォーマットが一貫していれば完了です。

索引モデルが issue の本文から書いたものです。

説明

The Google Java Style Guide specifies that arrays may be formatted in a block-like fashion, however google-java-format clobbers this to one line per element.

For example, the following:

protected static final byte[] TEST_ARRAY =
      new byte[] {
        (byte) 0x31, (byte) 0x32, (byte) 0x33, (byte) 0x34, (byte) 0x35, (byte) 0x36, (byte) 0xFF, (byte) 0xFF
      };

becomes

  protected static final byte[] TEST_ARRAY =
      new byte[] {
        (byte) 0x31,
        (byte) 0x32,
        (byte) 0x33,
        (byte) 0x34,
        (byte) 0x35,
        (byte) 0x36,
        (byte) 0xFF,
        (byte) 0xFF
      };

For larger formatted constant definitions, formatting is essential to preserving understanding of the structure. It seems like preserving formatting should either be default behaviour, or an option.

主要言語
Java
スター
6.2k
フォーク
936
平均マージ
6分
マージ済み PR(30日)
3

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

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

google/google-java-format のほかの issue

google/google-java-format の issue をすべて見る

似ている issue

Java の issue をもっと見る

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

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