@descryy/adapter-java 0.2.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +8 -0
- package/dist/adapter.d.ts +5 -7
- package/dist/adapter.d.ts.map +1 -1
- package/dist/adapter.js +80 -95
- package/dist/adapter.js.map +1 -1
- package/dist/client.d.ts +65 -119
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +121 -222
- package/dist/client.js.map +1 -1
- package/dist/extract.d.ts +13 -22
- package/dist/extract.d.ts.map +1 -1
- package/dist/extract.js +189 -288
- package/dist/extract.js.map +1 -1
- package/dist/jpa.d.ts +32 -73
- package/dist/jpa.d.ts.map +1 -1
- package/dist/jpa.js +72 -166
- package/dist/jpa.js.map +1 -1
- package/dist/parse.d.ts +83 -152
- package/dist/parse.d.ts.map +1 -1
- package/dist/parse.js +101 -183
- package/dist/parse.js.map +1 -1
- package/dist/spring.d.ts +24 -58
- package/dist/spring.d.ts.map +1 -1
- package/dist/spring.js +80 -209
- package/dist/spring.js.map +1 -1
- package/package.json +16 -7
package/dist/spring.d.ts
CHANGED
|
@@ -1,56 +1,26 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The HTTP-route framework extractor for Java — Spring MVC and Spring WebFlux.
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* ## Where the precision risk IS
|
|
25
|
-
*
|
|
26
|
-
* A served path is the class-level prefix joined to the method-level suffix:
|
|
27
|
-
*
|
|
28
|
-
* @RestController
|
|
29
|
-
* @RequestMapping("/orders") <- the prefix
|
|
30
|
-
* class Routes {
|
|
31
|
-
* @GetMapping("/{id}") <- the suffix
|
|
32
|
-
*
|
|
33
|
-
* **An extractor reading only the method annotation produces `/{id}`, which
|
|
34
|
-
* normalises to `/{param}`, joins to no endpoint, and is a wrong edge** — worse
|
|
35
|
-
* than emitting nothing under rule 2, because a wrong edge corrupts every layer
|
|
36
|
-
* above it while a missing one is a disclosed gap. The Java conformance fixture
|
|
37
|
-
* is deliberately shaped to fail that implementation.
|
|
38
|
-
*
|
|
39
|
-
* ## `@RequestMapping` is not a fallback — it is the dominant form
|
|
40
|
-
*
|
|
41
|
-
* Measured before writing, and it changed the shape of this file:
|
|
42
|
-
*
|
|
43
|
-
* | repository | `@GetMapping` | `@RequestMapping` |
|
|
44
|
-
* | --- | --- | --- |
|
|
45
|
-
* | `spring-petclinic` | 12 | 2 |
|
|
46
|
-
* | `shopizer` | 85 | **194** |
|
|
47
|
-
* | `mall` | **0** | **291** |
|
|
48
|
-
*
|
|
49
|
-
* **`mall` uses `@RequestMapping` exclusively.** An extractor supporting only
|
|
50
|
-
* the verb-specific shortcuts scores zero on all 291 of its routes — not a
|
|
51
|
-
* degraded number, zero, with nothing in the output to say why. Both mechanisms
|
|
52
|
-
* are therefore first-class here, and the bench counts them separately so a
|
|
53
|
-
* total miss on one cannot average into a single healthy-looking figure.
|
|
2
|
+
* The HTTP-route framework extractor for Java — Spring MVC and Spring WebFlux. **An `API_ROUTE`
|
|
3
|
+
* is a framework claim, earned here.** DEC-127 fixed the admission rules before any of this was
|
|
4
|
+
* written — a written rule is falsifiable by a count, one living only in code is not.
|
|
5
|
+
*
|
|
6
|
+
* Where the precision risk is NOT: `adapter-python/src/routes.ts` spends most of its length on
|
|
7
|
+
* `@mock.patch` looking like an HTTP verb (1,150 in `saleor`). Measured across
|
|
8
|
+
* `spring-petclinic`, `shopizer`, `mall` and `airbyte`: `@Get(`, `@Path(` and Micronaut's
|
|
9
|
+
* `@Controller` occur **0** times — Spring's annotation names don't collide with anything, so
|
|
10
|
+
* receiver-provenance machinery isn't the work here.
|
|
11
|
+
*
|
|
12
|
+
* Where the precision risk IS: the path join. A served path is the class-level prefix joined to
|
|
13
|
+
* the method-level suffix (`@RequestMapping("/orders")` on the class, `@GetMapping("/{id}")` on
|
|
14
|
+
* the method → `/orders/{id}`). **Reading only the method annotation produces `/{id}`,
|
|
15
|
+
* normalises to `/{param}`, and joins to no endpoint — a wrong edge**, worse than emitting
|
|
16
|
+
* nothing (rule 2: a wrong edge corrupts every layer above it). The conformance fixture is
|
|
17
|
+
* shaped to catch exactly this.
|
|
18
|
+
*
|
|
19
|
+
* `@RequestMapping` is the dominant form, not a fallback. Measured `@GetMapping`/`@RequestMapping`
|
|
20
|
+
* counts: `spring-petclinic` 12/2, `shopizer` 85/194, `mall` 0/291. `mall` uses
|
|
21
|
+
* `@RequestMapping` exclusively — an extractor supporting only verb-specific shortcuts scores
|
|
22
|
+
* zero on all 291 of its routes. Both mechanisms are first-class here, and the bench counts them
|
|
23
|
+
* separately so a total miss on one can't average into a healthy-looking figure.
|
|
54
24
|
*/
|
|
55
25
|
import type { JavaUnit } from "./parse.ts";
|
|
56
26
|
/** A route as written, before normalisation. Mirrors the Go adapter's shape. */
|
|
@@ -65,12 +35,8 @@ export interface SpringRoute {
|
|
|
65
35
|
readonly framework: string;
|
|
66
36
|
}
|
|
67
37
|
/**
|
|
68
|
-
* Every JAX-RS route this compilation unit declares.
|
|
69
|
-
*
|
|
70
|
-
* A resource class is one carrying `@Path` — a class with verb-annotated
|
|
71
|
-
* methods but no `@Path` of its own is an abstract base, not itself served,
|
|
72
|
-
* mirroring Spring's own "no class mapping still needs a route-bearing
|
|
73
|
-
* annotation somewhere" shape.
|
|
38
|
+
* Every JAX-RS route this compilation unit declares. A resource class carries `@Path`;
|
|
39
|
+
* verb-annotated methods with no class `@Path` are an abstract base, not served.
|
|
74
40
|
*/
|
|
75
41
|
export declare function jaxrsRoutes(unit: JavaUnit): SpringRoute[];
|
|
76
42
|
/** Every route this compilation unit declares. */
|
package/dist/spring.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spring.d.ts","sourceRoot":"","sources":["../src/spring.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"spring.d.ts","sourceRoot":"","sources":["../src/spring.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAwC,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEjF,gFAAgF;AAChF,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,2DAA2D;IAC3D,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,qEAAqE;IACrE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AA0JD;;;GAGG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,QAAQ,GAAG,WAAW,EAAE,CAuCzD;AAED,kDAAkD;AAClD,wBAAgB,YAAY,CAAC,IAAI,EAAE,QAAQ,GAAG,WAAW,EAAE,CAuD1D"}
|
package/dist/spring.js
CHANGED
|
@@ -1,56 +1,26 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The HTTP-route framework extractor for Java — Spring MVC and Spring WebFlux.
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* ## Where the precision risk IS
|
|
25
|
-
*
|
|
26
|
-
* A served path is the class-level prefix joined to the method-level suffix:
|
|
27
|
-
*
|
|
28
|
-
* @RestController
|
|
29
|
-
* @RequestMapping("/orders") <- the prefix
|
|
30
|
-
* class Routes {
|
|
31
|
-
* @GetMapping("/{id}") <- the suffix
|
|
32
|
-
*
|
|
33
|
-
* **An extractor reading only the method annotation produces `/{id}`, which
|
|
34
|
-
* normalises to `/{param}`, joins to no endpoint, and is a wrong edge** — worse
|
|
35
|
-
* than emitting nothing under rule 2, because a wrong edge corrupts every layer
|
|
36
|
-
* above it while a missing one is a disclosed gap. The Java conformance fixture
|
|
37
|
-
* is deliberately shaped to fail that implementation.
|
|
38
|
-
*
|
|
39
|
-
* ## `@RequestMapping` is not a fallback — it is the dominant form
|
|
40
|
-
*
|
|
41
|
-
* Measured before writing, and it changed the shape of this file:
|
|
42
|
-
*
|
|
43
|
-
* | repository | `@GetMapping` | `@RequestMapping` |
|
|
44
|
-
* | --- | --- | --- |
|
|
45
|
-
* | `spring-petclinic` | 12 | 2 |
|
|
46
|
-
* | `shopizer` | 85 | **194** |
|
|
47
|
-
* | `mall` | **0** | **291** |
|
|
48
|
-
*
|
|
49
|
-
* **`mall` uses `@RequestMapping` exclusively.** An extractor supporting only
|
|
50
|
-
* the verb-specific shortcuts scores zero on all 291 of its routes — not a
|
|
51
|
-
* degraded number, zero, with nothing in the output to say why. Both mechanisms
|
|
52
|
-
* are therefore first-class here, and the bench counts them separately so a
|
|
53
|
-
* total miss on one cannot average into a single healthy-looking figure.
|
|
2
|
+
* The HTTP-route framework extractor for Java — Spring MVC and Spring WebFlux. **An `API_ROUTE`
|
|
3
|
+
* is a framework claim, earned here.** DEC-127 fixed the admission rules before any of this was
|
|
4
|
+
* written — a written rule is falsifiable by a count, one living only in code is not.
|
|
5
|
+
*
|
|
6
|
+
* Where the precision risk is NOT: `adapter-python/src/routes.ts` spends most of its length on
|
|
7
|
+
* `@mock.patch` looking like an HTTP verb (1,150 in `saleor`). Measured across
|
|
8
|
+
* `spring-petclinic`, `shopizer`, `mall` and `airbyte`: `@Get(`, `@Path(` and Micronaut's
|
|
9
|
+
* `@Controller` occur **0** times — Spring's annotation names don't collide with anything, so
|
|
10
|
+
* receiver-provenance machinery isn't the work here.
|
|
11
|
+
*
|
|
12
|
+
* Where the precision risk IS: the path join. A served path is the class-level prefix joined to
|
|
13
|
+
* the method-level suffix (`@RequestMapping("/orders")` on the class, `@GetMapping("/{id}")` on
|
|
14
|
+
* the method → `/orders/{id}`). **Reading only the method annotation produces `/{id}`,
|
|
15
|
+
* normalises to `/{param}`, and joins to no endpoint — a wrong edge**, worse than emitting
|
|
16
|
+
* nothing (rule 2: a wrong edge corrupts every layer above it). The conformance fixture is
|
|
17
|
+
* shaped to catch exactly this.
|
|
18
|
+
*
|
|
19
|
+
* `@RequestMapping` is the dominant form, not a fallback. Measured `@GetMapping`/`@RequestMapping`
|
|
20
|
+
* counts: `spring-petclinic` 12/2, `shopizer` 85/194, `mall` 0/291. `mall` uses
|
|
21
|
+
* `@RequestMapping` exclusively — an extractor supporting only verb-specific shortcuts scores
|
|
22
|
+
* zero on all 291 of its routes. Both mechanisms are first-class here, and the bench counts them
|
|
23
|
+
* separately so a total miss on one can't average into a healthy-looking figure.
|
|
54
24
|
*/
|
|
55
25
|
/** Verb-specific shortcuts. The verb is fixed by the annotation's own name. */
|
|
56
26
|
const SHORTCUTS = new Map([
|
|
@@ -63,14 +33,10 @@ const SHORTCUTS = new Map([
|
|
|
63
33
|
const MAPPING = "RequestMapping";
|
|
64
34
|
const ALL_VERBS = ["GET", "POST", "PUT", "PATCH", "DELETE"];
|
|
65
35
|
/**
|
|
66
|
-
* The packages whose presence makes an annotation Spring's.
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
* decorator or a base class, or from nothing. A `@GetMapping` in a file that
|
|
71
|
-
* imports no Spring package is not a Spring route, and this corpus contains
|
|
72
|
-
* exactly the counter-case that matters: `airbyte` is a large, active, real Java
|
|
73
|
-
* codebase on Micronaut where the correct output of this file is **nothing**.
|
|
36
|
+
* The packages whose presence makes an annotation Spring's. Provenance, not spelling: a node
|
|
37
|
+
* type comes from an import, a decorator or a base class, or from nothing. `airbyte` is the
|
|
38
|
+
* counter-case that matters — a large, real Java codebase on Micronaut where this file's
|
|
39
|
+
* correct output is **nothing**.
|
|
74
40
|
*/
|
|
75
41
|
const SPRING_PACKAGES = [
|
|
76
42
|
"org.springframework.web.bind.annotation",
|
|
@@ -85,18 +51,12 @@ function importsSpring(unit) {
|
|
|
85
51
|
return unit.wildcardImports.some((pkg) => SPRING_PACKAGES.includes(pkg));
|
|
86
52
|
}
|
|
87
53
|
/**
|
|
88
|
-
* The path an annotation declares, or `undefined` when it declares none.
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
* `path =`. All three are the same thing and an extractor reading only the first
|
|
92
|
-
* misses `@RequestMapping(value = "/x", method = …)`, which is the form that
|
|
93
|
-
* dominates `mall` and `shopizer` — the named form is *required* as soon as a
|
|
94
|
-
* second argument appears, so the dominant mechanism and the named form arrive
|
|
95
|
-
* together.
|
|
54
|
+
* The path an annotation declares, or `undefined` when it declares none. Reads all three
|
|
55
|
+
* equivalent forms — unnamed argument, `value =`, `path =` — since the named form is required
|
|
56
|
+
* once a second argument appears, and that's the dominant shape in `mall`/`shopizer`.
|
|
96
57
|
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
* only the first would lose 39% of one corpus silently.
|
|
58
|
+
* Returns a list: `@GetMapping({"/a","/b"})` serves both, and `shopizer` writes 140 of its 356
|
|
59
|
+
* mappings that way — taking only the first would lose 39% of one corpus silently.
|
|
100
60
|
*/
|
|
101
61
|
function pathsOf(annotation) {
|
|
102
62
|
if (annotation.values.length > 0)
|
|
@@ -104,16 +64,12 @@ function pathsOf(annotation) {
|
|
|
104
64
|
return annotation.named.get("value") ?? annotation.named.get("path") ?? [];
|
|
105
65
|
}
|
|
106
66
|
/**
|
|
107
|
-
* The verbs a mapping annotation covers.
|
|
67
|
+
* The verbs a mapping annotation covers. `method = RequestMethod.GET` is a field access, not a
|
|
68
|
+
* literal, so it's read from raw argument text — the parse doesn't special-case Spring's enum
|
|
69
|
+
* (rule 1: no framework vocabulary in the language layer).
|
|
108
70
|
*
|
|
109
|
-
* `
|
|
110
|
-
*
|
|
111
|
-
* Spring's enum, because a framework's vocabulary in the language layer is the
|
|
112
|
-
* leak rule 1 forbids.
|
|
113
|
-
*
|
|
114
|
-
* **`@RequestMapping` with no `method` covers every verb**, and DEC-127 says to
|
|
115
|
-
* emit one route per verb rather than one route with an unknown verb. A route
|
|
116
|
-
* whose method is a guess joins to the wrong endpoint or to none.
|
|
71
|
+
* `@RequestMapping` with no `method` covers every verb; DEC-127 emits one route per verb rather
|
|
72
|
+
* than guessing, since a guessed method joins to the wrong endpoint or to none.
|
|
117
73
|
*/
|
|
118
74
|
function verbsOf(annotation) {
|
|
119
75
|
const shortcut = SHORTCUTS.get(annotation.name);
|
|
@@ -135,11 +91,9 @@ function mappingOf(annotations) {
|
|
|
135
91
|
return annotations.find((each) => SHORTCUTS.has(each.name) || each.name === MAPPING);
|
|
136
92
|
}
|
|
137
93
|
/**
|
|
138
|
-
* Join a class prefix to a method suffix.
|
|
139
|
-
*
|
|
140
|
-
*
|
|
141
|
-
* spellings freely; the template has to come out the same either way or two
|
|
142
|
-
* files declaring the same URL mint two endpoint ids and join to nothing.
|
|
94
|
+
* Join a class prefix to a method suffix. Spring is forgiving about the slash on either side;
|
|
95
|
+
* the template must come out the same regardless, or two files declaring the same URL mint two
|
|
96
|
+
* endpoint ids that join to nothing.
|
|
143
97
|
*/
|
|
144
98
|
function join(prefix, suffix) {
|
|
145
99
|
const left = prefix.replace(/\/+$/, "");
|
|
@@ -149,71 +103,21 @@ function join(prefix, suffix) {
|
|
|
149
103
|
return `${left}/${right}`;
|
|
150
104
|
}
|
|
151
105
|
/**
|
|
152
|
-
* Is this type a Spring web controller, and does it serve DATA or PAGES?
|
|
153
|
-
*
|
|
154
|
-
*
|
|
155
|
-
*
|
|
156
|
-
*
|
|
157
|
-
*
|
|
158
|
-
*
|
|
159
|
-
*
|
|
160
|
-
*
|
|
161
|
-
*
|
|
162
|
-
*
|
|
163
|
-
*
|
|
164
|
-
*
|
|
165
|
-
*
|
|
166
|
-
*
|
|
167
|
-
* | `shopizer` | 195 | 3 |
|
|
168
|
-
* | `mall` | 239 | 0 |
|
|
169
|
-
*
|
|
170
|
-
* **`spring-petclinic` is a server-rendered Thymeleaf application.** Nearly
|
|
171
|
-
* every one of its handlers returns a template name. Shipping the disclosure
|
|
172
|
-
* would have put the predicted precision ceiling at ~96%, under this lane's 98%
|
|
173
|
-
* bar, on a **wrong edge** rather than a gap — and rule 2 does not treat those
|
|
174
|
-
* the same. So the prediction did its job: it turned "a known limit, disclosed"
|
|
175
|
-
* into "too large to disclose", before a draw rather than after.
|
|
176
|
-
*
|
|
177
|
-
* ## The rule, and the recall it used to cost
|
|
178
|
-
*
|
|
179
|
-
* A handler is admitted when its class is `@RestController`, **or** its class or
|
|
180
|
-
* the handler itself carries `@ResponseBody`, **or** it returns
|
|
181
|
-
* `ResponseEntity<T>`.
|
|
182
|
-
*
|
|
183
|
-
* The third clause was a disclosed gap and is now closed, and the way it closed
|
|
184
|
-
* is the point. The disclosure pre-registered its own threshold — *"not worth
|
|
185
|
-
* it yet… if a corpus later shows the number in the dozens, it becomes worth
|
|
186
|
-
* it, and the count is here to be re-run"* — so re-running the count is what
|
|
187
|
-
* decided it, not a later reading of the same evidence.
|
|
188
|
-
*
|
|
189
|
-
* **Both halves of the old disclosure were wrong, and in opposite directions.**
|
|
190
|
-
*
|
|
191
|
-
* | corpus | files, as disclosed → recounted | sites refused, disclosed → recounted |
|
|
192
|
-
* | --- | --- | --- |
|
|
193
|
-
* | `spring-petclinic` | 5 → 6 | 17 → 17 |
|
|
194
|
-
* | `shopizer` | 3 → **20** | 6 → **74** |
|
|
195
|
-
* | `mall` | 0 → 2 | 0 → 5 |
|
|
196
|
-
*
|
|
197
|
-
* The refused population was **twelve times** what the disclosure claimed for
|
|
198
|
-
* `shopizer`. *"The gap carries its population, because a disclosure without one
|
|
199
|
-
* is a sentence that has shed its scope"* — and a population stated once and
|
|
200
|
-
* never re-measured sheds its scope quietly, which is worse than never stating
|
|
201
|
-
* one, because it reads as due diligence.
|
|
202
|
-
*
|
|
203
|
-
* The other half went the other way: `ResponseEntity` was counted in
|
|
204
|
-
* **mentions** (12), and a mention is not a refused route. Counted as routes
|
|
205
|
-
* the widening actually emits, it is **13 on `shopizer` and 0 on the other
|
|
206
|
-
* two** — the unit the rule's subject is in, which is the only unit a threshold
|
|
207
|
-
* can be compared against.
|
|
208
|
-
*
|
|
209
|
-
* `spring-petclinic`'s 17 remain refused and must: they return `String` view
|
|
210
|
-
* names, and it is five files of server-rendered pages. The widening is
|
|
211
|
-
* therefore narrow by construction — `ResponseEntity` is Spring's own response
|
|
212
|
-
* type, never resolved through a view resolver, and no other return type
|
|
213
|
-
* answers the question on its own.
|
|
214
|
-
*
|
|
215
|
-
* Re-run after the widening, as every widening in this lane is: route precision
|
|
216
|
-
* 200/200 on a 538 population, Wilson LB 98.1%, negative control 0/200.
|
|
106
|
+
* Is this type a Spring web controller, and does it serve DATA or PAGES? `@RestController` is
|
|
107
|
+
* `@Controller` + `@ResponseBody`: every handler returns data. A bare `@Controller` returns
|
|
108
|
+
* **view names** unless a handler opts out with its own `@ResponseBody`.
|
|
109
|
+
*
|
|
110
|
+
* Measured before implementing the view/data split (routes admitted from `@Controller` with no
|
|
111
|
+
* `@ResponseBody`): `spring-petclinic` 16 routes, **15 — 93.8%**; `shopizer` 195 routes, 3;
|
|
112
|
+
* `mall` 239 routes, 0. `spring-petclinic` is a server-rendered Thymeleaf app — admitting both
|
|
113
|
+
* kinds would put the precision ceiling at ~96%, under this lane's 98% bar, on a **wrong edge**
|
|
114
|
+
* rather than a gap (rule 2 doesn't treat those the same).
|
|
115
|
+
*
|
|
116
|
+
* A handler is admitted when its class is `@RestController`, **or** its class or the handler
|
|
117
|
+
* carries `@ResponseBody`, **or** it returns `ResponseEntity<T>` — Spring's own response type,
|
|
118
|
+
* which never resolves through a view resolver and so answers the data/page question on its own
|
|
119
|
+
* regardless of annotations. Route precision after this rule: 200/200 on a 538 population,
|
|
120
|
+
* Wilson LB 98.1%, negative control 0/200.
|
|
217
121
|
*/
|
|
218
122
|
function controllerKind(type) {
|
|
219
123
|
const names = new Set(type.annotations.map((each) => each.name));
|
|
@@ -224,45 +128,28 @@ function controllerKind(type) {
|
|
|
224
128
|
return names.has("ResponseBody") ? "data" : "view";
|
|
225
129
|
}
|
|
226
130
|
/**
|
|
227
|
-
* Does this handler return an HTTP body rather than a view name?
|
|
228
|
-
*
|
|
229
|
-
* `
|
|
230
|
-
* a view resolver, so a `@Controller` method returning one is an API route with
|
|
231
|
-
* or without `@ResponseBody`. It is the one return type that answers this
|
|
232
|
-
* question on its own; anything else — `String`, `ModelAndView`, a DTO — either
|
|
233
|
-
* *is* a view name or needs the annotation to say it is not.
|
|
131
|
+
* Does this handler return an HTTP body rather than a view name? `ResponseEntity<T>` never
|
|
132
|
+
* resolves through a view resolver, so it answers this on its own; anything else needs
|
|
133
|
+
* `@ResponseBody` to say it isn't a view.
|
|
234
134
|
*/
|
|
235
135
|
function returnsBody(method) {
|
|
236
136
|
const returned = method.returnType;
|
|
237
137
|
return returned.kind === "named" && returned.name === "ResponseEntity";
|
|
238
138
|
}
|
|
239
|
-
//
|
|
240
|
-
//
|
|
241
|
-
//
|
|
242
|
-
// resource — real in any Java shop that predates or skipped Spring Boot, or
|
|
243
|
-
// that uses Quarkus/RESTEasy/Jersey, all of which build on the same
|
|
244
|
-
// annotations — produced nothing here, correctly refused by
|
|
245
|
-
// {@link importsSpring} rather than misread, but with no route reader for the
|
|
246
|
-
// framework it was refusing in favour of.
|
|
139
|
+
// JAX-RS (`javax.ws.rs`/`jakarta.ws.rs`) — a resource on Quarkus/RESTEasy/Jersey/plain JAX-RS
|
|
140
|
+
// previously produced nothing, correctly refused by {@link importsSpring} but with no reader
|
|
141
|
+
// for the framework it refused in favour of.
|
|
247
142
|
//
|
|
248
|
-
//
|
|
249
|
-
//
|
|
250
|
-
//
|
|
251
|
-
// JAX-RS
|
|
252
|
-
//
|
|
253
|
-
// method, or both. `@RequestMapping`'s "no method means every verb" rule
|
|
254
|
-
// (DEC-127) has no JAX-RS analogue: a JAX-RS handler with no verb annotation
|
|
255
|
-
// is not a route at all, so there is nothing to widen to every verb — it is
|
|
256
|
-
// simply skipped, the same way a plain non-`@Path` class is.
|
|
257
|
-
// ---------------------------------------------------------------------------
|
|
143
|
+
// Structurally different from Spring, hence a second reader: Spring puts verb and path on one
|
|
144
|
+
// annotation; JAX-RS splits them into a bare verb marker (`@GET`, no arguments) and a separate,
|
|
145
|
+
// optional `@Path` (class, method, or both). No analogue to `@RequestMapping`'s "no method means
|
|
146
|
+
// every verb" (DEC-127) — a JAX-RS handler with no verb annotation isn't a route at all, so it's
|
|
147
|
+
// simply skipped.
|
|
258
148
|
const JAXRS_PACKAGES = ["javax.ws.rs", "jakarta.ws.rs"];
|
|
259
149
|
/**
|
|
260
|
-
* Does this unit import JAX-RS at all?
|
|
261
|
-
*
|
|
262
|
-
*
|
|
263
|
-
* checked — a real migration takes years, and a corpus written against either
|
|
264
|
-
* spelling is real code, the same reasoning `adapter-java`'s JPA reader
|
|
265
|
-
* already applies to `javax.persistence`/`jakarta.persistence`.
|
|
150
|
+
* Does this unit import JAX-RS at all? Both `javax.ws.rs` and the Jakarta-renamed
|
|
151
|
+
* `jakarta.ws.rs` are checked — a real migration takes years, same reasoning as the JPA reader's
|
|
152
|
+
* `javax`/`jakarta.persistence` split.
|
|
266
153
|
*/
|
|
267
154
|
function importsJaxRs(unit) {
|
|
268
155
|
for (const fqn of unit.singleTypeImports.values()) {
|
|
@@ -271,11 +158,7 @@ function importsJaxRs(unit) {
|
|
|
271
158
|
}
|
|
272
159
|
return unit.wildcardImports.some((pkg) => JAXRS_PACKAGES.includes(pkg));
|
|
273
160
|
}
|
|
274
|
-
/**
|
|
275
|
-
* JAX-RS's verb annotations. Each is a bare marker with no arguments — the
|
|
276
|
-
* verb is the annotation's own name, never a `method = ` attribute the way
|
|
277
|
-
* Spring's `@RequestMapping` carries one.
|
|
278
|
-
*/
|
|
161
|
+
/** JAX-RS verb annotations — bare markers, unlike Spring's `method =` attribute. */
|
|
279
162
|
const JAXRS_VERBS = new Set(["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"]);
|
|
280
163
|
function jaxrsVerbOf(annotations) {
|
|
281
164
|
return annotations.map((each) => each.name).find((name) => JAXRS_VERBS.has(name));
|
|
@@ -284,12 +167,8 @@ function jaxrsPathOf(annotations) {
|
|
|
284
167
|
return annotations.find((each) => each.name === "Path");
|
|
285
168
|
}
|
|
286
169
|
/**
|
|
287
|
-
* Every JAX-RS route this compilation unit declares.
|
|
288
|
-
*
|
|
289
|
-
* A resource class is one carrying `@Path` — a class with verb-annotated
|
|
290
|
-
* methods but no `@Path` of its own is an abstract base, not itself served,
|
|
291
|
-
* mirroring Spring's own "no class mapping still needs a route-bearing
|
|
292
|
-
* annotation somewhere" shape.
|
|
170
|
+
* Every JAX-RS route this compilation unit declares. A resource class carries `@Path`;
|
|
171
|
+
* verb-annotated methods with no class `@Path` are an abstract base, not served.
|
|
293
172
|
*/
|
|
294
173
|
export function jaxrsRoutes(unit) {
|
|
295
174
|
if (!importsJaxRs(unit))
|
|
@@ -307,10 +186,8 @@ export function jaxrsRoutes(unit) {
|
|
|
307
186
|
continue;
|
|
308
187
|
const methodPath = jaxrsPathOf(method.annotations);
|
|
309
188
|
const suffixes = methodPath === undefined ? [] : pathsOf(methodPath);
|
|
310
|
-
// Mirrors Spring's
|
|
311
|
-
//
|
|
312
|
-
// guessed; a handler with no `@Path` at all legally serves the class
|
|
313
|
-
// prefix bare.
|
|
189
|
+
// Mirrors Spring's `unreadable` rule: an unreadable `@Path` argument is refused, not
|
|
190
|
+
// guessed; no `@Path` at all legally serves the bare prefix.
|
|
314
191
|
const unreadable = methodPath !== undefined && suffixes.length === 0 && methodPath.rawArguments.length > 0;
|
|
315
192
|
if (unreadable)
|
|
316
193
|
continue;
|
|
@@ -343,10 +220,8 @@ export function springRoutes(unit) {
|
|
|
343
220
|
const kind = controllerKind(type);
|
|
344
221
|
if (kind === null)
|
|
345
222
|
continue;
|
|
346
|
-
//
|
|
347
|
-
//
|
|
348
|
-
// The class-level prefix. A controller mapped to several prefixes serves
|
|
349
|
-
// every combination, so the empty case is one empty prefix rather than none.
|
|
223
|
+
// Class-level prefix: no `@RequestMapping` path contributes nothing (not a slash); several
|
|
224
|
+
// prefixes serve every combination, so empty means one empty prefix, not zero.
|
|
350
225
|
const classMapping = mappingOf(type.annotations);
|
|
351
226
|
const classPaths = classMapping === undefined ? [] : pathsOf(classMapping);
|
|
352
227
|
const prefixes = classPaths.length > 0 ? classPaths : [""];
|
|
@@ -354,21 +229,17 @@ export function springRoutes(unit) {
|
|
|
354
229
|
const mapping = mappingOf(method.annotations);
|
|
355
230
|
if (mapping === undefined)
|
|
356
231
|
continue;
|
|
357
|
-
// A view
|
|
358
|
-
// `spring-petclinic`'s VetController
|
|
359
|
-
// why this is decided per handler and not per class.
|
|
232
|
+
// A view handler serves a page unless it opts out itself — decided per handler, not per
|
|
233
|
+
// class: `spring-petclinic`'s VetController mixes both.
|
|
360
234
|
if (kind === "view" &&
|
|
361
235
|
!method.annotations.some((each) => each.name === "ResponseBody") &&
|
|
362
236
|
!returnsBody(method)) {
|
|
363
237
|
continue;
|
|
364
238
|
}
|
|
365
239
|
const suffixes = pathsOf(mapping);
|
|
366
|
-
// A
|
|
367
|
-
//
|
|
368
|
-
//
|
|
369
|
-
// the wrong service. A mapping with no argument at all is legal and means
|
|
370
|
-
// "the class prefix", so it is only refused when there was something to
|
|
371
|
-
// read and it could not be read.
|
|
240
|
+
// A constant-reference or concatenated path yields no literal. DEC-127: refused rather
|
|
241
|
+
// than invented (else it joins to the wrong service). No argument at all is legal and
|
|
242
|
+
// means "the class prefix" — only refused when something was there and unreadable.
|
|
372
243
|
const unreadable = suffixes.length === 0 && mapping.rawArguments.length > 0;
|
|
373
244
|
if (unreadable)
|
|
374
245
|
continue;
|
package/dist/spring.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spring.js","sourceRoot":"","sources":["../src/spring.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"spring.js","sourceRoot":"","sources":["../src/spring.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAgBH,+EAA+E;AAC/E,MAAM,SAAS,GAAG,IAAI,GAAG,CAAiB;IACxC,CAAC,YAAY,EAAE,KAAK,CAAC;IACrB,CAAC,aAAa,EAAE,MAAM,CAAC;IACvB,CAAC,YAAY,EAAE,KAAK,CAAC;IACrB,CAAC,cAAc,EAAE,OAAO,CAAC;IACzB,CAAC,eAAe,EAAE,QAAQ,CAAC;CAC5B,CAAC,CAAC;AAEH,MAAM,OAAO,GAAG,gBAAgB,CAAC;AACjC,MAAM,SAAS,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAU,CAAC;AAErE;;;;;GAKG;AACH,MAAM,eAAe,GAAG;IACtB,yCAAyC;IACzC,gCAAgC;CACjC,CAAC;AAEF,yEAAyE;AACzE,SAAS,aAAa,CAAC,IAAc;IACnC,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,iBAAiB,CAAC,MAAM,EAAE,EAAE,CAAC;QAClD,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC;YAAE,OAAO,IAAI,CAAC;IAC5E,CAAC;IACD,OAAO,IAAI,CAAC,e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"name": "@descryy/adapter-java",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"description": "Java adapter, breadth tier. One grammar and one query set over the shared tree-sitter harness
|
|
5
|
+
"description": "Java adapter, breadth tier. One grammar and one query set over the shared tree-sitter harness — no JDT, no SCIP, no Spring. Reaches R1 on explicit imports, which is further than a breadth adapter reaches in most languages.",
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/descryhq-wq/descry-adapters.git",
|
|
10
|
+
"directory": "packages/adapter-java"
|
|
11
|
+
},
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/descryhq-wq/descry-adapters/issues"
|
|
14
|
+
},
|
|
15
|
+
"homepage": "https://github.com/descryhq-wq/descry-adapters#readme",
|
|
7
16
|
"engines": {
|
|
8
17
|
"node": ">=22.5"
|
|
9
18
|
},
|
|
@@ -25,12 +34,12 @@
|
|
|
25
34
|
"build:assets": "node -e \"require('fs').copyFileSync(require.resolve('tree-sitter-java/tree-sitter-java.wasm'),'dist/tree-sitter-java.wasm')\""
|
|
26
35
|
},
|
|
27
36
|
"dependencies": {
|
|
28
|
-
"@descryy/adapter-common": "0.
|
|
37
|
+
"@descryy/adapter-common": "0.2.0",
|
|
29
38
|
"@descryy/adapter-jvm": "0.1.0",
|
|
30
|
-
"@descryy/adapter-treesitter": "0.
|
|
31
|
-
"@descryy/ir": "0.
|
|
39
|
+
"@descryy/adapter-treesitter": "0.2.0",
|
|
40
|
+
"@descryy/ir": "0.5.1",
|
|
32
41
|
"tree-sitter-java": "0.23.5",
|
|
33
|
-
"@descryy/adapter-sql": "0.
|
|
34
|
-
"@descryy/adapter-openapi": "0.
|
|
42
|
+
"@descryy/adapter-sql": "0.3.1",
|
|
43
|
+
"@descryy/adapter-openapi": "0.3.1"
|
|
35
44
|
}
|
|
36
45
|
}
|