parser/java: output instability
- Langage dominant
- Go
- Étoiles
- 390
- Forks
- 57
- Merge moyen
- 2 j 21 h
- PR mergées (30 j)
- 1
Description
**Describe the bug**
The java parser generates different outputs for the same input.
**To Reproduce**
1. clone main branch and build abcoder
2. run abcoder on testdata/java/4_full_maven_repo twice
3. compare the generated uniasts (using the smart diff script)
**Expected behavior**
For the same repo, abcoder should generate two identical uniASTs.
**Screenshots**
```bash
[~/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.
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Construisez abcoder, exécutez les deux commandes sur testdata/java/4_full_maven_repo et comparez les sorties avec script/diffjson.py. Commencez par suivre le chemin parser/java impliqué dans la génération des noms de méthodes, en utilisant les différences signalées de InMemoryUserRepository comme cas reproductible. C’est terminé lorsque des analyses répétées produisent des uniASTs identiques.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- go, java
- Domaine
- compilers
- Type d'issue
- Bug
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 38/100