Restore private on #1875's widened members; disable SyntheticAccessor (#1912)#1926
Conversation
…#1912) #1875 widened 34 declarations to clear lint's SyntheticAccessor findings: file-`private` Kotlin helpers → `internal` (app-global in this single-module app) and Java `private` → package-private. That traded real encapsulation for a micro-optimization the toolchain already erases — release builds enable R8 with `-allowaccessmodification` (#1868), which inlines/strips the synthetic accessors, and in debug the cost is a handful of trivial methods. Leaving the check enabled also taxed every future file-private helper called from a sibling class. - Opt SyntheticAccessor out in the lint `disable` block with a rationale. - Revert all 34 declarations to `private` (23 Kotlin `internal`→`private`, 11 Java package-private→`private`). Verified each is accessed only within its own file (Kotlin) or only inner↔outer within its own class (Java), so narrowing does not break any caller. No behavior change — visibility only. Compile (`-PwarningsAsErrors=true`, obaGoogle Kotlin + Java) passes clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 14 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (14)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Fixes #1912.
#1875 widened 34 declarations to clear lint's
SyntheticAccessorfindings: file-privateKotlin helpers →internal(effectively app-global in this single-module app) and Javaprivate→ package-private. That traded real encapsulation for a micro-optimization the toolchain already erases — release builds enable R8 with-allowaccessmodification(#1868), which inlines/strips the synthetic accessors, and in debug the cost is a handful of trivial methods. Leaving the check enabled also taxed every future file-private helper called from a sibling class, forcing the same anti-encapsulation edit.Changes
SyntheticAccessorout in the lintdisable {}block, with a one-line rationale (R8 optimize + single module).private: 23 Kotlininternal→private(theCursor.str/int/long/dbl+SQLiteDatabase.readextensions inLegacyDataImporter, theMyListRepositoryhelpers, map-adapter/gamma-math helpers,FocusedStop.fromIntent, …) and 11 Java package-private→private(NavigationServiceProvider×10,UmamiAnalytics.post,NavigationUploadWorker.logFeedback).Safety
No behavior change — visibility only. Before narrowing each member I verified it is accessed only within its own file (Kotlin top-level/extension helpers are file-scoped) or only inner↔outer within its own class (Java), so nothing breaks by re-privatizing.
Compile (
:onebusaway-android:compileObaGoogleDebugKotlin+compileObaGoogleDebugJavaWithJavac,-PwarningsAsErrors=true) passes clean. Lint is left for CI per the repo's guidance on local lint cost.🤖 Generated with Claude Code