SpigotMC/Spigot — pull request #173 by Dmck2b (2014-06-10 19:52:52+00:00)
Title: Make JSON errors more user friendly and less crash prone

This PR aims to fix two things. For one, it will prevent the server refusing to startup due to malformed or damaged json files. As well, it will also make the first startup (or startups after a json file is deleted) less spammy and not print stack traces.

For the first, the fix is to backup the file (for the more delicate data banned players/ips/ops files), then delete the original allowing it to recreate itself. This is logged with a warning and a notice towards where the backup is, however for the ucsercache.json the file is just deleted. (Attempting to log details about this caused me endless NPEs)

For the startup missing files, instead of printing the stacktrace for a file not found error as it currently does, it logs which file is missing and then creates a new one in it's place.