Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
theodolite
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sören Henning
theodolite
Merge requests
!292
Replace GSON with Jackson ObjectMapper
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Replace GSON with Jackson ObjectMapper
stu207811/theodolite_fork:Replace-GSON
into
main
Overview
1
Commits
10
Pipelines
1
Changes
8
Merged
Christopher Konkel
requested to merge
stu207811/theodolite_fork:Replace-GSON
into
main
2 years ago
Overview
1
Commits
10
Pipelines
1
Changes
8
Expand
As
#319 (closed)
suggests, replaced the use of GSON with Jackson ObjectMapper.
0
0
Merge request reports
Compare
main
version 2
7c026335
2 years ago
version 1
cbde93e9
2 years ago
main (base)
and
latest version
latest version
2334aa5a
10 commits,
1 year ago
version 2
7c026335
8 commits,
2 years ago
version 1
cbde93e9
8 commits,
2 years ago
8 files
+
26
−
29
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
8
Search (e.g. *.vue) (Ctrl+P)
theodolite/src/main/kotlin/rocks/theodolite/core/IOHandler.kt
+
4
−
3
Options
package
rocks.theodolite.core
import
com.
google.gson.GsonBuild
er
import
com.
fasterxml.jackson.databind.ObjectMapp
er
import
mu.KotlinLogging
import
java.io.File
import
java.io.PrintWriter
@@ -56,8 +56,9 @@ class IOHandler {
* @param fileURL the URL of the file
*/
fun
<
T
>
writeToJSONFile
(
objectToSave
:
T
,
fileURL
:
String
)
{
val
gson
=
GsonBuilder
().
enableComplexMapKeySerialization
().
setPrettyPrinting
().
create
()
writeStringToTextFile
(
fileURL
,
gson
.
toJson
(
objectToSave
))
val
outputFile
=
File
(
fileURL
)
ObjectMapper
().
writerWithDefaultPrettyPrinter
().
writeValue
(
outputFile
,
objectToSave
)
logger
.
info
{
"Wrote txt file: $fileURL to ${outputFile.absolutePath}."
}
}
/**
Loading