Skip to content

Replace json-simple with Jackson - #234

Merged
bgrozev merged 6 commits into
masterfrom
remove-json-simple
Jun 10, 2026
Merged

Replace json-simple with Jackson#234
bgrozev merged 6 commits into
masterfrom
remove-json-simple

Conversation

@bgrozev

@bgrozev bgrozev commented Jun 1, 2026

Copy link
Copy Markdown
Member

Replace the org.json.simple dependency with Jackson (jackson-databind).

  • Migrate MetricsContainer and HistogramMetric to use ObjectNode/ArrayNode
  • Migrate mediajson serialization; add NON_NULL property inclusion to match previous null-omission behavior
  • Update jitsi-utils to 1.0-SNAPSHOT

bgrozev added 2 commits June 1, 2026 07:11
Replace org.json.simple dependency with Jackson (jackson-databind).
Add NON_NULL property inclusion to objectMapper so null fields
are omitted from JSON output, matching the behavior expected by tests
(and previously implicit via json-simple's null semantics).
@codecov

codecov Bot commented Jun 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 34.08%. Comparing base (3f48c50) to head (d99d14b).

Files with missing lines Patch % Lines
...c/main/kotlin/org/jitsi/metrics/HistogramMetric.kt 33.33% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #234      +/-   ##
============================================
+ Coverage     33.89%   34.08%   +0.19%     
  Complexity      162      162              
============================================
  Files            36       36              
  Lines          1366     1370       +4     
  Branches        140      140              
============================================
+ Hits            463      467       +4     
  Misses          870      870              
  Partials         33       33              
Files with missing lines Coverage Δ
...n/src/main/kotlin/org/jitsi/mediajson/MediaJson.kt 98.18% <100.00%> (+0.03%) ⬆️
.../main/kotlin/org/jitsi/metrics/MetricsContainer.kt 77.27% <100.00%> (+0.80%) ⬆️
...c/main/kotlin/org/jitsi/metrics/HistogramMetric.kt 43.75% <33.33%> (ø)

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3f48c50...d99d14b. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

jitsi-ci Bot pushed a commit to jitsi/jitsi-pr-tests-pages that referenced this pull request Jun 1, 2026
jitsi-ci Bot pushed a commit to jitsi/jitsi-pr-tests-pages that referenced this pull request Jun 1, 2026
jitsi-ci Bot pushed a commit to jitsi/jitsi-pr-tests-pages that referenced this pull request Jun 1, 2026
jitsi-ci Bot pushed a commit to jitsi/jitsi-pr-tests-pages that referenced this pull request Jun 1, 2026
jicoco pinned jackson 2.17.1 while jitsi-utils and jicofo use 2.19.0. In a
coordinated multi-repo build, dependency mediation produced a skew
(jackson-databind 2.17.1 from jicoco + jackson-module-kotlin 2.19.0), which
makes the Kotlin module fail to construct data classes:
'Cannot construct instance ... (no Creators ...)'. Align to 2.19.0.
jitsi-ci Bot pushed a commit to jitsi/jitsi-pr-tests-pages that referenced this pull request Jun 1, 2026
jitsi-ci Bot pushed a commit to jitsi/jitsi-pr-tests-pages that referenced this pull request Jun 1, 2026
val parsed = Event.parse(
"""
{
{

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You removed the trailing spaces - was that on purpose? I would hope the tests still pass with the trailing spaces?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It wasn't on purpose, but shouldn't cause any problems -- this is parsing JSON. Tests pass locally, failures we see on GH are probably because of the jitsi-utils version (but the CI build should pick up the right version automatically)

Replace mapper.createObjectNode()/createArrayNode() with
JsonNodeFactory.instance.objectNode()/arrayNode() everywhere.
Remove now-unused ObjectMapper instances and imports.
jitsi-ci Bot pushed a commit to jitsi/jitsi-pr-tests-pages that referenced this pull request Jun 3, 2026
open val jsonString: String
get() = JSONObject(metrics.filter { it.value.supportsJson }.mapValues { it.value.get() }).toJSONString()
get() = jsonMapper.valueToTree<com.fasterxml.jackson.databind.node.ObjectNode>(
metrics.filter { it.value.supportsJson }.mapValues { it.value.get() }

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you import ObjectNode here?

jitsi-ci Bot pushed a commit to jitsi/jitsi-pr-tests-pages that referenced this pull request Jun 8, 2026
jitsi-ci Bot pushed a commit to jitsi/jitsi-pr-tests-pages that referenced this pull request Jun 10, 2026
@bgrozev
bgrozev merged commit b3b9e1f into master Jun 10, 2026
6 of 7 checks passed
@bgrozev
bgrozev deleted the remove-json-simple branch June 10, 2026 09:52
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.

3 participants