Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Commit

Permalink
Issue #485: Remove List.toJSONArray extension method
Browse files Browse the repository at this point in the history
Closes #485: Remove List.toJSONArray extension method
  • Loading branch information
fercarcedo authored and pocmo committed Jul 24, 2018
1 parent 28ff23d commit c4005e7
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
package mozilla.components.service.fretboard

import mozilla.components.support.ktx.kotlin.putIfNotNull
import mozilla.components.support.ktx.kotlin.toJsonArray
import mozilla.components.support.ktx.kotlin.toList
import mozilla.components.support.ktx.kotlin.tryGetInt
import mozilla.components.support.ktx.kotlin.tryGetLong
Expand Down Expand Up @@ -81,7 +80,7 @@ class JSONExperimentParser {
matchObject.putIfNotNull(DEVICE_KEY, experiment.match?.device)
matchObject.putIfNotNull(LANG_KEY, experiment.match?.language)
matchObject.putIfNotNull(MANUFACTURER_KEY, experiment.match?.manufacturer)
matchObject.putIfNotNull(REGIONS_KEY, experiment.match?.regions?.toJsonArray())
matchObject.putIfNotNull(REGIONS_KEY, experiment.match?.regions?.let { JSONArray(it) })
matchObject.putIfNotNull(RELEASE_CHANNEL_KEY, experiment.match?.releaseChannel)
matchObject.putIfNotNull(VERSION_KEY, experiment.match?.version)
return matchObject
Expand Down Expand Up @@ -110,7 +109,7 @@ class JSONExperimentParser {
for (key in payload.getKeys()) {
val value = payload.get(key)
when (value) {
is List<*> -> jsonObject.put(key, value.toJsonArray())
is List<*> -> jsonObject.put(key, JSONArray(value))
else -> jsonObject.put(key, value)
}
}
Expand Down

This file was deleted.

This file was deleted.

0 comments on commit c4005e7

Please sign in to comment.