Commit 266d7b5
authored
fix(neo4j): carry body_span, type parameters, leaf spans and call-site facts (#258)
The sweep that followed #255 walked every analysis.json `$def` against
V2GraphProjector and found nine more fields the payload emits and the graph
declares nowhere. This is the mechanical half: additive properties, no new node
family, no comment model, no schema_version move.
- `:JCallable` gains the body block's own offsets under a `body_` prefix
(`body_start_line` … `body_end_byte`). `span` covers the whole declaration, so
before this the graph could not tell a signature from the body it encloses, and
a body-less declaration read the same as one whose body was not recorded. A
prefix rather than a second node: a body block has no identity, it is a second
pair of offsets into the same file. Absent, not zeroed, when there is no body.
- `:JType` and `:JCallable` gain `type_parameters_json`. A type parameter carries
a name, resolved bounds, a span and its own annotations, so it does not flatten
to a scalar — same treatment as `parameters_json`, which is the precedent for
exactly this shape.
- The enum-constant and record-component blocks now call `putLines` and
`annotate`, as `projectField` already did. Both leaf labels join the
`J_ANNOTATED_BY` sources.
- `J_ANNOTATED_BY` carries the application site's span, on a keyed edge. Java
annotations are repeatable, so one (owner, annotation) endpoint pair
legitimately occurs twice on one declaration; a plain MERGE collapsed the two
applications onto one relationship and kept only the last span and argument
list. `_k` is the span key.
- `:JBodyNode` gains `callee_signature` (the erased signature of the resolved
callee, which is what distinguishes overloads at a call site) and `arguments`.
`arguments` stays body-local rather than being mapped through `globalOrdinal` the
way `call_node` is, which is what #256 specified. The conformance assertion for
that mapping failed on the first run: an argument id names an argument
*expression*, and an expression is a body node only when it is itself a call site.
On daytrader8, 537 of 3666 argument ids name a body node, so the mapping would
have handed out 3129 `:JBodyNode` ids resolving to nothing. Carrying the
canonical local ids verbatim keeps the fact exact and positionally aligned with
`argument_expr` and `argument_types`; a consumer that wants the node for a nested
call composes it the same way this projection does.
Every field is asserted against the analysis.json value per node, not by
presence, and the body offsets are asserted to slice `:JModule.source` to text
that starts with `{` and ends with `}`. The enum, record, annotation and generics
assertions run over `enum-record-bodies-test` and
`generics-varargs-duplicate-signature-test`: the L4 fixture declares no enum, no
record, no annotation and no generic, which is how these drops survived every
existing assertion.
Closes #2561 parent 2999e44 commit 266d7b5
4 files changed
Lines changed: 419 additions & 24 deletions
File tree
- src
- main/java/com/ibm/cldk/neo4j
- test/java/com/ibm/cldk/neo4j
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
| |||
76 | 77 | | |
77 | 78 | | |
78 | 79 | | |
| 80 | + | |
79 | 81 | | |
80 | 82 | | |
81 | 83 | | |
82 | 84 | | |
83 | 85 | | |
84 | | - | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
85 | 93 | | |
86 | 94 | | |
87 | 95 | | |
| |||
139 | 147 | | |
140 | 148 | | |
141 | 149 | | |
142 | | - | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
143 | 157 | | |
144 | 158 | | |
145 | 159 | | |
| |||
152 | 166 | | |
153 | 167 | | |
154 | 168 | | |
155 | | - | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
156 | 176 | | |
157 | 177 | | |
158 | 178 | | |
| |||
171 | 191 | | |
172 | 192 | | |
173 | 193 | | |
| 194 | + | |
| 195 | + | |
174 | 196 | | |
175 | 197 | | |
176 | 198 | | |
| |||
392 | 414 | | |
393 | 415 | | |
394 | 416 | | |
395 | | - | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
396 | 420 | | |
397 | 421 | | |
398 | 422 | | |
399 | 423 | | |
400 | 424 | | |
401 | | - | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
402 | 433 | | |
403 | 434 | | |
404 | 435 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| |||
218 | 219 | | |
219 | 220 | | |
220 | 221 | | |
| 222 | + | |
221 | 223 | | |
222 | 224 | | |
223 | 225 | | |
| |||
252 | 254 | | |
253 | 255 | | |
254 | 256 | | |
| 257 | + | |
255 | 258 | | |
256 | 259 | | |
257 | 260 | | |
| 261 | + | |
258 | 262 | | |
259 | 263 | | |
260 | 264 | | |
| |||
267 | 271 | | |
268 | 272 | | |
269 | 273 | | |
| 274 | + | |
270 | 275 | | |
271 | 276 | | |
272 | 277 | | |
| 278 | + | |
273 | 279 | | |
274 | 280 | | |
275 | 281 | | |
| |||
332 | 338 | | |
333 | 339 | | |
334 | 340 | | |
| 341 | + | |
335 | 342 | | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
336 | 348 | | |
337 | 349 | | |
338 | 350 | | |
| |||
369 | 381 | | |
370 | 382 | | |
371 | 383 | | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
372 | 393 | | |
373 | 394 | | |
374 | 395 | | |
| |||
429 | 450 | | |
430 | 451 | | |
431 | 452 | | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
432 | 483 | | |
433 | 484 | | |
434 | 485 | | |
| |||
601 | 652 | | |
602 | 653 | | |
603 | 654 | | |
604 | | - | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
605 | 661 | | |
606 | 662 | | |
607 | 663 | | |
| |||
733 | 789 | | |
734 | 790 | | |
735 | 791 | | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
736 | 802 | | |
737 | 803 | | |
738 | 804 | | |
739 | 805 | | |
740 | | - | |
| 806 | + | |
741 | 807 | | |
742 | | - | |
| 808 | + | |
743 | 809 | | |
744 | 810 | | |
745 | 811 | | |
746 | | - | |
| 812 | + | |
747 | 813 | | |
748 | | - | |
| 814 | + | |
749 | 815 | | |
750 | 816 | | |
751 | 817 | | |
752 | | - | |
753 | | - | |
| 818 | + | |
| 819 | + | |
754 | 820 | | |
755 | 821 | | |
756 | 822 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
102 | | - | |
103 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
104 | 114 | | |
105 | 115 | | |
106 | 116 | | |
| |||
136 | 146 | | |
137 | 147 | | |
138 | 148 | | |
| 149 | + | |
139 | 150 | | |
140 | 151 | | |
141 | 152 | | |
142 | | - | |
| 153 | + | |
143 | 154 | | |
144 | 155 | | |
145 | 156 | | |
146 | 157 | | |
147 | 158 | | |
148 | 159 | | |
149 | 160 | | |
150 | | - | |
| 161 | + | |
151 | 162 | | |
152 | 163 | | |
153 | 164 | | |
| |||
163 | 174 | | |
164 | 175 | | |
165 | 176 | | |
166 | | - | |
167 | | - | |
| 177 | + | |
| 178 | + | |
168 | 179 | | |
169 | 180 | | |
170 | | - | |
| 181 | + | |
171 | 182 | | |
172 | | - | |
| 183 | + | |
173 | 184 | | |
174 | 185 | | |
175 | 186 | | |
176 | 187 | | |
177 | 188 | | |
178 | 189 | | |
179 | 190 | | |
| 191 | + | |
180 | 192 | | |
181 | 193 | | |
182 | 194 | | |
| |||
238 | 250 | | |
239 | 251 | | |
240 | 252 | | |
241 | | - | |
242 | | - | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
243 | 261 | | |
244 | 262 | | |
245 | 263 | | |
| |||
0 commit comments