Update checkstyle config and CodeClimate exclusions
- Add new checkstyle checks: require Javadoc on large private methods, default in switch, declaration order & others - Update path exclusions in CodeClimate config to match newly renamed classes (e.g. PHPBB -> PhpBB) - Create consistency check testing that excluded paths exist as classes - Fix some trivial violations
This commit is contained in:
@@ -79,8 +79,8 @@ public class AuthGroupHandler implements Reloadable {
|
||||
throw new IllegalStateException("Encountered unhandled auth group type '" + groupType + "'");
|
||||
}
|
||||
|
||||
ConsoleLogger.debug(
|
||||
() -> player.getName() + " changed to " + groupType + ": has groups " + permissionsManager.getGroups(player));
|
||||
ConsoleLogger.debug(() -> player.getName() + " changed to "
|
||||
+ groupType + ": has groups " + permissionsManager.getGroups(player));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -74,7 +74,7 @@ public class PermissionsManager implements Reloadable {
|
||||
// Loop through all the available permissions system types
|
||||
for (PermissionsSystemType type : PermissionsSystemType.values()) {
|
||||
try {
|
||||
PermissionHandler handler = getPermissionHandler(type);
|
||||
PermissionHandler handler = createPermissionHandler(type);
|
||||
if (handler != null) {
|
||||
// Show a success message and return
|
||||
this.handler = handler;
|
||||
@@ -91,7 +91,14 @@ public class PermissionsManager implements Reloadable {
|
||||
ConsoleLogger.info("No supported permissions system found! Permissions are disabled!");
|
||||
}
|
||||
|
||||
private PermissionHandler getPermissionHandler(PermissionsSystemType type) throws PermissionHandlerException {
|
||||
/**
|
||||
* Creates a permission handler for the provided permission systems if possible.
|
||||
*
|
||||
* @param type the permission systems type for which to create a corresponding permission handler
|
||||
* @return the permission handler, or {@code null} if not possible
|
||||
* @throws PermissionHandlerException during initialization of the permission handler
|
||||
*/
|
||||
private PermissionHandler createPermissionHandler(PermissionsSystemType type) throws PermissionHandlerException {
|
||||
// Try to find the plugin for the current permissions system
|
||||
Plugin plugin = pluginManager.getPlugin(type.getPluginName());
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ public interface PermissionHandler {
|
||||
* @param group The name of the group.
|
||||
*
|
||||
* @return True if succeed, false otherwise.
|
||||
* False is also returned if this feature isn't supported for the current permissions system.
|
||||
* False is also returned if this feature isn't supported for the current permissions system.
|
||||
*/
|
||||
boolean addToGroup(Player player, String group);
|
||||
|
||||
@@ -47,7 +47,7 @@ public interface PermissionHandler {
|
||||
* @param group The group name.
|
||||
*
|
||||
* @return True if the player is in the specified group, false otherwise.
|
||||
* False is also returned if groups aren't supported by the used permissions system.
|
||||
* False is also returned if groups aren't supported by the used permissions system.
|
||||
*/
|
||||
default boolean isInGroup(Player player, String group) {
|
||||
return getGroups(player).contains(group);
|
||||
@@ -60,7 +60,7 @@ public interface PermissionHandler {
|
||||
* @param group The name of the group.
|
||||
*
|
||||
* @return True if succeed, false otherwise.
|
||||
* False is also returned if this feature isn't supported for the current permissions system.
|
||||
* False is also returned if this feature isn't supported for the current permissions system.
|
||||
*/
|
||||
boolean removeFromGroup(Player player, String group);
|
||||
|
||||
@@ -72,7 +72,7 @@ public interface PermissionHandler {
|
||||
* @param group The name of the group.
|
||||
*
|
||||
* @return True if succeed, false otherwise.
|
||||
* False is also returned if this feature isn't supported for the current permissions system.
|
||||
* False is also returned if this feature isn't supported for the current permissions system.
|
||||
*/
|
||||
boolean setGroup(Player player, String group);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user