Java printer: a text block's escape sequences are lost (\\ prints as \, \t as a tab)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Start at javaInspector.print2 and trace how it prints Java text block literals, comparing the original source with the printed output in the examples. Check the shared literal escaping mentioned in the issue and add coverage for backslashes and tabs in text blocks. Done means printed sources preserve the string value and compile; the payload names no test file.
索引モデルが issue の本文から書いたものです。
説明
A text block's escape sequences are lost on print: \\ prints as \, \t as a raw tab. The printed text block holds a different string, or does not compile (\/ is an illegal escape).
package a.b;
public @interface Ann { String value(); }
package a.b;
public class T {
static final String F = """
name\\/name, false
tab\tx
""";
@Ann("""
name\\/name
""")
void m() { }
}
javaInspector.print2(cu, null, javaInspector.importComputer(4, cu.sourceSet())) prints
static final String F = """
name\/name, false
tab x
""";
@Ann("""
name\/name
""")
javac: illegal escape character. It seems the text block is printed from its value rather than re-escaped (#124's shared literal escaping does not reach it).
Found re-parsing printed sources of timefold-solver: AbstractConstraintBuilderTest's @CsvSource text block (name\\/name, false); the unit is dropped.
maddi 0.9.6-alpha.4.
- 主要言語
- Java
- スター
- 1
- フォーク
- 1
- 平均マージ
- 1時間 55分
- マージ済み PR(30日)
- 8
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
CodeLaser/maddi のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
CodeLaser/maddi#166 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
build/ci good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 67/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 日以内に返信
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 66/100
メンテナーはふだん 1 日以内に返信
CodeLaser/maddi の issue をすべて見る
似ている issue
-
area:core bug priority:p2
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
aomarai/minecraft-mcp#247 ·
メンテナーはふだん 1 日以内に返信
-
help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
antonyrag/ragleap-core#1062 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
Vakore/ZappierGames#232 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
constellation-app/constellation#2588 ·