Skip to content

chore: clear the Kotlin compiler warnings - #74

Merged
rocketraman merged 1 commit into
masterfrom
claude/kotlin-warnings-cleanup-48b0e7
Oct 27, 2026
Merged

rocketraman merged 1 commit into
masterfrom
claude/kotlin-warnings-cleanup-48b0e7

Conversation

@rocketraman

Copy link
Copy Markdown
Owner

Clears all eight warnings from the current Kotlin build.

What changed

  • GitHub.kt: drop the safe call in lastReview?.reactionGroups. reviewIsNewest already guarantees lastReview is non-null there.
  • WorktreeOps.kt: drop the own != null check from deletableUpstream. merged can only be true when own is non-null.
  • Clipboard (CopyPill, CopyAction, CopyTarget, CopyReportPill): move from the deprecated LocalClipboardManager to LocalClipboard. The new API only takes a ClipEntry, and on desktop that has to wrap an AWT Transferable through a constructor Compose still marks experimental. A small Clipboard.setText(String) helper in Components.kt wraps a StringSelection and holds the one @OptIn. Because the new API is suspend, the pills now copy inside a coroutine.
  • Main.kt: replace the deprecated painterResource("app-icon.png") with a lazily decoded appIcon (classpath bytes → Skia → BitmapPainter), shared by the window and the title bar. I chose this over adopting the Compose resources library (generated Res class, composeResources folder) for a single PNG. It loads through AppState::class.java, so it doesn't depend on the thread's context class loader either.

Verification

  • A forced :compileKotlin --rerun-tasks builds with no warnings. All 237 tests pass.
  • Ran the packaged app in an isolated headless kwin session: the title-bar icon renders. Copy branch and Copy path put the right text on the clipboard (checked with wl-paste) and show "✓ Copied".
  • Not checked at runtime: the taskbar icon (Wayland uses the app_id instead, and the headless session has no taskbar), and CopyAction / CopyTarget / the diagnostics-report pill. Those use the same helper.

- GitHub.kt: drop a safe call on a review already known non-null.
- WorktreeOps.kt: drop an `own != null` check that `merged` already implies.
- Clipboard: move the copy controls from the deprecated
  LocalClipboardManager to LocalClipboard, through a small
  Clipboard.setText helper that wraps an AWT StringSelection (the desktop
  ClipEntry constructor is still experimental, so the opt-in lives there).
- Main.kt: replace the deprecated painterResource with the app icon
  decoded once from the classpath via Skia, rather than pulling in the
  Compose resources library for one PNG. It loads through our own class,
  so it no longer depends on the thread's context class loader.

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Raman Gupta <rocketraman@gmail.com>
@rocketraman
rocketraman force-pushed the claude/kotlin-warnings-cleanup-48b0e7 branch from a6cfe12 to 3c644f2 Compare October 27, 2026 21:14
@rocketraman
rocketraman merged commit 82dbb1e into master Oct 27, 2026
2 checks passed
@rocketraman
rocketraman deleted the claude/kotlin-warnings-cleanup-48b0e7 branch October 27, 2026 21:20
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.

1 participant