Command refactor - remove unused fields, reduce variable "scope"

Minor refactorings in the command section for familiarization.

1. Removed suppressWarning("Deprecated") - the method is deprecated for a reason and we should be made aware of that.
2. Removed same javadoc on ExecutableCommand implementation that just had the same as the interface (this is just clutter; @Override signals that it's an implementing class and a developer can view the superclass javadoc)
3. In places where the AuthMe instance was retrieved at the top but used at the very bottom, moved it to the bottom to reduce its "scope"
This commit is contained in:
ljacqu
2015-11-21 09:07:12 +01:00
parent 8387924c64
commit d81ef3168e
18 changed files with 36 additions and 213 deletions
@@ -11,26 +11,15 @@ import fr.xephi.authme.command.ExecutableCommand;
*/
public class LogoutCommand extends ExecutableCommand {
/**
* Execute the command.
*
* @param sender The command sender.
* @param commandReference The command reference.
* @param commandArguments The command arguments.
*
* @return True if the command was executed successfully, false otherwise. */
@Override
public boolean executeCommand(CommandSender sender, CommandParts commandReference, CommandParts commandArguments) {
// AuthMe plugin instance
final AuthMe plugin = AuthMe.getInstance();
// Make sure the current command executor is a player
if(!(sender instanceof Player)) {
if (!(sender instanceof Player)) {
return true;
}
// Get the player instance
final AuthMe plugin = AuthMe.getInstance();
final Player player = (Player) sender;
// Logout the player