Recipe UseTextBlocks: Textblock not constructed AFTER it encounters a variable in a string.
维护者通常 1 天内回复
@kunli2 已经在做这个了。
开始于 2023年4月3日。
评估
这个 Issue 还没有评估数据。
描述
Was testing with the UseTextBlocks recipe. Wanted to use it for our SQL statements. Noticed that it works partially. Our SQL statement consists out of + variable or constant + . It appears that after encountering a variable a textblock is no longer created. Also reran mvn rewrite:run again just to see if it would be picked up in a second run. It doesn't. During the test the ONLY active recipe was UseTextBlocks
Question: Is there a minimum number of string concats needed before a textblock is used??
Gonna check all the converted files, should I find more 'interesting things' I can enter it here in this thread.
Before
int thisVariableStopsTextBlocks = 1;
String stringWithVariableInIt =
"This " +
"is " +
"text " +
"BEFORE the variable " +
thisVariableStopsTextBlocks +
"This " +
"is " +
"text " +
"AFTER the variable. " +
"As is visible a TextBlock is no longer constructed";
After org.openrewrite.java.migrate.lang.UseTextBlocks: {convertStringsWithoutNewlines=true}
int thisVariableStopsTextBlocks = 1;
String stringWithVariableInIt =
"""
This \
is \
text \
BEFORE the variable \
""" +
thisVariableStopsTextBlocks +
"This " +
"is " +
"text " +
"AFTER the variable. " +
"As is visible a TextBlock is no longer constructed";
- 主要语言
- Java
- 星标
- 156
- 派生
- 129
- 平均合并
- 7 小时 12 分钟
- 30 天内合并 PR
- 43
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
openrewrite/rewrite-migrate-java 的其他 Issue
-
bug
难度 3/5 半天 新手友好度 40/100
openrewrite/rewrite-migrate-java#1292 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 55/100
openrewrite/rewrite-migrate-java#1289 ·
维护者通常 1 天内回复
-
bug
难度 4/5 3-5 天 新手友好度 68/100
openrewrite/rewrite-migrate-java#1246 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 32/100
openrewrite/rewrite-migrate-java#1227 · 2 条评论 ·
维护者通常 1 天内回复
-
OptionalNotPresentToIsEmpty rewrites `!isPresent()` on a non-`java.util.Optional` type, producing uncompilable `isEmpty()`可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 3/5 1-2 天 新手友好度 70/100
openrewrite/rewrite-migrate-java#1146 · 3 条评论 ·
维护者通常 1 天内回复
查看 openrewrite/rewrite-migrate-java 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 62/100
NationalSecurityAgency/ghidra#9884 ·
维护者通常 2 天内回复
-
Status: Pending Review Type: Feature Request
难度 1/5 1 小时以内 新手友好度 82/100
OpenRefine/OpenRefine#8019 ·
维护者通常 1 天内回复
-
`timer` rule rejects dates the engine accepts可能已有人在做 @MFA-G 今天认领。 未关闭bug ready
难度 2/5 1-3 小时 新手友好度 72/100
camunda/bpmnlint-plugin-camunda-compat#281 · 3 条评论 ·
维护者通常 1 天内回复
-
status: waiting-for-triage
难度 2/5 1-3 小时 新手友好度 72/100
-
bug
难度 2/5 1-3 小时 新手友好度 62/100