Commit 62faa2c 1 parent e21379d commit 62faa2c Copy full SHA for 62faa2c
File tree 4 files changed +12
-91
lines changed
src/main/kotlin/fr/sncf/osrd/utils
src/main/java/fr/sncf/osrd/reporting/exceptions
4 files changed +12
-91
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,6 @@ dependencies {
18
18
// PLEASE ADD AND UPDATE DEPENDENCIES USING libs.versions.toml
19
19
implementation project(' :kt-fast-collections' )
20
20
ksp project(' :kt-fast-collections-generator' )
21
- api project(' :osrd-reporting' )
22
21
23
22
// JSON parsing
24
23
implementation libs. moshi
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
plugins {
2
2
id ' java'
3
3
id ' jacoco'
4
+ alias(libs. plugins. kotlin. jvm)
4
5
}
5
6
6
7
repositories {
@@ -15,10 +16,14 @@ java {
15
16
16
17
dependencies {
17
18
// PLEASE ADD AND UPDATE DEPENDENCIES USING libs.versions.toml
19
+ api project(' :kt-osrd-utils' )
20
+
21
+ implementation libs. kotlin. stdlib
18
22
19
23
// moshi
20
24
implementation libs. moshi
21
25
implementation libs. moshi. adapters
26
+ implementation libs. moshi. kotlin
22
27
23
28
// class-graph
24
29
implementation libs. classgraph
Original file line number Diff line number Diff line change 1
1
package fr .sncf .osrd .reporting .exceptions ;
2
2
3
- import com .squareup .moshi .*;
4
3
import com .squareup .moshi .JsonAdapter ;
4
+ import com .squareup .moshi .Moshi ;
5
+ import com .squareup .moshi .kotlin .reflect .KotlinJsonAdapterFactory ;
5
6
import fr .sncf .osrd .reporting .ErrorContext ;
6
7
import fr .sncf .osrd .reporting .warnings .DiagnosticRecorder ;
7
8
import fr .sncf .osrd .reporting .warnings .Warning ;
9
+ import fr .sncf .osrd .utils .json .UnitAdapterFactory ;
8
10
import java .io .IOException ;
9
11
import java .io .ObjectInputStream ;
10
12
import java .io .Serial ;
@@ -456,7 +458,10 @@ public String getMessage() {
456
458
public static final JsonAdapter <OSRDError > adapter ;
457
459
458
460
static {
459
- Moshi moshi = new Moshi .Builder ().build ();
461
+ Moshi moshi = new Moshi .Builder ()
462
+ .addLast (new UnitAdapterFactory ())
463
+ .addLast (new KotlinJsonAdapterFactory ())
464
+ .build ();
460
465
adapter = moshi .adapter (OSRDError .class );
461
466
}
462
467
You can’t perform that action at this time.
0 commit comments