From 5a37643562a7b15d5b27a901ae498512a266e2bc Mon Sep 17 00:00:00 2001 From: Gabriele C Date: Sat, 27 Jun 2020 03:52:54 +0200 Subject: [PATCH] Codestyle cleanup (codeclimate) --- .../xephi/authme/command/executable/authme/PurgeCommand.java | 1 - src/main/java/fr/xephi/authme/data/auth/PlayerAuth.java | 5 +++++ src/main/java/fr/xephi/authme/security/crypts/Pbkdf2.java | 1 - .../java/fr/xephi/authme/security/crypts/Pbkdf2Django.java | 1 - src/main/java/fr/xephi/authme/security/crypts/PhpFusion.java | 1 - .../fr/xephi/authme/security/totp/TotpAuthenticator.java | 1 - .../fr/xephi/authme/service/HelpTranslationGenerator.java | 3 ++- .../java/fr/xephi/authme/util/lazytags/DependentTag.java | 2 +- 8 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/main/java/fr/xephi/authme/command/executable/authme/PurgeCommand.java b/src/main/java/fr/xephi/authme/command/executable/authme/PurgeCommand.java index edc86a1de..735a9fd8a 100644 --- a/src/main/java/fr/xephi/authme/command/executable/authme/PurgeCommand.java +++ b/src/main/java/fr/xephi/authme/command/executable/authme/PurgeCommand.java @@ -1,6 +1,5 @@ package fr.xephi.authme.command.executable.authme; -import com.google.common.primitives.Ints; import fr.xephi.authme.command.ExecutableCommand; import fr.xephi.authme.task.purge.PurgeService; import org.bukkit.ChatColor; diff --git a/src/main/java/fr/xephi/authme/data/auth/PlayerAuth.java b/src/main/java/fr/xephi/authme/data/auth/PlayerAuth.java index 916ff7347..661d2ba62 100644 --- a/src/main/java/fr/xephi/authme/data/auth/PlayerAuth.java +++ b/src/main/java/fr/xephi/authme/data/auth/PlayerAuth.java @@ -73,6 +73,11 @@ public class PlayerAuth { return groupId; } + /** + * Sets the player's auth quit location. + * + * @param location the quit location + */ public void setQuitLocation(Location location) { Objects.requireNonNull(location.getWorld(), "world not loaded!"); x = location.getBlockX(); diff --git a/src/main/java/fr/xephi/authme/security/crypts/Pbkdf2.java b/src/main/java/fr/xephi/authme/security/crypts/Pbkdf2.java index 7c007d044..d8cc5b6b2 100644 --- a/src/main/java/fr/xephi/authme/security/crypts/Pbkdf2.java +++ b/src/main/java/fr/xephi/authme/security/crypts/Pbkdf2.java @@ -1,6 +1,5 @@ package fr.xephi.authme.security.crypts; -import com.google.common.primitives.Ints; import de.rtner.misc.BinTools; import de.rtner.security.auth.spi.PBKDF2Engine; import de.rtner.security.auth.spi.PBKDF2Parameters; diff --git a/src/main/java/fr/xephi/authme/security/crypts/Pbkdf2Django.java b/src/main/java/fr/xephi/authme/security/crypts/Pbkdf2Django.java index 50e3ec8fc..87cc70da8 100644 --- a/src/main/java/fr/xephi/authme/security/crypts/Pbkdf2Django.java +++ b/src/main/java/fr/xephi/authme/security/crypts/Pbkdf2Django.java @@ -1,6 +1,5 @@ package fr.xephi.authme.security.crypts; -import com.google.common.primitives.Ints; import de.rtner.security.auth.spi.PBKDF2Engine; import de.rtner.security.auth.spi.PBKDF2Parameters; import fr.xephi.authme.ConsoleLogger; diff --git a/src/main/java/fr/xephi/authme/security/crypts/PhpFusion.java b/src/main/java/fr/xephi/authme/security/crypts/PhpFusion.java index 4859e49c3..25124421b 100644 --- a/src/main/java/fr/xephi/authme/security/crypts/PhpFusion.java +++ b/src/main/java/fr/xephi/authme/security/crypts/PhpFusion.java @@ -8,7 +8,6 @@ import fr.xephi.authme.util.RandomStringUtils; import javax.crypto.Mac; import javax.crypto.spec.SecretKeySpec; -import java.io.UnsupportedEncodingException; import java.nio.charset.StandardCharsets; import java.security.InvalidKeyException; import java.security.NoSuchAlgorithmException; diff --git a/src/main/java/fr/xephi/authme/security/totp/TotpAuthenticator.java b/src/main/java/fr/xephi/authme/security/totp/TotpAuthenticator.java index 434473171..4d96bb042 100644 --- a/src/main/java/fr/xephi/authme/security/totp/TotpAuthenticator.java +++ b/src/main/java/fr/xephi/authme/security/totp/TotpAuthenticator.java @@ -2,7 +2,6 @@ package fr.xephi.authme.security.totp; import com.google.common.collect.HashBasedTable; import com.google.common.collect.Table; -import com.google.common.primitives.Ints; import com.warrenstrange.googleauth.GoogleAuthenticator; import com.warrenstrange.googleauth.GoogleAuthenticatorKey; import com.warrenstrange.googleauth.GoogleAuthenticatorQRGenerator; diff --git a/src/main/java/fr/xephi/authme/service/HelpTranslationGenerator.java b/src/main/java/fr/xephi/authme/service/HelpTranslationGenerator.java index 893e7e411..4f1c8fb07 100644 --- a/src/main/java/fr/xephi/authme/service/HelpTranslationGenerator.java +++ b/src/main/java/fr/xephi/authme/service/HelpTranslationGenerator.java @@ -55,7 +55,8 @@ public class HelpTranslationGenerator { Map helpEntries = generateHelpMessageEntries(); String helpEntriesYaml = exportToYaml(helpEntries); - Files.write(helpFile.toPath(), helpEntriesYaml.getBytes(StandardCharsets.UTF_8), StandardOpenOption.TRUNCATE_EXISTING); + Files.write(helpFile.toPath(), helpEntriesYaml.getBytes(StandardCharsets.UTF_8), + StandardOpenOption.TRUNCATE_EXISTING); return helpFile; } diff --git a/src/main/java/fr/xephi/authme/util/lazytags/DependentTag.java b/src/main/java/fr/xephi/authme/util/lazytags/DependentTag.java index bad772989..f9fc8bce2 100644 --- a/src/main/java/fr/xephi/authme/util/lazytags/DependentTag.java +++ b/src/main/java/fr/xephi/authme/util/lazytags/DependentTag.java @@ -22,7 +22,7 @@ public class DependentTag implements Tag { * @param name the tag (placeholder) that will be replaced * @param replacementFunction the function producing the replacement */ - public DependentTag(@NotNull String name,@NotNull Function replacementFunction) { + public DependentTag(@NotNull String name, @NotNull Function replacementFunction) { this.name = name; this.replacementFunction = replacementFunction; }