From efad91adb0aa166eb89b1a0046da136f7cf4e27c Mon Sep 17 00:00:00 2001 From: Nick Couchman Date: Sun, 5 Feb 2017 19:51:40 -0500 Subject: [PATCH] GUACAMOLE-197: Fix if-is-not-a-function style issues, again... --- .../radius/AuthenticationProviderService.java | 8 ++++---- .../auth/radius/RadiusConnectionService.java | 18 +++++++++--------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/extensions/guacamole-auth-radius/src/main/java/org/apache/guacamole/auth/radius/AuthenticationProviderService.java b/extensions/guacamole-auth-radius/src/main/java/org/apache/guacamole/auth/radius/AuthenticationProviderService.java index d803af6af..860f83189 100644 --- a/extensions/guacamole-auth-radius/src/main/java/org/apache/guacamole/auth/radius/AuthenticationProviderService.java +++ b/extensions/guacamole-auth-radius/src/main/java/org/apache/guacamole/auth/radius/AuthenticationProviderService.java @@ -103,15 +103,15 @@ public class AuthenticationProviderService { } // If configure fails, permission to login is denied - if(radPack == null) { + if (radPack == null) { logger.debug("Nothing in the RADIUS packet."); throw new GuacamoleInvalidCredentialsException("Permission denied.", CredentialsInfo.USERNAME_PASSWORD); } - else if(radPack instanceof AccessReject) { + else if (radPack instanceof AccessReject) { logger.debug("Login has been rejected by RADIUS server."); throw new GuacamoleInvalidCredentialsException("Permission denied.", CredentialsInfo.USERNAME_PASSWORD); } - else if(radPack instanceof AccessChallenge) { + else if (radPack instanceof AccessChallenge) { try { String replyMsg = radPack.getAttributeValue("Reply-Message").toString(); String radState = radPack.getAttributeValue("State").toString(); @@ -127,7 +127,7 @@ public class AuthenticationProviderService { throw new GuacamoleInvalidCredentialsException("Authentication error.", CredentialsInfo.USERNAME_PASSWORD); } } - else if(radPack instanceof AccessAccept) { + else if (radPack instanceof AccessAccept) { try { // Return AuthenticatedUser if bind succeeds diff --git a/extensions/guacamole-auth-radius/src/main/java/org/apache/guacamole/auth/radius/RadiusConnectionService.java b/extensions/guacamole-auth-radius/src/main/java/org/apache/guacamole/auth/radius/RadiusConnectionService.java index 0357fbe76..8562ec9fe 100644 --- a/extensions/guacamole-auth-radius/src/main/java/org/apache/guacamole/auth/radius/RadiusConnectionService.java +++ b/extensions/guacamole-auth-radius/src/main/java/org/apache/guacamole/auth/radius/RadiusConnectionService.java @@ -132,20 +132,20 @@ public class RadiusConnectionService { createRadiusConnection(); AttributeFactory.loadAttributeDictionary("net.jradius.dictionary.AttributeDictionaryImpl"); - if(radiusClient == null) + if (radiusClient == null) return null; - if(username == null || username.isEmpty()) { + if (username == null || username.isEmpty()) { logger.warn("Anonymous access not allowed with RADIUS client."); return null; } - if(password == null || password.isEmpty()) { + if (password == null || password.isEmpty()) { logger.warn("Password required for RADIUS authentication."); return null; } RadiusAuthenticator radAuth = radiusClient.getAuthProtocol(confService.getRadiusAuthProtocol()); - if(radAuth == null) + if (radAuth == null) throw new GuacamoleException("Unknown RADIUS authentication protocol."); try { AttributeList radAttrs = new AttributeList(); @@ -175,24 +175,24 @@ public class RadiusConnectionService { createRadiusConnection(); AttributeFactory.loadAttributeDictionary("net.jradius.dictionary.AttributeDictionaryImpl"); - if(radiusClient == null) + if (radiusClient == null) return null; - if(username == null || username.isEmpty()) { + if (username == null || username.isEmpty()) { logger.warn("Anonymous access not allowed with RADIUS client."); return null; } - if(state == null || state.isEmpty()) { + if (state == null || state.isEmpty()) { logger.warn("This method needs a previous RADIUS state to respond to."); return null; } - if(response == null || response.isEmpty()) { + if (response == null || response.isEmpty()) { logger.warn("Response required for RADIUS authentication."); return null; } RadiusAuthenticator radAuth = radiusClient.getAuthProtocol(confService.getRadiusAuthProtocol()); - if(radAuth == null) + if (radAuth == null) throw new GuacamoleException("Unknown RADIUS authentication protocol."); try { AttributeList radAttrs = new AttributeList();