Skip to content

Restore private on #1875's widened members; disable SyntheticAccessor (#1912)#1926

Merged
bmander merged 1 commit into
mainfrom
restore-encapsulation-disable-syntheticaccessor-1912
Jul 17, 2026
Merged

Restore private on #1875's widened members; disable SyntheticAccessor (#1912)#1926
bmander merged 1 commit into
mainfrom
restore-encapsulation-disable-syntheticaccessor-1912

Conversation

@bmander

@bmander bmander commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Fixes #1912.

#1875 widened 34 declarations to clear lint's SyntheticAccessor findings: file-private Kotlin helpers → internal (effectively 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, forcing the same anti-encapsulation edit.

Changes

  • Opt SyntheticAccessor out in the lint disable {} block, with a one-line rationale (R8 optimize + single module).
  • Revert all 34 declarations to private: 23 Kotlin internalprivate (the Cursor.str/int/long/dbl + SQLiteDatabase.read extensions in LegacyDataImporter, the MyListRepository helpers, 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

…#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>
@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@bmander, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 14 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 09922b0c-0d54-4c50-b98f-1529f853329c

📥 Commits

Reviewing files that changed from the base of the PR and between 01c0970 and f2b1c0f.

📒 Files selected for processing (14)
  • onebusaway-android/build.gradle.kts
  • onebusaway-android/src/google/java/org/onebusaway/android/map/googlemapsv2/compose/GoogleComposeAdapter.kt
  • onebusaway-android/src/main/java/org/onebusaway/android/analytics/UmamiAnalytics.java
  • onebusaway-android/src/main/java/org/onebusaway/android/api/adapters/TripAdapters.kt
  • onebusaway-android/src/main/java/org/onebusaway/android/api/data/TripVehiclesDataSource.kt
  • onebusaway-android/src/main/java/org/onebusaway/android/app/di/LocationEntryPoint.kt
  • onebusaway-android/src/main/java/org/onebusaway/android/database/oba/LegacyDataImporter.kt
  • onebusaway-android/src/main/java/org/onebusaway/android/directions/util/DirectionsGenerator.kt
  • onebusaway-android/src/main/java/org/onebusaway/android/extrapolation/GammaExtrapolator.kt
  • onebusaway-android/src/main/java/org/onebusaway/android/extrapolation/math/prob/GammaDistribution.kt
  • onebusaway-android/src/main/java/org/onebusaway/android/nav/NavigationServiceProvider.java
  • onebusaway-android/src/main/java/org/onebusaway/android/nav/NavigationUploadWorker.java
  • onebusaway-android/src/main/java/org/onebusaway/android/ui/HomeActivity.kt
  • onebusaway-android/src/main/java/org/onebusaway/android/ui/mylists/MyListRepository.kt
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch restore-encapsulation-disable-syntheticaccessor-1912

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@bmander
bmander merged commit c80aae3 into main Jul 17, 2026
3 checks passed
@bmander
bmander deleted the restore-encapsulation-disable-syntheticaccessor-1912 branch July 17, 2026 03:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SyntheticAccessor lintbust (#1875) traded encapsulation for a check R8 makes moot — disable the check

1 participant