fix(android): detekt + silence JDK 22+ native-access warning

Three issues:

* AdminRequestsScreen line 105 MagicNumber on UUID prefix length 8.
  Extracted to USER_ID_PREFIX_LEN with rationale.
* LibraryRepository TooManyFunctions (12/11) after shuffleLibrary
  addition. Same pattern as PlayerController / AuthStore: @Suppress
  at the class with rationale (function count scales with entity-
  family count, splitting would scatter plumbing).
* JDK 22+ "restricted method java.lang.System::load" warning from
  Gradle's bundled native-platform jar. Add
  --enable-native-access=ALL-UNNAMED to org.gradle.jvmargs so the
  daemon opts the native loader in. Future-compat: Gradle will
  declare this in the jar's manifest eventually and the flag becomes
  redundant.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-27 11:22:53 -04:00
parent 92a9b55c12
commit de79cf0342
3 changed files with 17 additions and 2 deletions
@@ -102,7 +102,7 @@ private fun RequestList(
AdminRequestRow( AdminRequestRow(
req = req, req = req,
requester = usernames[req.userId] requester = usernames[req.userId]
?: req.userId.takeIf { it.isNotEmpty() }?.take(8) ?: req.userId.takeIf { it.isNotEmpty() }?.take(USER_ID_PREFIX_LEN)
?: "unknown", ?: "unknown",
onApprove = { onApprove(req.id) }, onApprove = { onApprove(req.id) },
onReject = { onReject(req.id) }, onReject = { onReject(req.id) },
@@ -176,3 +176,7 @@ private fun LoadingCentered() {
CircularProgressIndicator(color = MaterialTheme.colorScheme.primary) CircularProgressIndicator(color = MaterialTheme.colorScheme.primary)
} }
} }
// UUID prefix length used as a friendlier-than-raw-UUID fallback when
// the admin users list fetch fails and we can't resolve userId → name.
private const val USER_ID_PREFIX_LEN = 8
@@ -27,6 +27,11 @@ import javax.inject.Singleton
* NetworkModule, we don't @Provides per-endpoint Retrofit interfaces * NetworkModule, we don't @Provides per-endpoint Retrofit interfaces
* — fewer Hilt bindings, locality of reference. * — fewer Hilt bindings, locality of reference.
*/ */
// LibraryRepository owns reads + refreshes for three entity families
// (artists / albums / tracks) plus shuffle. Function count scales with
// entity-family count; splitting into per-family repos would
// scatter the shared dao + retrofit plumbing for no real gain.
@Suppress("TooManyFunctions")
@Singleton @Singleton
class LibraryRepository @Inject constructor( class LibraryRepository @Inject constructor(
private val artistDao: CachedArtistDao, private val artistDao: CachedArtistDao,
+7 -1
View File
@@ -1,4 +1,10 @@
org.gradle.jvmargs=-Xmx4g -Dfile.encoding=UTF-8 # --enable-native-access=ALL-UNNAMED silences the JDK 22+ "restricted
# method in java.lang.System has been called" warning that Gradle 9.1's
# bundled native-platform-0.22-milestone-28.jar trips via System.load().
# Future JDKs will require this opt-in to allow native loads from
# unnamed modules; the jar itself doesn't yet declare native access in
# its manifest, so we opt in at the daemon level.
org.gradle.jvmargs=-Xmx4g -Dfile.encoding=UTF-8 --enable-native-access=ALL-UNNAMED
org.gradle.parallel=true org.gradle.parallel=true
org.gradle.caching=true org.gradle.caching=true
org.gradle.configuration-cache=true org.gradle.configuration-cache=true