Commit d73b1eb
fix: make JavaParser thread-safe with ThreadLocal to close node gap
JavaParser is not thread-safe when shared across virtual threads. The
static PARSER instance caused data races during concurrent file analysis,
silently dropping AST results (especially annotation declarations).
Switching to ThreadLocal<JavaParser> gives each virtual thread its own
instance, fixing the 834-node gap (27,153 -> 27,987 vs Python's 27,446).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 4a8e1e1 commit d73b1eb
1 file changed
Lines changed: 3 additions & 2 deletions
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
26 | | - | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
0 commit comments