parser/java: output instability
还没有人认领这个 Issue。
评估
调研方向
构建 abcoder,针对 testdata/java/4_full_maven_repo 运行这两个命令,并使用 script/diffjson.py 比较输出。首先跟踪涉及生成方法名的 parser/java 路径,并将报告的 InMemoryUserRepository 差异作为可复现案例。重复解析能够生成完全相同的 uniASTs 即表示完成。
由索引模型根据 Issue 内容生成。
描述
Describe the bug
The java parser generates different outputs for the same input.
To Reproduce
- clone main branch and build abcoder
- run abcoder on testdata/java/4_full_maven_repo twice
- compare the generated uniasts (using the smart diff script)
Expected behavior
For the same repo, abcoder should generate two identical uniASTs.
Screenshots
[~/Programs/test/arti/java/abcoder] [main =] [05:43:56 PM] zhenyang
$ git status
On branch main
Your branch is up to date with 'origin/main'.
nothing to commit, working tree clean
[~/Programs/test/arti/java/abcoder] [main =] [05:43:57 PM] zhenyang
$ go build
[~/Programs/test/arti/java/abcoder] [main =] [05:44:02 PM] zhenyang
$ ./abcoder parse java testdata/java/4_full_maven_repo -o java_1.json
2025/09/26 17:44:13 Using JDTLS_ROOT_PATH from environment: /home/zhenyang/O/data/Programs/bytedance/LanguageServers
[ERROR]17:44:13 client.go:264: LSP server stderr: OpenJDK 64-Bit Server VM warning: Options -Xverify:none and -noverify were deprecated in JDK 13 and will likely be removed in a future release.
[ERROR]17:44:14 client.go:264: LSP server stderr: Sep 26, 2025 5:44:14 PM org.apache.aries.spifly.BaseActivator log
[ERROR]17:44:14 client.go:264: LSP server stderr: INFO: Registered provider ch.qos.logback.classic.servlet.LogbackServletContainerInitializer of service jakarta.servlet.ServletContainerInitializer in bundle ch.qos.logback.classic
[ERROR]17:44:14 client.go:264: LSP server stderr: Sep 26, 2025 5:44:14 PM org.apache.aries.spifly.BaseActivator log
[ERROR]17:44:14 client.go:264: LSP server stderr: INFO: Registered provider ch.qos.logback.classic.spi.LogbackServiceProvider of service org.slf4j.spi.SLF4JServiceProvider in bundle ch.qos.logback.classic
[~/Programs/test/arti/java/abcoder] [main =] [05:44:47 PM] zhenyang
$ ./abcoder parse java testdata/java/4_full_maven_repo -o java_2.json >/dev/null 2>&1
[~/Programs/test/arti/java/abcoder] [main =] [05:45:06 PM] zhenyang
$ ./script/diffjson.py java_1.json java_2.json 2>&1 | head
Differences found between 'java_1.json' and 'java_2.json':
Value Changed at: root['Modules']['com.example.test:core-module:1.0.0-SNAPSHOT']['Packages']['com.example.core.repository']['Types']['InMemoryUserRepository']['Methods']['findAll()']['Name']
- old: 'findAll()'
+ new: 'InMemoryUserRepository.findAll()'
--------------------
Value Changed at: root['Modules']['com.example.test:core-module:1.0.0-SNAPSHOT']['Packages']['com.example.core.repository']['Types']['InMemoryUserRepository']['Methods']['save(User)']['Name']
- old: 'InMemoryUserRepository.save(User)'
+ new: 'save(User)'
--------------------
Version:
main branch
Environment:
The output of go env.
Additional context
Add any other context about the problem here.
- 主要语言
- Go
- 星标
- 391
- 派生
- 58
- 平均合并
- 2 天 21 小时
- 30 天内合并 PR
- 1
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
cloudwego/abcoder 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 42/100
-
难度 4/5 3-5 天 新手友好度 55/100
-
难度 4/5 3-5 天 新手友好度 35/100
-
难度 3/5 1-2 天 新手友好度 55/100
-
难度 4/5 3-5 天 新手友好度 35/100
查看 cloudwego/abcoder 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 60/100
github/gh-aw-mcpg#13748 ·
-
agentic-workflows
难度 2/5 1-3 小时 新手友好度 65/100
-
needs-triage
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 65/100
-
难度 2/5 1-3 小时 新手友好度 75/100
googleapis/librarian#7670 · 2 条评论 ·