Overview › Kotlin / Java Interop & Modernization

Kotlin / Java Interop & Modernization

Kotlin-first new code, but ~9k Java files dominate; migration is incomplete.

27 findings in this category
55
SCORE

Summary

The repo is in mid-migration: 4,347 Kotlin files vs 9,039 Java files. New feature modules are Kotlin-first, but the app module and several legacy areas remain Java-heavy.

Findings

HIGH

Java-dominant app module

17 Java files remain in Costco/src/main/java/ covering app entry points and shopping flows.
Costco/src/main/java/com/costco/app/android/ui/main/MainActivity.javaCostco/src/main/java/com/costco/app/android/CostcoApplication.javaCostco/src/main/java/com/costco/app/android/ui/customview/SwipeAndDragListView.java
Recommendation: Migrate MainActivity and CostcoApplication to Kotlin first — they sit on the critical path of the app and unlock Kotlin-first idioms (Coroutines, scope functions, sealed classes) for downstream code.
MEDIUM

Nullability surface across the boundary

Java files without @Nullable/@NonNull annotations leak as platform types into Kotlin, undermining null-safety guarantees.
Recommendation: Annotate all public Java APIs with JSR-305 / Jetpack annotations (@NonNull, @Nullable); enable -Xjsr305=strict in kotlinOptions.
MEDIUM

Legacy Handler/LooperThread pattern

LooperThread.java uses raw Handler threading rather than coroutines.
Costco/src/main/java/.../LooperThread.java
Recommendation: Replace with CoroutineScope(Dispatchers.Default) and Channel / Flow.
LOW

Volley still wired up

VolleyManagerModule indicates Google Volley is still part of the networking stack alongside Retrofit/OkHttp.
Recommendation: Audit Volley call sites; migrate to Retrofit so there is one HTTP stack to monitor, instrument, and secure.

Migration Plan Suggested

  1. Annotate public Java APIs with nullability annotations.
  2. Convert CostcoApplication + MainActivity to Kotlin.
  3. Pick one feature/quarter (e.g. ShoppingList) and convert wholesale.
  4. Retire Volley once all callers move to Retrofit.
  5. Track Java LoC reduction as a per-sprint KPI.

Specific findings in this category

27 shown
Costco Android · Code Review Report · Generated 2026-05-07 · 626 machine-curated findings