ADFA-4634: Remove Jackson and kotlinx.serialization, consolidate on Gson#1505
Conversation
Gson was already the project-wide JSON library (24 files, 11 modules). Jackson had a single use in WebServer.kt; replaced with Gson equivalent. kotlinx.serialization was entirely unused (dead import + declared deps only). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… catalog Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 Walkthrough
WalkthroughThe build removes Kotlin serialization and Jackson JSON dependencies, adds Pebble, and updates ChangesTemplate context migration
Estimated code review effort: 2 (Simple) | ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
app/src/main/java/com/itsaky/androidide/localWebServer/WebServer.kt (1)
454-454: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick winReuse a single Gson instance and TypeToken instead of creating them per call.
Gson()and the anonymousTypeTokensubclass are instantiated on every template request. Gson instances are thread-safe and can be shared. A class-level field is consistent with the existingpebbleEnginepattern.♻️ Proposed refactor
Add class-level fields near the existing Pebble fields:
private val brotliCompression : String = "br" + private val gson = Gson() + private val contextType = object : TypeToken<Map<String, Any>>() {}.type private val pebbleEngine = PebbleEngine.Builder().loader(StringLoader()).build()Then simplify the call site:
- val context: Map<String, Any> = Gson().fromJson(dbContent.toString(Charsets.UTF_8), object : TypeToken<Map<String, Any>>() {}.type) + val context: Map<String, Any> = gson.fromJson(dbContent.toString(Charsets.UTF_8), contextType)🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@app/src/main/java/com/itsaky/androidide/localWebServer/WebServer.kt` at line 454, In the template request handling code, avoid recreating Gson and the Map TypeToken for every request. Add reusable class-level fields near pebbleEngine for a single Gson instance and a typed Map<String, Any> TypeToken, then update the deserialization call in the relevant method to use those shared fields.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@app/src/main/java/com/itsaky/androidide/localWebServer/WebServer.kt`:
- Line 454: In the template request handling code, avoid recreating Gson and the
Map TypeToken for every request. Add reusable class-level fields near
pebbleEngine for a single Gson instance and a typed Map<String, Any> TypeToken,
then update the deserialization call in the relevant method to use those shared
fields.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 07778500-1500-4123-a8c9-10a95cfb605d
📒 Files selected for processing (3)
app/build.gradle.ktsapp/src/main/java/com/itsaky/androidide/localWebServer/WebServer.ktgradle/libs.versions.toml
💤 Files with no reviewable changes (2)
- gradle/libs.versions.toml
- app/build.gradle.kts
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ontext - Register a TypeAdapterFactory that returns Long (not Double) for whole numbers when deserializing Map<String, Any>, matching Jackson's behavior - Throw explicitly before fromJson() for blank or "null" JSON strings so the caller gets a meaningful error instead of a null map Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…rialization Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Summary
ObjectMapper.readValue()call inWebServer.ktwith the Gson equivalent (Gson().fromJson())kotlinx.serializationcompiler plugin and runtime dependency — it was declared but had zero actual usages (one dead import)libs.versions.tomlTest plan
🤖 Generated with Claude Code