Fix minor checkstyle issues

- Add JavaDoc where checkstyle expects it
- Fix line too long issues
- ...
This commit is contained in:
ljacqu
2017-05-07 11:59:01 +02:00
parent 1a48348824
commit 1f8307c8f6
43 changed files with 605 additions and 134 deletions
@@ -52,6 +52,7 @@ public class SettingsMigrationService extends PlainMigrationService {
}
@Override
@SuppressWarnings("checkstyle:BooleanExpressionComplexity")
protected boolean performMigrations(PropertyResource resource, List<Property<?>> properties) {
boolean changes = false;
if ("[a-zA-Z0-9_?]*".equals(resource.getString(ALLOWED_NICKNAME_CHARACTERS.getPath()))) {
@@ -229,13 +230,19 @@ public class SettingsMigrationService extends PlainMigrationService {
return false;
}
/**
* Converts old boolean configurations for registration to the new enum properties, if applicable.
*
* @param resource The property resource
* @return True if the configuration has changed, false otherwise
*/
private static boolean convertToRegistrationType(PropertyResource resource) {
String oldEmailRegistrationPath = "settings.registration.enableEmailRegistrationSystem";
if (RegistrationSettings.REGISTRATION_TYPE.isPresent(resource) || !resource.contains(oldEmailRegistrationPath)) {
String oldEmailRegisterPath = "settings.registration.enableEmailRegistrationSystem";
if (RegistrationSettings.REGISTRATION_TYPE.isPresent(resource) || !resource.contains(oldEmailRegisterPath)) {
return false;
}
boolean useEmail = newProperty(oldEmailRegistrationPath, false).getValue(resource);
boolean useEmail = newProperty(oldEmailRegisterPath, false).getValue(resource);
RegistrationType registrationType = useEmail ? RegistrationType.EMAIL : RegistrationType.PASSWORD;
String useConfirmationPath = useEmail
@@ -253,6 +260,12 @@ public class SettingsMigrationService extends PlainMigrationService {
return true;
}
/**
* Migrates old permission group settings to the new configurations.
*
* @param resource The property resource
* @return True if the configuration has changed, false otherwise
*/
private static boolean mergeAndMovePermissionGroupSettings(PropertyResource resource) {
boolean performedChanges;
@@ -274,7 +287,7 @@ public class SettingsMigrationService extends PlainMigrationService {
}
/**
* Checks for an old property path and moves it to a new path if present.
* Checks for an old property path and moves it to a new path if it is present and the new path is not yet set.
*
* @param oldProperty The old property (create a temporary {@link Property} object with the path)
* @param newProperty The new property to move the value to
@@ -165,6 +165,8 @@ public class SpawnLoader implements Reloadable {
case "authme":
spawnLoc = getSpawn();
break;
default:
// ignore
}
if (spawnLoc != null) {
return spawnLoc;