Skip to content

Commit 9920f42

Browse files
author
VertCode | Wesley
committed
Fixed UFT-8 Bug
1 parent 60888f7 commit 9920f42

3 files changed

Lines changed: 5 additions & 10 deletions

File tree

VertConfig.iml

Lines changed: 0 additions & 2 deletions
This file was deleted.

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>eu.vertcode</groupId>
88
<artifactId>vertconfig</artifactId>
9-
<version>1.0.0</version>
9+
<version>1.0.1</version>
1010
<packaging>jar</packaging>
1111
<description>The easy to use JSON config api.</description>
1212
<url>https://vertcode.eu</url>
@@ -93,7 +93,7 @@
9393
<dependency>
9494
<groupId>com.google.code.gson</groupId>
9595
<artifactId>gson</artifactId>
96-
<version>2.8.6</version>
96+
<version>2.8.7</version>
9797
<scope>compile</scope>
9898
</dependency>
9999
</dependencies>

src/main/java/eu/vertcode/vertconfig/object/VertConfig.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
@Setter
2020
public class VertConfig {
2121

22-
private static Gson gson = new GsonBuilder().setPrettyPrinting().create();
22+
private static Gson gson = new GsonBuilder().setPrettyPrinting().disableHtmlEscaping().create();
2323
private final String path;
2424
private final File file;
2525
private JsonObject jsonObject;
@@ -249,7 +249,7 @@ public void reload() throws IOException {
249249
*/
250250
public void save() throws IOException {
251251
Writer writer = new FileWriter(this.file);
252-
gson.toJson(gson.fromJson(this.jsonObject.toString(), JsonObject.class), writer);
252+
gson.toJson(this.jsonObject, writer);
253253
writer.flush();
254254
writer.close();
255255
}
@@ -276,10 +276,7 @@ private <T> T getEmbeddedValue(final List<?> keys) {
276276
JsonObject value = this.jsonObject;
277277
for (Object key : keys) {
278278
value = (JsonObject) value.get(String.valueOf(key));
279-
280-
if (value == null) {
281-
return null;
282-
}
279+
if (value == null) return null;
283280
}
284281
return ((Class<T>) Object.class).cast(value);
285282
}

0 commit comments

Comments
 (0)