From e1a84448a2f5ac6c4bfed6fb938901eda8c375b6 Mon Sep 17 00:00:00 2001 From: Xephi59 Date: Thu, 31 Dec 2015 01:06:09 +0100 Subject: [PATCH] Fix the whole Javadoc syntax --- pom.xml | 1457 ++++++++--------- src/main/java/fr/xephi/authme/AuthMe.java | 56 +- .../java/fr/xephi/authme/DataManager.java | 23 +- src/main/java/fr/xephi/authme/api/NewAPI.java | 15 +- .../xephi/authme/cache/auth/PlayerAuth.java | 11 +- .../xephi/authme/command/CommandHandler.java | 14 +- .../xephi/authme/command/CommandService.java | 23 +- .../authme/command/FoundCommandResult.java | 3 +- .../xephi/authme/command/PlayerCommand.java | 6 +- .../authme/datasource/CacheDataSource.java | 15 +- .../xephi/authme/datasource/DataSource.java | 18 +- .../fr/xephi/authme/datasource/FlatFile.java | 14 +- .../fr/xephi/authme/datasource/SQLite.java | 71 +- .../authme/permission/DefaultPermission.java | 6 +- .../authme/permission/PermissionsManager.java | 30 +- .../xephi/authme/security/crypts/BCRYPT.java | 49 +- .../authme/security/crypts/WHIRLPOOL.java | 15 +- .../security/crypts/description/HasSalt.java | 8 +- .../crypts/description/Recommendation.java | 4 +- .../authme/security/pbkdf2/MacBasedPRF.java | 9 +- .../xephi/authme/security/pbkdf2/PBKDF2.java | 2 +- .../authme/security/pbkdf2/PBKDF2Engine.java | 36 +- .../security/pbkdf2/PBKDF2Parameters.java | 2 - .../xephi/authme/settings/OtherAccounts.java | 8 +- .../fr/xephi/authme/settings/Settings.java | 19 +- .../fr/xephi/authme/util/CollectionUtils.java | 9 + 26 files changed, 1002 insertions(+), 921 deletions(-) diff --git a/pom.xml b/pom.xml index 96801b31..20b13f1e 100644 --- a/pom.xml +++ b/pom.xml @@ -1,787 +1,776 @@ - - 4.0.0 + + 4.0.0 - fr.xephi - authme - 5.2-SNAPSHOT - jar + fr.xephi + authme + 5.2-SNAPSHOT + jar - AuthMeReloaded - Authentication plugin for CraftBukkit/Spigot! - 2013 - http://dev.bukkit.org/bukkit-plugins/authme-reloaded/ - + AuthMeReloaded + Authentication plugin for CraftBukkit/Spigot! + 2013 + http://dev.bukkit.org/bukkit-plugins/authme-reloaded/ + - - AuthMe-Team - https://github.com/AuthMe-Team - + + AuthMe-Team + https://github.com/AuthMe-Team + - - scm:git:https://github.com/Xephi/AuthMeReloaded.git - scm:git:git@github.com:Xephi/AuthMeReloaded.git - http://github.com/Xephi/AuthMeReloaded - + + scm:git:https://github.com/Xephi/AuthMeReloaded.git + scm:git:git@github.com:Xephi/AuthMeReloaded.git + http://github.com/Xephi/AuthMeReloaded + - - jenkins - http://ci.xephi.fr/job/AuthMeReloaded/ - + + jenkins + http://ci.xephi.fr/job/AuthMeReloaded/ + - - GitHub - https://github.com/Xephi/AuthMeReloaded/issues - + + GitHub + https://github.com/Xephi/AuthMeReloaded/issues + - - - The GNU General Public Licence version 3 (GPLv3) - http://www.gnu.org/licenses/gpl-3.0.html - - + + + The GNU General Public Licence version 3 (GPLv3) + http://www.gnu.org/licenses/gpl-3.0.html + + - - 3.3.3 - + + 3.3.3 + - - UTF-8 + + UTF-8 - - AuthMe - fr.xephi.authme.AuthMe - Xephi, sgdc3, DNx5, timvisee, games647, ljacqu - Unknown + + AuthMe + fr.xephi.authme.AuthMe + Xephi, sgdc3, DNx5, timvisee, games647, ljacqu + Unknown - - 1.7 + + 1.7 - - 1.8.8-R0.1-SNAPSHOT - + + 1.8.8-R0.1-SNAPSHOT + - - - jenkins - - - env.BUILD_NUMBER - - - - ${env.BUILD_NUMBER} - - - + + + jenkins + + + env.BUILD_NUMBER + + + + ${env.BUILD_NUMBER} + + + - - AuthMe-${project.version} - src/main/java - src/test/java + + AuthMe-${project.version} + src/main/java + src/test/java - - - . - true - src/main/resources/ - - plugin.yml - - - - . - true - src/main/resources/ - - email.html - - - - . - false - src/main/resources/ - - *.yml - - - plugin.yml - - - - ./messages/ - false - src/main/resources/messages/ - - *.yml - - - - - - src/test/resources - - + + + . + true + src/main/resources/ + + plugin.yml + + + + . + true + src/main/resources/ + + email.html + + + + . + false + src/main/resources/ + + *.yml + + + plugin.yml + + + + ./messages/ + false + src/main/resources/messages/ + + *.yml + + + + + + src/test/resources + + - - - - - org.eclipse.m2e - lifecycle-mapping - 1.0.0 - - - - - - org.codehaus.mojo - buildnumber-maven-plugin - [1.0,) - - create-timestamp - - - - - true - true - - - - - - - - - + + + + + org.eclipse.m2e + lifecycle-mapping + 1.0.0 + + + + + + org.codehaus.mojo + buildnumber-maven-plugin + [1.0,) + + create-timestamp + + + + + true + true + + + + + + + + + - - - org.apache.maven.plugins - maven-compiler-plugin - 3.3 - - 1.7 - ${javaVersion} - - + + + org.apache.maven.plugins + maven-compiler-plugin + 3.3 + + 1.7 + ${javaVersion} + + - - org.codehaus.mojo - buildnumber-maven-plugin - 1.4 - - dd-MM-yy_HH-mm - build.time - - - - generate-resources - - create-timestamp - - - - - - - - org.apache.maven.plugins - maven-shade-plugin - 2.4.2 - - false - false - - - org.mcstats - fr.xephi.authme - - - com.google.gson - fr.xephi.authme.libs.gson - - - com.zaxxer.hikari - fr.xephi.authme.libs.hikari - - - org.slf4j - fr.xephi.authme.libs.slf4j - - - com.maxmind.geoip - fr.xephi.authme.libs.geoip - - - net.ricecode.similarity - fr.xephi.authme.libs.similarity - - - - - - package - - shade - - - - - - - org.jacoco - jacoco-maven-plugin - 0.7.5.201505241946 - - - prepare-agent - - prepare-agent - - - - - - - org.eluder.coveralls - coveralls-maven-plugin - 4.1.0 - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.10.3 - - fr.xephi.* - fr.xephi.authme.api:fr.xephi.authme.events - - + + org.codehaus.mojo + buildnumber-maven-plugin + 1.4 + + dd-MM-yy_HH-mm + build.time + + - attach-javadocs + generate-resources - jar + create-timestamp - - - + - - - - spigot-repo - http://hub.spigotmc.org/nexus/content/groups/public - + + + org.apache.maven.plugins + maven-shade-plugin + 2.4.2 + + false + false + + + org.mcstats + fr.xephi.authme + + + com.google.gson + fr.xephi.authme.libs.gson + + + com.zaxxer.hikari + fr.xephi.authme.libs.hikari + + + org.slf4j + fr.xephi.authme.libs.slf4j + + + com.maxmind.geoip + fr.xephi.authme.libs.geoip + + + net.ricecode.similarity + fr.xephi.authme.libs.similarity + + + + + + package + + shade + + + + - - - ess-repo - http://ci.drtshock.net/plugin/repository/everything - + + org.jacoco + jacoco-maven-plugin + 0.7.5.201505241946 + + + prepare-agent + + prepare-agent + + + + - - - minelink-thirdparty - http://repo.minelink.net/content/repositories/public - + + org.eluder.coveralls + coveralls-maven-plugin + 4.1.0 + + - - - dmulloy2-repo - http://repo.dmulloy2.net/content/groups/public/ - + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.10.3 + + + - - - onarandombox - http://repo.onarandombox.com/content/groups/public - + + + + spigot-repo + http://hub.spigotmc.org/nexus/content/groups/public + - - - vault-repo - http://nexus.theyeticave.net/content/repositories/pub_releases - + + + ess-repo + http://ci.drtshock.net/plugin/repository/everything + - - - luricos-releases - http://repo.luricos.de/content/repositories/releases - + + + minelink-thirdparty + http://repo.minelink.net/content/repositories/public + - - - xephi-repo - http://ci.xephi.fr/plugin/repository/everything/ - + + + dmulloy2-repo + http://repo.dmulloy2.net/content/groups/public/ + - - - pex-repo - http://pex-repo.aoeu.xyz/ - - + + + onarandombox + http://repo.onarandombox.com/content/groups/public + - - - - com.zaxxer - HikariCP - 2.4.3 - compile - - - slf4j-api - org.slf4j - - - true - - - org.slf4j - slf4j-jdk14 - 1.7.13 - compile - true - + + + vault-repo + http://nexus.theyeticave.net/content/repositories/pub_releases + - - - org.apache.logging.log4j - log4j-core - - 2.0-beta9 - provided - true - + + + luricos-releases + http://repo.luricos.de/content/repositories/releases + - - - org.apache.commons - commons-email - 1.4 - compile - true - + + + xephi-repo + http://ci.xephi.fr/plugin/repository/everything/ + - - - com.google.code.gson - gson - 2.5 - compile - true - + + + pex-repo + http://pex-repo.aoeu.xyz/ + + - - - com.maxmind.geoip - geoip-api - 1.2.15 - compile - true - + + + + com.zaxxer + HikariCP + 2.4.3 + compile + + + slf4j-api + org.slf4j + + + true + + + org.slf4j + slf4j-jdk14 + 1.7.13 + compile + true + - - - org.mcstats.bukkit - metrics - R8-SNAPSHOT - compile - - - org.bukkit - bukkit - - - true - + + + org.apache.logging.log4j + log4j-core + + 2.0-beta9 + provided + true + - - - org.bukkit - bukkit - ${bukkitVersion} - provided - true - - - junit - junit - - - json-simple - com.googlecode.json-simple - - - gson - com.google.code.gson - - - persistence-api - javax.persistence - - - + + + org.apache.commons + commons-email + 1.4 + compile + true + - - - com.comphenix.protocol - ProtocolLib - 3.6.5-SNAPSHOT - provided - true - - - cglib-nodep - cglib - - - BukkitExecutors - com.comphenix.executors - - - + + + com.google.code.gson + gson + 2.5 + compile + true + - - - ru.tehkode - PermissionsEx - 1.23.1 - provided - - - org.bukkit - bukkit - - - net.gravitydevelopment.updater - updater - - - commons-dbcp - commons-dbcp - - - AccountsClient - com.mojang - - - + + + com.maxmind.geoip + geoip-api + 1.2.15 + compile + true + - - - org.anjocaido - groupmanagerx - 2.2-SNAPSHOT - provided - - - org.bukkit - bukkit - - - + + + org.mcstats.bukkit + metrics + R8-SNAPSHOT + compile + + + org.bukkit + bukkit + + + true + - - - de.bananaco - bPermissions - 2.12-DEV - provided - - - org.bukkit - bukkit - - - + + + org.bukkit + bukkit + ${bukkitVersion} + provided + true + + + junit + junit + + + json-simple + com.googlecode.json-simple + + + gson + com.google.code.gson + + + persistence-api + javax.persistence + + + - - - org.tyrannyofheaven.bukkit - zPermissions - 1.3-SNAPSHOT - provided - - - org.bukkit - bukkit - - - com.sk89q - worldguard - - - com.sk89q - worldedit - - - VaultAPI - net.milkbowl.vault - - - uuidprovider - net.kaikk.mc - - - ToHPluginUtils - org.tyrannyofheaven.bukkit - - - + + + com.comphenix.protocol + ProtocolLib + 3.6.5-SNAPSHOT + provided + true + + + cglib-nodep + cglib + + + BukkitExecutors + com.comphenix.executors + + + - - - net.milkbowl.vault - VaultAPI - 1.5 - provided - - - org.bukkit - bukkit - - - org.bukkit - craftbukkit - - - true - + + + ru.tehkode + PermissionsEx + 1.23.1 + provided + + + org.bukkit + bukkit + + + net.gravitydevelopment.updater + updater + + + commons-dbcp + commons-dbcp + + + AccountsClient + com.mojang + + + - - - com.onarandombox.multiversecore - Multiverse-Core - 2.5 - jar - provided - - - org.bukkit - bukkit - - - org.bukkit - craftbukkit - - - AllPay - com.fernferret.allpay - - - Vault - net.milkbowl.vault - - - VaultAPI - net.milkbowl.vault - - - CommandHandler - com.pneumaticraft.commandhandler - - - SerializationConfig - me.main__.util - - - Logging - com.dumptruckman.minecraft - - - metrics - org.mcstats.bukkit - - - buscript - com.dumptruckman.minecraft - - - junit - junit - - - true - + + + org.anjocaido + groupmanagerx + 2.2-SNAPSHOT + provided + + + org.bukkit + bukkit + + + - - - net.ess3 - EssentialsX - 2.0.1-SNAPSHOT - provided - - - org.spigotmc - spigot-api - - - true - + + + de.bananaco + bPermissions + 2.12-DEV + provided + + + org.bukkit + bukkit + + + - - - net.minelink - CombatTagPlus - 1.2.1-SNAPSHOT - provided - - - org.bukkit - bukkit - - - org.bukkit - craftbukkit - - - CombatTagPlusHook - net.minelink - - - CombatTagPlusFactions-v1_6 - net.minelink - - - CombatTagPlusCompat-v1_7_R3 - net.minelink - - - CombatTagPlusFactions-v1_8 - net.minelink - - - CombatTagPlusCompat-v1_7_R4 - net.minelink - - - CombatTagPlusWG-v5 - net.minelink - - - CombatTagPlusWG-v6 - net.minelink - - - CombatTagPlusCompat-API - net.minelink - - - CombatTagPlusFactions-v2_6 - net.minelink - - - CombatTagPlusCompat-v1_8_R3 - net.minelink - - - CombatTagPlusFactions-v2_7 - net.minelink - - - CombatTagPlusCompat-v1_8_R2 - net.minelink - - - CombatTagPlusCompat-v1_8_R1 - net.minelink - - - metrics-lite - org.mcstats.bukkit - - - true - + + + org.tyrannyofheaven.bukkit + zPermissions + 1.3-SNAPSHOT + provided + + + org.bukkit + bukkit + + + com.sk89q + worldguard + + + com.sk89q + worldedit + + + VaultAPI + net.milkbowl.vault + + + uuidprovider + net.kaikk.mc + + + ToHPluginUtils + org.tyrannyofheaven.bukkit + + + - - - de.luricos.bukkit - xAuth - 2.6 - provided - - - org.bukkit - bukkit - - - org.bukkit - craftbukkit - - - updater - net.gravitydevelopment.updater - - - lombok - org.projectlombok - - - EssentialsGroupManager - net.ess3 - - - PermissionsEx - ru.tehkode - - - AccountsClient - com.mojang - - - log4j-core - org.apache.logging.log4j - - - true - + + + net.milkbowl.vault + VaultAPI + 1.5 + provided + + + org.bukkit + bukkit + + + org.bukkit + craftbukkit + + + true + - - - junit - junit - test - 4.12 - true - - - org.hamcrest - java-hamcrest - test - 2.0.0.0 - true - - - org.mockito - mockito-core - test - 2.0.5-beta - true - - - hamcrest-core - org.hamcrest - - - + + + com.onarandombox.multiversecore + Multiverse-Core + 2.5 + jar + provided + + + org.bukkit + bukkit + + + org.bukkit + craftbukkit + + + AllPay + com.fernferret.allpay + + + Vault + net.milkbowl.vault + + + VaultAPI + net.milkbowl.vault + + + CommandHandler + com.pneumaticraft.commandhandler + + + SerializationConfig + me.main__.util + + + Logging + com.dumptruckman.minecraft + + + metrics + org.mcstats.bukkit + + + buscript + com.dumptruckman.minecraft + + + junit + junit + + + true + - - - net.ricecode - string-similarity - 1.0.0 - compile - true - - + + + net.ess3 + EssentialsX + 2.0.1-SNAPSHOT + provided + + + org.spigotmc + spigot-api + + + true + + + + + net.minelink + CombatTagPlus + 1.2.1-SNAPSHOT + provided + + + org.bukkit + bukkit + + + org.bukkit + craftbukkit + + + CombatTagPlusHook + net.minelink + + + CombatTagPlusFactions-v1_6 + net.minelink + + + CombatTagPlusCompat-v1_7_R3 + net.minelink + + + CombatTagPlusFactions-v1_8 + net.minelink + + + CombatTagPlusCompat-v1_7_R4 + net.minelink + + + CombatTagPlusWG-v5 + net.minelink + + + CombatTagPlusWG-v6 + net.minelink + + + CombatTagPlusCompat-API + net.minelink + + + CombatTagPlusFactions-v2_6 + net.minelink + + + CombatTagPlusCompat-v1_8_R3 + net.minelink + + + CombatTagPlusFactions-v2_7 + net.minelink + + + CombatTagPlusCompat-v1_8_R2 + net.minelink + + + CombatTagPlusCompat-v1_8_R1 + net.minelink + + + metrics-lite + org.mcstats.bukkit + + + true + + + + + de.luricos.bukkit + xAuth + 2.6 + provided + + + org.bukkit + bukkit + + + org.bukkit + craftbukkit + + + updater + net.gravitydevelopment.updater + + + lombok + org.projectlombok + + + EssentialsGroupManager + net.ess3 + + + PermissionsEx + ru.tehkode + + + AccountsClient + com.mojang + + + log4j-core + org.apache.logging.log4j + + + true + + + + + junit + junit + test + 4.12 + true + + + org.hamcrest + java-hamcrest + test + 2.0.0.0 + true + + + org.mockito + mockito-core + test + 2.0.5-beta + true + + + hamcrest-core + org.hamcrest + + + + + + + net.ricecode + string-similarity + 1.0.0 + compile + true + + diff --git a/src/main/java/fr/xephi/authme/AuthMe.java b/src/main/java/fr/xephi/authme/AuthMe.java index 41ba8ff4..3e602e5f 100644 --- a/src/main/java/fr/xephi/authme/AuthMe.java +++ b/src/main/java/fr/xephi/authme/AuthMe.java @@ -1,7 +1,35 @@ package fr.xephi.authme; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.net.URL; +import java.net.URLConnection; +import java.util.Calendar; +import java.util.Collection; +import java.util.Date; +import java.util.List; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import java.util.logging.Logger; + +import org.apache.logging.log4j.LogManager; +import org.bukkit.Bukkit; +import org.bukkit.Location; +import org.bukkit.Server; +import org.bukkit.World; +import org.bukkit.command.Command; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; +import org.bukkit.plugin.PluginManager; +import org.bukkit.plugin.java.JavaPlugin; +import org.bukkit.scheduler.BukkitTask; +import org.mcstats.Metrics; +import org.mcstats.Metrics.Graph; + import com.earth2me.essentials.Essentials; import com.onarandombox.MultiverseCore.MultiverseCore; + import fr.xephi.authme.api.API; import fr.xephi.authme.api.NewAPI; import fr.xephi.authme.cache.auth.PlayerAuth; @@ -52,32 +80,6 @@ import fr.xephi.authme.util.StringUtils; import fr.xephi.authme.util.Utils; import fr.xephi.authme.util.Wrapper; import net.minelink.ctplus.CombatTagPlus; -import org.apache.logging.log4j.LogManager; -import org.bukkit.Bukkit; -import org.bukkit.Location; -import org.bukkit.Server; -import org.bukkit.World; -import org.bukkit.command.Command; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; -import org.bukkit.plugin.PluginManager; -import org.bukkit.plugin.java.JavaPlugin; -import org.bukkit.scheduler.BukkitTask; -import org.mcstats.Metrics; -import org.mcstats.Metrics.Graph; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.net.URL; -import java.net.URLConnection; -import java.util.Calendar; -import java.util.Collection; -import java.util.Date; -import java.util.List; -import java.util.Set; -import java.util.concurrent.ConcurrentHashMap; -import java.util.logging.Logger; /** * The AuthMe main class. @@ -983,6 +985,8 @@ public class AuthMe extends JavaPlugin { /** * Return the management instance. + * + * @return management The Management */ public Management getManagement() { return management; diff --git a/src/main/java/fr/xephi/authme/DataManager.java b/src/main/java/fr/xephi/authme/DataManager.java index 451667ad..e0afe6bf 100644 --- a/src/main/java/fr/xephi/authme/DataManager.java +++ b/src/main/java/fr/xephi/authme/DataManager.java @@ -1,12 +1,5 @@ package fr.xephi.authme; -import fr.xephi.authme.permission.PermissionsManager; -import fr.xephi.authme.settings.Settings; -import fr.xephi.authme.util.Utils; -import org.bukkit.Bukkit; -import org.bukkit.OfflinePlayer; -import org.bukkit.entity.Player; - import java.io.File; import java.util.List; import java.util.concurrent.Callable; @@ -14,6 +7,14 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; +import org.bukkit.Bukkit; +import org.bukkit.OfflinePlayer; +import org.bukkit.entity.Player; + +import fr.xephi.authme.permission.PermissionsManager; +import fr.xephi.authme.settings.Settings; +import fr.xephi.authme.util.Utils; + /** */ public class DataManager { @@ -65,7 +66,7 @@ public class DataManager { /** * Method purgeAntiXray. * - * @param cleared List + * @param cleared List of String */ public synchronized void purgeAntiXray(List cleared) { int i = 0; @@ -90,7 +91,7 @@ public class DataManager { /** * Method purgeLimitedCreative. * - * @param cleared List + * @param cleared List of String */ public synchronized void purgeLimitedCreative(List cleared) { int i = 0; @@ -127,7 +128,7 @@ public class DataManager { /** * Method purgeDat. * - * @param cleared List + * @param cleared List of String */ public synchronized void purgeDat(List cleared) { int i = 0; @@ -160,7 +161,7 @@ public class DataManager { /** * Method purgeEssentials. * - * @param cleared List + * @param cleared List of String */ @SuppressWarnings("deprecation") public void purgeEssentials(List cleared) { diff --git a/src/main/java/fr/xephi/authme/api/NewAPI.java b/src/main/java/fr/xephi/authme/api/NewAPI.java index 6f42432e..03fed1a8 100644 --- a/src/main/java/fr/xephi/authme/api/NewAPI.java +++ b/src/main/java/fr/xephi/authme/api/NewAPI.java @@ -1,15 +1,16 @@ package fr.xephi.authme.api; +import org.bukkit.Bukkit; +import org.bukkit.Location; +import org.bukkit.Server; +import org.bukkit.entity.Player; +import org.bukkit.plugin.Plugin; + import fr.xephi.authme.AuthMe; import fr.xephi.authme.cache.auth.PlayerAuth; import fr.xephi.authme.cache.auth.PlayerCache; import fr.xephi.authme.security.crypts.HashedPassword; import fr.xephi.authme.util.Utils; -import org.bukkit.Bukkit; -import org.bukkit.Location; -import org.bukkit.Server; -import org.bukkit.entity.Player; -import org.bukkit.plugin.Plugin; /** * The current API of AuthMe. @@ -76,7 +77,7 @@ public class NewAPI { } /** - * @param player + * @param player a Player * * @return true if player is a npc */ @@ -85,7 +86,7 @@ public class NewAPI { } /** - * @param player + * @param player a Player * * @return true if the player is unrestricted */ diff --git a/src/main/java/fr/xephi/authme/cache/auth/PlayerAuth.java b/src/main/java/fr/xephi/authme/cache/auth/PlayerAuth.java index b8c7552a..41672c0c 100644 --- a/src/main/java/fr/xephi/authme/cache/auth/PlayerAuth.java +++ b/src/main/java/fr/xephi/authme/cache/auth/PlayerAuth.java @@ -1,11 +1,12 @@ package fr.xephi.authme.cache.auth; -import fr.xephi.authme.security.crypts.HashedPassword; -import org.bukkit.Location; - import static com.google.common.base.Objects.firstNonNull; import static com.google.common.base.Preconditions.checkNotNull; +import org.bukkit.Location; + +import fr.xephi.authme.security.crypts.HashedPassword; + /** */ @@ -24,7 +25,7 @@ public class PlayerAuth { private String realName; /** - * + * @param serialized String */ public PlayerAuth(String serialized) { this.deserialize(serialized); @@ -340,6 +341,8 @@ public class PlayerAuth { /** * Method to deserialize PlayerAuth + * + * @param str String */ public void deserialize(String str) { String[] args = str.split(";"); diff --git a/src/main/java/fr/xephi/authme/command/CommandHandler.java b/src/main/java/fr/xephi/authme/command/CommandHandler.java index 8a3480ee..3d6d3d24 100644 --- a/src/main/java/fr/xephi/authme/command/CommandHandler.java +++ b/src/main/java/fr/xephi/authme/command/CommandHandler.java @@ -1,11 +1,12 @@ package fr.xephi.authme.command; -import fr.xephi.authme.util.StringUtils; -import org.bukkit.command.CommandSender; - import java.util.ArrayList; import java.util.List; +import org.bukkit.command.CommandSender; + +import fr.xephi.authme.util.StringUtils; + /** * The AuthMe command handler, responsible for mapping incoming commands to the correct {@link CommandDescription} * or to display help messages for unknown invocations. @@ -16,6 +17,8 @@ public class CommandHandler { /** * Create a command handler. + * + * @param commandService The CommandService instance */ public CommandHandler(CommandService commandService) { this.commandService = commandService; @@ -45,6 +48,11 @@ public class CommandHandler { return !FoundResultStatus.MISSING_BASE_COMMAND.equals(result.getResultStatus()); } + /** + * + * @param sender + * @param result + */ private void executeCommand(CommandSender sender, FoundCommandResult result) { ExecutableCommand executableCommand = result.getCommandDescription().getExecutableCommand(); List arguments = result.getArguments(); diff --git a/src/main/java/fr/xephi/authme/command/CommandService.java b/src/main/java/fr/xephi/authme/command/CommandService.java index b53fc2e8..f8b7f852 100644 --- a/src/main/java/fr/xephi/authme/command/CommandService.java +++ b/src/main/java/fr/xephi/authme/command/CommandService.java @@ -1,5 +1,9 @@ package fr.xephi.authme.command; +import java.util.List; + +import org.bukkit.command.CommandSender; + import fr.xephi.authme.AuthMe; import fr.xephi.authme.command.help.HelpProvider; import fr.xephi.authme.datasource.DataSource; @@ -8,9 +12,6 @@ import fr.xephi.authme.output.Messages; import fr.xephi.authme.permission.PermissionsManager; import fr.xephi.authme.process.Management; import fr.xephi.authme.security.PasswordSecurity; -import org.bukkit.command.CommandSender; - -import java.util.List; /** * Service for implementations of {@link ExecutableCommand} to execute some common tasks. @@ -31,6 +32,7 @@ public class CommandService { * @param commandMapper Command mapper * @param helpProvider Help provider * @param messages Messages instance + * @param passwordSecurity The Password Security instance */ public CommandService(AuthMe authMe, CommandMapper commandMapper, HelpProvider helpProvider, Messages messages, PasswordSecurity passwordSecurity) { @@ -51,6 +53,12 @@ public class CommandService { messages.send(sender, messageKey); } + /** + * + * @param sender CommandSender + * @param messageKey MessageKey + * @param replacements String... + */ public void send(CommandSender sender, MessageKey messageKey, String... replacements) { messages.send(sender, messageKey, replacements); } @@ -127,11 +135,20 @@ public class CommandService { return authMe.getManagement(); } + /** + * + * @return PermissionManager the PermissionManager + */ public PermissionsManager getPermissionsManager() { // TODO ljacqu 20151226: Might be nicer to pass the perm manager via constructor return authMe.getPermissionsManager(); } + /** + * + * @param key MessageKey + * @return StringArray Array of String + */ public String[] retrieveMessage(MessageKey key) { return messages.retrieve(key); } diff --git a/src/main/java/fr/xephi/authme/command/FoundCommandResult.java b/src/main/java/fr/xephi/authme/command/FoundCommandResult.java index 53de7f4d..7f19a4f0 100644 --- a/src/main/java/fr/xephi/authme/command/FoundCommandResult.java +++ b/src/main/java/fr/xephi/authme/command/FoundCommandResult.java @@ -3,9 +3,10 @@ package fr.xephi.authme.command; import java.util.List; /** + *

* Result of a command mapping by {@link CommandHandler}. An object of this class represents a successful mapping * as well as erroneous ones, as communicated with {@link FoundResultStatus}. - *

+ *

* Fields other than {@link FoundResultStatus} are available depending, among other factors, on the status: *
    *
  • {@link FoundResultStatus#SUCCESS} entails that mapping the input to a command was successful. Therefore, diff --git a/src/main/java/fr/xephi/authme/command/PlayerCommand.java b/src/main/java/fr/xephi/authme/command/PlayerCommand.java index a607803b..5792dd97 100644 --- a/src/main/java/fr/xephi/authme/command/PlayerCommand.java +++ b/src/main/java/fr/xephi/authme/command/PlayerCommand.java @@ -1,10 +1,10 @@ package fr.xephi.authme.command; +import java.util.List; + import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import java.util.List; - /** * Common base type for player-only commands, handling the verification that the command sender is indeed a player. */ @@ -35,7 +35,7 @@ public abstract class PlayerCommand implements ExecutableCommand { /** * Return an alternative command (textual representation) that is not restricted to players only. - * Example: "authme register <playerName> <password>" + * Example: "authme register <playerName> <password>" * * @return Alternative command not only for players, or null if not applicable */ diff --git a/src/main/java/fr/xephi/authme/datasource/CacheDataSource.java b/src/main/java/fr/xephi/authme/datasource/CacheDataSource.java index 2351c6cb..b80bac11 100644 --- a/src/main/java/fr/xephi/authme/datasource/CacheDataSource.java +++ b/src/main/java/fr/xephi/authme/datasource/CacheDataSource.java @@ -1,5 +1,11 @@ package fr.xephi.authme.datasource; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; + import com.google.common.base.Optional; import com.google.common.cache.CacheBuilder; import com.google.common.cache.CacheLoader; @@ -7,15 +13,10 @@ import com.google.common.cache.LoadingCache; import com.google.common.cache.RemovalListener; import com.google.common.cache.RemovalListeners; import com.google.common.cache.RemovalNotification; + import fr.xephi.authme.cache.auth.PlayerAuth; import fr.xephi.authme.cache.auth.PlayerCache; -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.TimeUnit; - /** */ public class CacheDataSource implements DataSource { @@ -315,7 +316,7 @@ public class CacheDataSource implements DataSource { /** * Method purgeBanned. * - * @param banned List + * @param banned List of String * * @see fr.xephi.authme.datasource.DataSource#purgeBanned(List) */ diff --git a/src/main/java/fr/xephi/authme/datasource/DataSource.java b/src/main/java/fr/xephi/authme/datasource/DataSource.java index 10f74b92..bee64eb5 100644 --- a/src/main/java/fr/xephi/authme/datasource/DataSource.java +++ b/src/main/java/fr/xephi/authme/datasource/DataSource.java @@ -1,9 +1,9 @@ package fr.xephi.authme.datasource; -import fr.xephi.authme.cache.auth.PlayerAuth; - import java.util.List; +import fr.xephi.authme.cache.auth.PlayerAuth; + /** */ public interface DataSource { @@ -67,7 +67,7 @@ public interface DataSource { * * @param until long * - * @return List + * @return List of String */ List autoPurgeDatabase(long until); @@ -103,7 +103,7 @@ public interface DataSource { * * @param auth PlayerAuth * - * @return List + * @return List of String */ List getAllAuthsByName(PlayerAuth auth); @@ -112,7 +112,7 @@ public interface DataSource { * * @param ip String * - * @return List * @throws Exception + * @return List of String * @throws Exception */ List getAllAuthsByIp(String ip); @@ -121,7 +121,7 @@ public interface DataSource { * * @param email String * - * @return List * @throws Exception + * @return List of String * @throws Exception */ List getAllAuthsByEmail(String email); @@ -141,7 +141,7 @@ public interface DataSource { /** * Method purgeBanned. * - * @param banned List + * @param banned List of String */ void purgeBanned(List banned); @@ -195,14 +195,14 @@ public interface DataSource { /** * Method getAllAuths. * - * @return List + * @return List of PlayerAuth */ List getAllAuths(); /** * Method getLoggedPlayers. * - * @return List + * @return List of PlayerAuth */ List getLoggedPlayers(); diff --git a/src/main/java/fr/xephi/authme/datasource/FlatFile.java b/src/main/java/fr/xephi/authme/datasource/FlatFile.java index 55646ddc..3ba57424 100644 --- a/src/main/java/fr/xephi/authme/datasource/FlatFile.java +++ b/src/main/java/fr/xephi/authme/datasource/FlatFile.java @@ -390,7 +390,7 @@ public class FlatFile implements DataSource { * * @param until long * - * @return List * @see fr.xephi.authme.datasource.DataSource#autoPurgeDatabase(long) + * @return List of String * @see fr.xephi.authme.datasource.DataSource#autoPurgeDatabase(long) */ @Override public List autoPurgeDatabase(long until) { @@ -606,7 +606,7 @@ public class FlatFile implements DataSource { * * @param auth PlayerAuth * - * @return List * @see fr.xephi.authme.datasource.DataSource#getAllAuthsByName(PlayerAuth) + * @return List of String * @see fr.xephi.authme.datasource.DataSource#getAllAuthsByName(PlayerAuth) */ @Override public List getAllAuthsByName(PlayerAuth auth) { @@ -643,7 +643,7 @@ public class FlatFile implements DataSource { * * @param ip String * - * @return List * @see fr.xephi.authme.datasource.DataSource#getAllAuthsByIp(String) + * @return List of String * @see fr.xephi.authme.datasource.DataSource#getAllAuthsByIp(String) */ @Override public List getAllAuthsByIp(String ip) { @@ -680,7 +680,7 @@ public class FlatFile implements DataSource { * * @param email String * - * @return List * @see fr.xephi.authme.datasource.DataSource#getAllAuthsByEmail(String) + * @return List of String * @see fr.xephi.authme.datasource.DataSource#getAllAuthsByEmail(String) */ @Override public List getAllAuthsByEmail(String email) { @@ -715,7 +715,7 @@ public class FlatFile implements DataSource { /** * Method purgeBanned. * - * @param banned List + * @param banned List of String * * @see fr.xephi.authme.datasource.DataSource#purgeBanned(List) */ @@ -860,7 +860,7 @@ public class FlatFile implements DataSource { /** * Method getAllAuths. * - * @return List * @see fr.xephi.authme.datasource.DataSource#getAllAuths() + * @return List of PlayerAuth * @see fr.xephi.authme.datasource.DataSource#getAllAuths() */ @Override public List getAllAuths() { @@ -912,7 +912,7 @@ public class FlatFile implements DataSource { /** * Method getLoggedPlayers. * - * @return List * @see fr.xephi.authme.datasource.DataSource#getLoggedPlayers() + * @return List of PlayerAuth * @see fr.xephi.authme.datasource.DataSource#getLoggedPlayers() */ @Override public List getLoggedPlayers() { diff --git a/src/main/java/fr/xephi/authme/datasource/SQLite.java b/src/main/java/fr/xephi/authme/datasource/SQLite.java index 474c5035..e068daf8 100644 --- a/src/main/java/fr/xephi/authme/datasource/SQLite.java +++ b/src/main/java/fr/xephi/authme/datasource/SQLite.java @@ -1,15 +1,20 @@ package fr.xephi.authme.datasource; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import java.util.ArrayList; +import java.util.List; + import fr.xephi.authme.ConsoleLogger; import fr.xephi.authme.cache.auth.PlayerAuth; import fr.xephi.authme.security.crypts.HashedPassword; import fr.xephi.authme.settings.Settings; import fr.xephi.authme.util.StringUtils; -import java.sql.*; -import java.util.ArrayList; -import java.util.List; - /** */ public class SQLite implements DataSource { @@ -35,7 +40,8 @@ public class SQLite implements DataSource { /** * Constructor for SQLite. * - * @throws ClassNotFoundException * @throws SQLException + * @throws ClassNotFoundException Exception + * @throws SQLException Exception */ public SQLite() throws ClassNotFoundException, SQLException { this.database = Settings.getMySQLDatabase; @@ -67,7 +73,8 @@ public class SQLite implements DataSource { /** * Method connect. * - * @throws ClassNotFoundException * @throws SQLException + * @throws ClassNotFoundException + * @throws SQLException */ private synchronized void connect() throws ClassNotFoundException, SQLException { Class.forName("org.sqlite.JDBC"); @@ -147,7 +154,8 @@ public class SQLite implements DataSource { * * @param user String * - * @return boolean * @see fr.xephi.authme.datasource.DataSource#isAuthAvailable(String) + * @return boolean + * @see fr.xephi.authme.datasource.DataSource#isAuthAvailable(String) */ @Override public synchronized boolean isAuthAvailable(String user) { @@ -172,7 +180,8 @@ public class SQLite implements DataSource { * * @param user String * - * @return PlayerAuth * @see fr.xephi.authme.datasource.DataSource#getAuth(String) + * @return PlayerAuth + * @see fr.xephi.authme.datasource.DataSource#getAuth(String) */ @Override public synchronized PlayerAuth getAuth(String user) { @@ -201,7 +210,8 @@ public class SQLite implements DataSource { * * @param auth PlayerAuth * - * @return boolean * @see fr.xephi.authme.datasource.DataSource#saveAuth(PlayerAuth) + * @return boolean + * @see fr.xephi.authme.datasource.DataSource#saveAuth(PlayerAuth) */ @Override public synchronized boolean saveAuth(PlayerAuth auth) { @@ -247,7 +257,8 @@ public class SQLite implements DataSource { * * @param auth PlayerAuth * - * @return boolean * @see fr.xephi.authme.datasource.DataSource#updatePassword(PlayerAuth) + * @return boolean + * @see fr.xephi.authme.datasource.DataSource#updatePassword(PlayerAuth) */ @Override public synchronized boolean updatePassword(PlayerAuth auth) { @@ -281,7 +292,8 @@ public class SQLite implements DataSource { * * @param auth PlayerAuth * - * @return boolean * @see fr.xephi.authme.datasource.DataSource#updateSession(PlayerAuth) + * @return boolean + * @see fr.xephi.authme.datasource.DataSource#updateSession(PlayerAuth) */ @Override public boolean updateSession(PlayerAuth auth) { @@ -307,7 +319,8 @@ public class SQLite implements DataSource { * * @param until long * - * @return int * @see fr.xephi.authme.datasource.DataSource#purgeDatabase(long) + * @return int + * @see fr.xephi.authme.datasource.DataSource#purgeDatabase(long) */ @Override public int purgeDatabase(long until) { @@ -330,7 +343,8 @@ public class SQLite implements DataSource { * * @param until long * - * @return List * @see fr.xephi.authme.datasource.DataSource#autoPurgeDatabase(long) + * @return List of String + * @see fr.xephi.authme.datasource.DataSource#autoPurgeDatabase(long) */ @Override public List autoPurgeDatabase(long until) { @@ -359,7 +373,8 @@ public class SQLite implements DataSource { * * @param user String * - * @return boolean * @see fr.xephi.authme.datasource.DataSource#removeAuth(String) + * @return boolean + * @see fr.xephi.authme.datasource.DataSource#removeAuth(String) */ @Override public synchronized boolean removeAuth(String user) { @@ -382,7 +397,8 @@ public class SQLite implements DataSource { * * @param auth PlayerAuth * - * @return boolean * @see fr.xephi.authme.datasource.DataSource#updateQuitLoc(PlayerAuth) + * @return boolean + * @see fr.xephi.authme.datasource.DataSource#updateQuitLoc(PlayerAuth) */ @Override public boolean updateQuitLoc(PlayerAuth auth) { @@ -409,7 +425,8 @@ public class SQLite implements DataSource { * * @param ip String * - * @return int * @see fr.xephi.authme.datasource.DataSource#getIps(String) + * @return int + * @see fr.xephi.authme.datasource.DataSource#getIps(String) */ @Override public int getIps(String ip) { @@ -439,7 +456,8 @@ public class SQLite implements DataSource { * * @param auth PlayerAuth * - * @return boolean * @see fr.xephi.authme.datasource.DataSource#updateEmail(PlayerAuth) + * @return boolean + * @see fr.xephi.authme.datasource.DataSource#updateEmail(PlayerAuth) */ @Override public boolean updateEmail(PlayerAuth auth) { @@ -516,7 +534,8 @@ public class SQLite implements DataSource { * * @param auth PlayerAuth * - * @return List * @see fr.xephi.authme.datasource.DataSource#getAllAuthsByName(PlayerAuth) + * @return List of String + * @see fr.xephi.authme.datasource.DataSource#getAllAuthsByName(PlayerAuth) */ @Override public List getAllAuthsByName(PlayerAuth auth) { @@ -547,7 +566,8 @@ public class SQLite implements DataSource { * * @param ip String * - * @return List * @see fr.xephi.authme.datasource.DataSource#getAllAuthsByIp(String) + * @return List of String + * @see fr.xephi.authme.datasource.DataSource#getAllAuthsByIp(String) */ @Override public List getAllAuthsByIp(String ip) { @@ -578,7 +598,8 @@ public class SQLite implements DataSource { * * @param email String * - * @return List * @see fr.xephi.authme.datasource.DataSource#getAllAuthsByEmail(String) + * @return List of String + * @see fr.xephi.authme.datasource.DataSource#getAllAuthsByEmail(String) */ @Override public List getAllAuthsByEmail(String email) { @@ -623,7 +644,8 @@ public class SQLite implements DataSource { /** * Method getType. * - * @return DataSourceType * @see fr.xephi.authme.datasource.DataSource#getType() + * @return DataSourceType + * @see fr.xephi.authme.datasource.DataSource#getType() */ @Override public DataSourceType getType() { @@ -725,7 +747,8 @@ public class SQLite implements DataSource { /** * Method getAccountsRegistered. * - * @return int * @see fr.xephi.authme.datasource.DataSource#getAccountsRegistered() + * @return int + * @see fr.xephi.authme.datasource.DataSource#getAccountsRegistered() */ @Override public int getAccountsRegistered() { @@ -765,7 +788,7 @@ public class SQLite implements DataSource { /** * Method getAllAuths. * - * @return List + * @return List of PlayerAuth */ @Override public List getAllAuths() { @@ -791,7 +814,7 @@ public class SQLite implements DataSource { /** * Method getLoggedPlayers. * - * @return List + * @return List of PlayerAuth */ @Override public List getLoggedPlayers() { diff --git a/src/main/java/fr/xephi/authme/permission/DefaultPermission.java b/src/main/java/fr/xephi/authme/permission/DefaultPermission.java index f09de526..24e64c74 100644 --- a/src/main/java/fr/xephi/authme/permission/DefaultPermission.java +++ b/src/main/java/fr/xephi/authme/permission/DefaultPermission.java @@ -25,7 +25,11 @@ public enum DefaultPermission { this.title = title; } - /** Return the textual representation. */ + /** + * Return the textual representation. + * + * @return String + */ public String getTitle() { return title; } diff --git a/src/main/java/fr/xephi/authme/permission/PermissionsManager.java b/src/main/java/fr/xephi/authme/permission/PermissionsManager.java index 09b23525..ef58b569 100644 --- a/src/main/java/fr/xephi/authme/permission/PermissionsManager.java +++ b/src/main/java/fr/xephi/authme/permission/PermissionsManager.java @@ -1,10 +1,11 @@ package fr.xephi.authme.permission; -import de.bananaco.bpermissions.api.ApiLayer; -import de.bananaco.bpermissions.api.CalculableType; -import fr.xephi.authme.command.CommandDescription; -import fr.xephi.authme.util.CollectionUtils; -import net.milkbowl.vault.permission.Permission; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.logging.Logger; + import org.anjocaido.groupmanager.GroupManager; import org.anjocaido.groupmanager.permissions.AnjoPermissionsHandler; import org.bukkit.Bukkit; @@ -17,24 +18,25 @@ import org.bukkit.plugin.Plugin; import org.bukkit.plugin.PluginManager; import org.bukkit.plugin.RegisteredServiceProvider; import org.tyrannyofheaven.bukkit.zPermissions.ZPermissionsService; + +import de.bananaco.bpermissions.api.ApiLayer; +import de.bananaco.bpermissions.api.CalculableType; +import fr.xephi.authme.command.CommandDescription; +import fr.xephi.authme.util.CollectionUtils; +import net.milkbowl.vault.permission.Permission; import ru.tehkode.permissions.PermissionManager; import ru.tehkode.permissions.PermissionUser; import ru.tehkode.permissions.bukkit.PermissionsEx; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.logging.Logger; - /** + *

    * PermissionsManager. - *

    + *

    * A permissions manager, to manage and use various permissions systems. * This manager supports dynamic plugin hooking and various other features. - *

    + *

    * Written by Tim Visée. - * + *

    * @author Tim Visée, http://timvisee.com * @version 0.2.1 */ diff --git a/src/main/java/fr/xephi/authme/security/crypts/BCRYPT.java b/src/main/java/fr/xephi/authme/security/crypts/BCRYPT.java index b7602e7f..850a6f01 100644 --- a/src/main/java/fr/xephi/authme/security/crypts/BCRYPT.java +++ b/src/main/java/fr/xephi/authme/security/crypts/BCRYPT.java @@ -13,56 +13,57 @@ // OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. package fr.xephi.authme.security.crypts; -import fr.xephi.authme.ConsoleLogger; -import fr.xephi.authme.security.crypts.description.HasSalt; -import fr.xephi.authme.security.crypts.description.Usage; -import fr.xephi.authme.security.crypts.description.Recommendation; -import fr.xephi.authme.security.crypts.description.SaltType; -import fr.xephi.authme.settings.Settings; -import fr.xephi.authme.util.StringUtils; - import java.io.UnsupportedEncodingException; import java.security.SecureRandom; +import fr.xephi.authme.ConsoleLogger; +import fr.xephi.authme.security.crypts.description.HasSalt; +import fr.xephi.authme.security.crypts.description.Recommendation; +import fr.xephi.authme.security.crypts.description.SaltType; +import fr.xephi.authme.security.crypts.description.Usage; +import fr.xephi.authme.settings.Settings; +import fr.xephi.authme.util.StringUtils; + /** + *

    * BCrypt implements OpenBSD-style Blowfish password hashing using the scheme * described in "A Future-Adaptable Password Scheme" by Niels Provos and David * Mazieres. - *

    + *

    * This password hashing system tries to thwart off-line password cracking using * a computationally-intensive hashing algorithm, based on Bruce Schneier's * Blowfish cipher. The work factor of the algorithm is parameterised, so it can * be increased as computers get faster. - *

    + *

    * Usage is really simple. To hash a password for the first time, call the * hashpw method with a random salt, like this: - *

    + *

    * - * String pw_hash = BCrypt.hashpw(plain_password, BCrypt.gensalt());
    + * String pw_hash = BCrypt.hashpw(plain_password, BCrypt.gensalt());
    *
    - *

    + *

    * To check whether a plaintext password matches one that has been hashed * previously, use the checkpw method: - *

    + *

    * - * if (BCrypt.checkpw(candidate_password, stored_hash))
    - *     System.out.println("It matches");
    - * else
    - *     System.out.println("It does not match");
    + * if (BCrypt.checkpw(candidate_password, stored_hash))
    + *     System.out.println("It matches");
    + * else
    + *     System.out.println("It does not match");
    *
    - *

    + *

    * The gensalt() method takes an optional parameter (log_rounds) that determines * the computational complexity of the hashing: - *

    + *

    * - * String strong_salt = BCrypt.gensalt(10)
    - * String stronger_salt = BCrypt.gensalt(12)
    + * String strong_salt = BCrypt.gensalt(10)
    + * String stronger_salt = BCrypt.gensalt(12)
    *
    - *

    + *

    * The amount of work increases exponentially (2**log_rounds), so each increment * is twice as much work. The default log_rounds is 10, and the valid range is 4 * to 31. - * + *

    * @author Damien Miller * @version 0.2 */ diff --git a/src/main/java/fr/xephi/authme/security/crypts/WHIRLPOOL.java b/src/main/java/fr/xephi/authme/security/crypts/WHIRLPOOL.java index 0169d192..72d8e8fb 100644 --- a/src/main/java/fr/xephi/authme/security/crypts/WHIRLPOOL.java +++ b/src/main/java/fr/xephi/authme/security/crypts/WHIRLPOOL.java @@ -241,8 +241,9 @@ public class WHIRLPOOL extends UnsaltedMethod { * * @param source plaintext data to hash. * @param sourceBits how many bits of plaintext to process. - *

    - * This method maintains the invariant: bufferBits < 512 + *

    + * This method maintains the invariant: bufferBits < 512 + *

    */ public void NESSIEadd(byte[] source, long sourceBits) { /* @@ -322,10 +323,12 @@ public class WHIRLPOOL extends UnsaltedMethod { } /** + *

    * Get the hash value from the hashing state. - *

    - * This method uses the invariant: bufferBits < 512 - * + *

    + *

    + * This method uses the invariant: bufferBits < 512 + *

    * @param digest byte[] */ public void NESSIEfinalize(byte[] digest) { @@ -367,7 +370,7 @@ public class WHIRLPOOL extends UnsaltedMethod { * Delivers string input data to the hashing algorithm. * * @param source plaintext data to hash (ASCII text string). - * This method maintains the invariant: bufferBits < 512 + * This method maintains the invariant: bufferBits < 512 */ public void NESSIEadd(String source) { if (source.length() > 0) { diff --git a/src/main/java/fr/xephi/authme/security/crypts/description/HasSalt.java b/src/main/java/fr/xephi/authme/security/crypts/description/HasSalt.java index 1baf1e19..85ad0608 100644 --- a/src/main/java/fr/xephi/authme/security/crypts/description/HasSalt.java +++ b/src/main/java/fr/xephi/authme/security/crypts/description/HasSalt.java @@ -13,10 +13,14 @@ import java.lang.annotation.Target; @Retention(RetentionPolicy.RUNTIME) public @interface HasSalt { - /** The type of the salt. */ + /** The type of the salt. + * @return salttype The SaltType + */ SaltType value(); - /** For text salts, the length of the salt. */ + /** For text salts, the length of the salt. + * @return int Integer + */ int length() default 0; } diff --git a/src/main/java/fr/xephi/authme/security/crypts/description/Recommendation.java b/src/main/java/fr/xephi/authme/security/crypts/description/Recommendation.java index f37c3eac..e57a0c40 100644 --- a/src/main/java/fr/xephi/authme/security/crypts/description/Recommendation.java +++ b/src/main/java/fr/xephi/authme/security/crypts/description/Recommendation.java @@ -12,7 +12,9 @@ import java.lang.annotation.Target; @Retention(RetentionPolicy.RUNTIME) public @interface Recommendation { - /** The recommendation for using the hash algorithm. */ + /** The recommendation for using the hash algorithm. + * @return Usage The Usage + */ Usage value(); } diff --git a/src/main/java/fr/xephi/authme/security/pbkdf2/MacBasedPRF.java b/src/main/java/fr/xephi/authme/security/pbkdf2/MacBasedPRF.java index 5b0268c1..88ff11bf 100644 --- a/src/main/java/fr/xephi/authme/security/pbkdf2/MacBasedPRF.java +++ b/src/main/java/fr/xephi/authme/security/pbkdf2/MacBasedPRF.java @@ -1,15 +1,16 @@ package fr.xephi.authme.security.pbkdf2; -import javax.crypto.Mac; -import javax.crypto.spec.SecretKeySpec; import java.security.InvalidKeyException; import java.security.NoSuchAlgorithmException; import java.security.NoSuchProviderException; +import javax.crypto.Mac; +import javax.crypto.spec.SecretKeySpec; + /** - * Default PRF implementation based on standard javax.crypt.Mac mechanisms. *

    - *


    + * Default PRF implementation based on standard javax.crypt.Mac mechanisms. + *

    *

    * A free Java implementation of Password Based Key Derivation Function 2 as * defined by RFC 2898. Copyright (c) 2007 Matthias Gärtner diff --git a/src/main/java/fr/xephi/authme/security/pbkdf2/PBKDF2.java b/src/main/java/fr/xephi/authme/security/pbkdf2/PBKDF2.java index d1dab302..59bc96df 100644 --- a/src/main/java/fr/xephi/authme/security/pbkdf2/PBKDF2.java +++ b/src/main/java/fr/xephi/authme/security/pbkdf2/PBKDF2.java @@ -75,7 +75,7 @@ public interface PBKDF2 { /** * Allow setting of configured parameters. * - * @param parameters + * @param parameters PBKDF2Parameters */ void setParameters(PBKDF2Parameters parameters); diff --git a/src/main/java/fr/xephi/authme/security/pbkdf2/PBKDF2Engine.java b/src/main/java/fr/xephi/authme/security/pbkdf2/PBKDF2Engine.java index c78f786a..d32b8752 100644 --- a/src/main/java/fr/xephi/authme/security/pbkdf2/PBKDF2Engine.java +++ b/src/main/java/fr/xephi/authme/security/pbkdf2/PBKDF2Engine.java @@ -8,20 +8,17 @@ import java.security.SecureRandom; /** *

    * Request for Comments: 2898 PKCS #5: Password-Based Cryptography Specification - *

    + *

    * Version 2.0 - *

    + *

    *

    * PBKDF2 (P, S, c, dkLen) - *

    - *

    + *

    * Options: *
      *
    • PRF underlying pseudorandom function (hLen denotes the length in octets * of the pseudorandom function output). PRF is pluggable.
    • *
    - *

    - *

    * Input: *

      *
    • P password, an octet string
    • @@ -30,15 +27,11 @@ import java.security.SecureRandom; *
    • dkLen intended length in octets of the derived key, a positive integer, * at most (2^32 - 1) * hLen
    • *
    - *

    - *

    * Output: *

      *
    • DK derived key, a dkLen-octet string
    • *
    *

    - *


    - *

    * A free Java implementation of Password Based Key Derivation Function 2 as * defined by RFC 2898. Copyright (c) 2007 Matthias Gärtner *

    @@ -115,13 +108,14 @@ public class PBKDF2Engine implements PBKDF2 { * ISO-8559-1 encoding. Output result as * "Salt:iteration-count:PBKDF2" with binary data in hexadecimal * encoding. - *

    + *

    * Example: Password "password" (without the quotes) leads to * 48290A0B96C426C3:1000:973899B1D4AFEB3ED371060D0797E0EE0142BD04 - * + *

    * @param args Supply the password as argument. * - * @throws IOException * @throws NoSuchAlgorithmException * @throws NoSuchAlgorithmException + * @throws IOException an ioexception occured + * @throws NoSuchAlgorithmException a NoSuchAlgorithmException occured */ public static void main(String[] args) throws IOException, NoSuchAlgorithmException { @@ -266,8 +260,8 @@ public class PBKDF2Engine implements PBKDF2 { /** * Integer division with ceiling function. * - * @param a - * @param b + * @param a Integer + * @param b Integer * * @return ceil(a/b) * @see RFC 2898 5.2 Step * 2. @@ -288,7 +282,7 @@ public class PBKDF2Engine implements PBKDF2 { * @param prf Pseudo Random Function * @param S Salt as array of bytes * @param c Iteration count - * @param blockIndex + * @param blockIndex Integer * * @see RFC 2898 5.2 Step * 3. @@ -314,8 +308,8 @@ public class PBKDF2Engine implements PBKDF2 { * Block-Xor. Xor source bytes into destination byte buffer. Destination * buffer must be same length or less than source buffer. * - * @param dest - * @param src + * @param dest byte array + * @param src byte array */ protected void xor(byte[] dest, byte[] src) { for (int i = 0; i < dest.length; i++) { @@ -326,9 +320,9 @@ public class PBKDF2Engine implements PBKDF2 { /** * Four-octet encoding of the integer i, most significant octet first. * - * @param dest - * @param offset - * @param i + * @param dest byte array + * @param offset Integer + * @param i Integer * * @see RFC 2898 5.2 Step * 3. diff --git a/src/main/java/fr/xephi/authme/security/pbkdf2/PBKDF2Parameters.java b/src/main/java/fr/xephi/authme/security/pbkdf2/PBKDF2Parameters.java index b7b158a0..04abaa9f 100644 --- a/src/main/java/fr/xephi/authme/security/pbkdf2/PBKDF2Parameters.java +++ b/src/main/java/fr/xephi/authme/security/pbkdf2/PBKDF2Parameters.java @@ -5,8 +5,6 @@ package fr.xephi.authme.security.pbkdf2; * Parameter data holder for PBKDF2 configuration. *

    *

    - *


    - *

    * A free Java implementation of Password Based Key Derivation Function 2 as * defined by RFC 2898. Copyright (c) 2007 Matthias Gärtner *

    diff --git a/src/main/java/fr/xephi/authme/settings/OtherAccounts.java b/src/main/java/fr/xephi/authme/settings/OtherAccounts.java index 063e6af6..6e2796a3 100644 --- a/src/main/java/fr/xephi/authme/settings/OtherAccounts.java +++ b/src/main/java/fr/xephi/authme/settings/OtherAccounts.java @@ -1,13 +1,13 @@ package fr.xephi.authme.settings; -import org.bukkit.Bukkit; -import org.bukkit.entity.Player; - import java.io.File; import java.util.ArrayList; import java.util.List; import java.util.UUID; +import org.bukkit.Bukkit; +import org.bukkit.entity.Player; + /** * @author Xephi59 * @version $Revision: 1.0 $ @@ -88,7 +88,7 @@ public class OtherAccounts extends CustomConfiguration { * * @param uuid UUID * - * @return List + * @return StringList */ public List getAllPlayersByUUID(UUID uuid) { return this.getStringList(uuid.toString()); diff --git a/src/main/java/fr/xephi/authme/settings/Settings.java b/src/main/java/fr/xephi/authme/settings/Settings.java index 6080d45e..e28ddc3f 100644 --- a/src/main/java/fr/xephi/authme/settings/Settings.java +++ b/src/main/java/fr/xephi/authme/settings/Settings.java @@ -122,7 +122,7 @@ public final class Settings { /** * Method reload. * - * @throws Exception + * @throws Exception if something went wrong */ public static void reload() throws Exception { plugin.getLogger().info("Loading Configuration File..."); @@ -141,7 +141,6 @@ public final class Settings { messageFile = new File(PLUGIN_FOLDER, "messages" + File.separator + "messages_" + messagesLanguage + ".yml"); } - public static void loadVariables() { helpHeader = configFile.getString("settings.helpHeader", "AuthMeReloaded"); messagesLanguage = checkLang(configFile.getString("settings.messagesLanguage", "en").toLowerCase()); @@ -340,6 +339,11 @@ public final class Settings { } } + /** + * + * @param key the key to set + * @param value the value to set + */ public static void setValue(String key, Object value) { instance.set(key, value); save(); @@ -382,6 +386,7 @@ public final class Settings { * * @param name String * @param ip String + * @param domain String * * @return boolean */ @@ -768,11 +773,21 @@ public final class Settings { } } + /** + * + * @param path + * @return + */ private static boolean contains(String path) { return configFile.contains(path); } // public because it's used in AuthMe at one place + /** + * + * @param path String + * @param value String + */ public void set(String path, Object value) { configFile.set(path, value); } diff --git a/src/main/java/fr/xephi/authme/util/CollectionUtils.java b/src/main/java/fr/xephi/authme/util/CollectionUtils.java index 101ad968..5c3eaa7f 100644 --- a/src/main/java/fr/xephi/authme/util/CollectionUtils.java +++ b/src/main/java/fr/xephi/authme/util/CollectionUtils.java @@ -15,6 +15,8 @@ public final class CollectionUtils { /** * Get a range from a list based on start and count parameters in a safe way. * + * @param element + * @param list The List * @param start The start index * @param count The number of elements to add * @@ -34,6 +36,8 @@ public final class CollectionUtils { /** * Get all elements from a list starting from the given index. * + * @param element + * @param list The List * @param start The start index * * @return The sublist of all elements from index {@code start} and on; empty list @@ -46,6 +50,11 @@ public final class CollectionUtils { return getRange(list, start, list.size() - start); } + /** + * @param element + * @param coll Collection + * @return boolean Boolean + */ public static boolean isEmpty(Collection coll) { return coll == null || coll.isEmpty(); }