File tree Expand file tree Collapse file tree
src/main/java/eu/vertcode/vertconfig/object Expand file tree Collapse file tree Load Diff This file was deleted.
Original file line number Diff line number Diff line change 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 >
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 >
Original file line number Diff line number Diff line change 1919@ Setter
2020public 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 }
You can’t perform that action at this time.
0 commit comments