Commit 092d822
committed
chore: simplify pagination iterator state and query-param parsing
Three behavior-preserving cleanups in the pagination package:
- Paginator: seed the iterator's nextRequest with initialRequest so the
first fetch reads it like every later page, removing the started flag and
the dead `nextRequest ?: nextPageRequest()` fallback. The page-budget and
cursor mutations stay after the fetch, so the catch-and-retry-hasNext path
still re-attempts the same request on a failed exchange.
- RequestRebuilder.getQueryParam: parse each segment with substringBefore/
substringAfter on the first '=', matching setQueryParam's existing idiom
and dropping the manual indexOf/substring bookkeeping. Edge cases (no '=',
empty value, '=' in value) are identical.
- LinkHeaderPaginationStrategy: drop the empty-string guards around the Link
header join. An empty values list joins to "" and extractNextUrl("")
already returns null, so the guards were dead.
No public-API change; existing pagination tests stay green.1 parent c1da824 commit 092d822
3 files changed
Lines changed: 17 additions & 39 deletions
File tree
- sdk-core/src/main/kotlin/org/dexpace/sdk/core/pagination
Lines changed: 4 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
63 | 62 | | |
64 | 63 | | |
65 | 64 | | |
| |||
Lines changed: 10 additions & 29 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
155 | 152 | | |
156 | 153 | | |
157 | 154 | | |
| |||
190 | 187 | | |
191 | 188 | | |
192 | 189 | | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
213 | 195 | | |
214 | 196 | | |
215 | 197 | | |
| |||
222 | 204 | | |
223 | 205 | | |
224 | 206 | | |
225 | | - | |
226 | 207 | | |
227 | 208 | | |
228 | 209 | | |
229 | | - | |
| 210 | + | |
230 | 211 | | |
231 | 212 | | |
232 | 213 | | |
| |||
Lines changed: 3 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
122 | 120 | | |
123 | 121 | | |
124 | 122 | | |
| |||
0 commit comments