Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
java-wowa-training
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
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
cylab
java-wowa-training
Commits
cce7d4e8
Commit
cce7d4e8
authored
5 years ago
by
a.croix
Browse files
Options
Downloads
Plain Diff
Merge branch 'test-sast'
parents
ad57a608
29e49389
No related branches found
No related tags found
No related merge requests found
Checking pipeline status
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/be/cylab/java/wowa/training/Utils.java
+5
-2
5 additions, 2 deletions
src/main/java/be/cylab/java/wowa/training/Utils.java
with
5 additions
and
2 deletions
src/main/java/be/cylab/java/wowa/training/Utils.java
+
5
−
2
View file @
cce7d4e8
...
@@ -8,6 +8,7 @@ import info.debatty.java.aggregation.WOWA;
...
@@ -8,6 +8,7 @@ import info.debatty.java.aggregation.WOWA;
import
org.apache.commons.lang3.ArrayUtils
;
import
org.apache.commons.lang3.ArrayUtils
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.nio.charset.StandardCharsets
;
import
java.nio.file.Files
;
import
java.nio.file.Files
;
import
java.nio.file.Paths
;
import
java.nio.file.Paths
;
import
java.text.DateFormat
;
import
java.text.DateFormat
;
...
@@ -131,7 +132,8 @@ public final class Utils {
...
@@ -131,7 +132,8 @@ public final class Utils {
throws
IOException
{
throws
IOException
{
Genson
genson
=
new
Genson
();
Genson
genson
=
new
Genson
();
String
data_json
=
new
String
(
Files
.
readAllBytes
(
Paths
.
get
(
filename
)));
String
data_json
=
new
String
(
Files
.
readAllBytes
(
Paths
.
get
(
filename
)),
StandardCharsets
.
UTF_8
);
List
<
double
[]>
data
=
genson
.
deserialize
(
List
<
double
[]>
data
=
genson
.
deserialize
(
data_json
,
data_json
,
new
GenericType
<
List
<
double
[]>>()
{
new
GenericType
<
List
<
double
[]>>()
{
...
@@ -151,7 +153,8 @@ public final class Utils {
...
@@ -151,7 +153,8 @@ public final class Utils {
Genson
genson
=
new
Genson
();
Genson
genson
=
new
Genson
();
String
expected_json
=
new
String
(
String
expected_json
=
new
String
(
Files
.
readAllBytes
(
Paths
.
get
(
filename
)));
Files
.
readAllBytes
(
Paths
.
get
(
filename
)),
StandardCharsets
.
UTF_8
);
double
[]
expected
=
genson
.
deserialize
(
expected_json
,
double
[].
class
);
double
[]
expected
=
genson
.
deserialize
(
expected_json
,
double
[].
class
);
return
expected
;
return
expected
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment