Skip to content

Commit

Permalink
3.32
Browse files Browse the repository at this point in the history
Made parsing/loading thread safe.
  • Loading branch information
tobiasmiosczka committed Dec 16, 2020
1 parent 1cafbd1 commit 1f3fbef
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<groupId>com.github.tobiasmiosczka</groupId>
<artifactId>nami-connector</artifactId>
<version>3.31</version>
<version>3.32</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
8 changes: 6 additions & 2 deletions src/main/java/nami/connector/json/JsonUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ public class JsonUtil {
return null;
}
try {
return LocalDateTime.from(DATE_TIME_FORMATTER.parse(string));
synchronized (DATE_TIME_FORMATTER) {
return LocalDateTime.from(DATE_TIME_FORMATTER.parse(string));
}
} catch (DateTimeParseException e) {
e.printStackTrace();
return null;
Expand All @@ -45,7 +47,9 @@ public class JsonUtil {
if(string == null || string.equals(""))
return null;
try {
return LocalDate.from(DATE_FORMATTER.parse(string));
synchronized (DATE_FORMATTER) {
return LocalDate.from(DATE_FORMATTER.parse(string));
}
} catch (DateTimeParseException e) {
e.printStackTrace();
return null;
Expand Down

0 comments on commit 1f3fbef

Please sign in to comment.