Skip to content
This repository has been archived by the owner on Dec 3, 2018. It is now read-only.

Releases: philip-ulrich/XenSync

1.0.3

12 Jan 03:40
Compare
Choose a tag to compare
1.0.3 Pre-release
Pre-release

A lot of code cleanup courtesy of @2008Choco.

Notes from PR:
pom.xml:

  • Removed Apache Commons IO and GSON from pom.xml dependencies. Spigot shades both of these libraries

XenSync:

  • Added private fields to properly encapsulate respective fields
  • Renamed a couple fields to give a better idea as to what they do
  • Added instance fields for "Gson", "Type" and "Random" which only need to be declared once
  • Reorganized the onEnable() to be in a more proper and acceptable order (i.e. setup data storage first, configuration loading second, etc.)
  • Un-nested a whole bunch of if statements that had no need to be nested. Easy readability
  • Removed unnecessary boolean comparisons in conditional statements (== true and == false)
  • Added Java 8 support using Stream API / Lambdas where required
  • Replaced "#setupConversionFile()" and "#setupExceptionFile()" methods with a single "initializeFile(String, Function)" file to allow for more flexibility in file creation / parsing
  • Removed instantiation of the com.mysql.jdbc.Driver class, as it only needs to be called upon to initialize its fields / methods, etc.
  • Replaced unnecessary if statements with ternary operands
  • Removed "warn()" and "info()" methods. They were creating runnables for every single method... which is extremely overkill. Logger#warning() and Logger#info() should suffice
  • Removed unnecessary if/else statement for "useUsername" in the "/register" command. Used ternary for the "site" variable based on the boolean instead. (Shaves off ~30 lines)
    Fixed common JsonSyntaxExceptions, and also threw a try/catch around it to make it more pretty to the client-user
  • Wrapped many Reader objects in BufferedReader objects, because InputStreamReaders can be resource intensive if not wrapped
  • Properly implemented the "xenforo-registration.enable" configuration option. This was not being used at all...