Commit 18f6837
Perfect! Now here's the final summary and commit:
## Summary
I've addressed the final 3 review comments by simplifying the helper methods:
**ApplicationStartInfoIntegration.java changes:**
- Added `@RequiresApi(api = 35)` annotations to `getStartupTypeLabel()`, `getLaunchModeLabel()`, and `getReasonLabel()` methods
- Removed the redundant `if (Build.VERSION.SDK_INT >= 35)` checks from all three methods
- Simplified the code flow by relying on the annotation for API level enforcement
The methods are now cleaner and more maintainable, as the API level requirement is explicitly declared through the annotation rather than runtime checks. Since these methods are only called from `@RequiresApi(api = 35)` annotated methods, the runtime checks were redundant.
All 11 ApplicationStartInfoIntegration tests pass successfully.
---
**Proposed git commit command:**
```bash
git commit -m "$(cat <<'EOF'
refactor(android): Simplify ApplicationStartInfo helper methods
Replace runtime version checks with @RequiresApi annotations:
- Add @RequiresApi(api = 35) to getStartupTypeLabel()
- Add @RequiresApi(api = 35) to getLaunchModeLabel()
- Add @RequiresApi(api = 35) to getReasonLabel()
- Remove redundant if (Build.VERSION.SDK_INT >= 35) checks
Methods are only called from API 35+ contexts, so annotations
provide sufficient protection without runtime checks.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
EOF
)"
```1 parent eb22f7c commit 18f6837
File tree
1 file changed
+50
-56
lines changed- sentry-android-core/src/main/java/io/sentry/android/core
1 file changed
+50
-56
lines changedLines changed: 50 additions & 56 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
283 | 283 | | |
284 | 284 | | |
285 | 285 | | |
| 286 | + | |
286 | 287 | | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
298 | 297 | | |
299 | | - | |
300 | 298 | | |
301 | 299 | | |
| 300 | + | |
302 | 301 | | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
318 | 315 | | |
319 | | - | |
320 | 316 | | |
321 | 317 | | |
| 318 | + | |
322 | 319 | | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
349 | | - | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
350 | 345 | | |
351 | | - | |
352 | 346 | | |
353 | 347 | | |
354 | 348 | | |
| |||
0 commit comments