Skip to content

Commit

Permalink
Fix false positive from BitDefender and others
Browse files Browse the repository at this point in the history
It seems that our AI overlords suddenly decided they don't like the
combination of iterating over an enum and saving JSON files. Even just
moving the saving part into a separate method seems to fix the problem.

Before: https://www.virustotal.com/gui/file/60456d19ba513e15599d5ccb22eaf1409b76af2fe4372c3f2c180c9e0bc49583

After: https://www.virustotal.com/gui/file/41e6c72b588d5befbcba4ddf7a2e8a9e88c3b68a6d720436e4fadc54f86c10dc
  • Loading branch information
Alexander01998 committed Nov 27, 2023
1 parent e7f60fe commit 97d1225
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions src/main/java/net/wurstclient/util/DefaultAutoBuildTemplates.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,19 +96,23 @@ public static void createFiles(Path folder)
{
for(DefaultAutoBuildTemplates template : DefaultAutoBuildTemplates
.values())
createFile(folder, template);
}

private static void createFile(Path folder,
DefaultAutoBuildTemplates template)
{
JsonObject json = toJson(template);
Path path = folder.resolve(template.name + ".json");

try
{
JsonObject json = toJson(template);
Path path = folder.resolve(template.name + ".json");
JsonUtils.toJson(json, path);

try
{
JsonUtils.toJson(json, path);

}catch(IOException | JsonException e)
{
System.out.println("Couldn't save " + path.getFileName());
e.printStackTrace();
}
}catch(IOException | JsonException e)
{
System.out.println("Couldn't save " + path.getFileName());
e.printStackTrace();
}
}

Expand Down

0 comments on commit 97d1225

Please sign in to comment.