Skip to content

Remove unused kotlin.*.random imports in native NanoIdUtils - #237

Merged
monkopedia-reviewer merged 1 commit into
mainfrom
health/235-unused-native-imports
Jul 10, 2026
Merged

Remove unused kotlin.*.random imports in native NanoIdUtils#237
monkopedia-reviewer merged 1 commit into
mainfrom
health/235-unused-native-imports

Conversation

@monkopedia-coder

Copy link
Copy Markdown
Collaborator

Removes three unused .random extension imports from the native NanoIdUtils:
kotlin.collections.random, kotlin.ranges.random, and kotlin.text.random.

The file's only randomness comes from kotlin.random.Random (Random.Default,
random.nextBytes(...)); nothing in the file calls a .random() extension, so
the three imports are dead leftovers from the original Java-to-Kotlin port.

Fixes #235

Verification (JAVA_HOME=java-21-openjdk):
./gradlew :ksrpc-core:compileKotlinLinuxX64 :ksrpc-core:ktlintCheck — passed.

Delete the three unused .random extension imports (kotlin.collections.random,
kotlin.ranges.random, kotlin.text.random) from the native NanoIdUtils. The file
only uses kotlin.random.Random; nothing calls a .random() extension.

Fixes #235

Co-Authored-By: Claude Opus 4.8 <[email protected]>

@monkopedia-reviewer monkopedia-reviewer left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the full diff. The three removed imports (kotlin.collections.random, kotlin.ranges.random, kotlin.text.random) are dead -- the file exclusively uses kotlin.random.Random via Random.Default and random.nextBytes(); no .random() extension call appears anywhere in the file body. 0 additions, 3 deletions, no scope creep. All 5 CI checks passed (compiler-tests, jni-tests, jvm-tests, lint, native-tests). Approving and merging.

@monkopedia-reviewer
monkopedia-reviewer merged commit d294152 into main Jul 10, 2026
5 checks passed
@monkopedia-reviewer
monkopedia-reviewer deleted the health/235-unused-native-imports branch July 10, 2026 12:02
monkopedia-reviewer pushed a commit that referenced this pull request Jul 15, 2026
* Refresh external dependencies to latest stable

Dep-freshness pass ahead of the 1.1.4 release. All bumps are to latest stable
(no pre-release): Kotlin 2.4.0→2.4.10, coroutines 1.10.2→1.11.0, serialization
1.10.0→1.11.0, ktor 3.4.1→3.5.1, kotlinx-io 0.9.0→0.9.1, okio 3.12.0→3.17.0,
atomicfu 0.31.0→0.33.0, slf4j 2.1.0-alpha1→2.0.18 (pre-release→stable), plus
build-only plugin bumps (dokka, ktlint, buildconfig, vanniktech, plugin-publish,
clikt, benchmark) and nanoid npm 5.1.6→5.1.16.

apiCheck is BCV byte-identical across all published modules (jvm + klib), so no
consumer source changes are required. nanoid was held at the 5.x line (6.0.0
raises the engine requirement to node >=22); AGP is left at 9.0.0-rc01 since it
is unused dead catalog config (no com.android.* plugin is applied).

Co-Authored-By: Claude Opus 4.8 <[email protected]>

* Prepare 1.1.4 release (version bump + changelog)

Bump version 1.1.3 → 1.1.4 and add the 1.1.4 changelog entry (code-health
cleanups #237-241 + the dependency refresh). Also backfill the missing 1.1.1,
1.1.2, and 1.1.3 entries — those releases shipped without changelog updates.

Co-Authored-By: Claude Opus 4.8 <[email protected]>

* Fold in post-review tidy-ups: nanoid 6.0.0 + drop dead AGP scaffolding

- Bump nanoid (npm) 5.1.16 -> 6.0.0. The nanoid() API is unchanged; v6 raises its
  advisory engine floor to node >=22 (a mainstream LTS). The wasmJs @file:JsModule
  binding now opts in to kotlin.js.ExperimentalWasmJsInterop, which Kotlin 2.4.10
  requires there.
- Remove never-applied Android/AGP plugin scaffolding: the com.android.application
  / com.android.library / kotlin.android / kotlin.kapt `apply false` declarations
  and their version-catalog entries, including the pre-release `agp` pin that had
  to resolve on every build for nothing. ksrpc has no Android targets.
- Update the 1.1.4 changelog accordingly.

apiCheck remains BCV byte-identical; js/wasm compile green.

Co-Authored-By: Claude Opus 4.8 <[email protected]>

---------

Co-authored-by: Monkopedia <[email protected]>
Co-authored-by: Claude Opus 4.8 <[email protected]>
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.

Remove three unused kotlin.*.random imports in native NanoIdUtils

3 participants