diff --git a/adapters/oidc/as7-eap6/as7-adapter-spi/src/main/java/org/keycloak/adapters/jbossweb/JBossWebPrincipalFactory.java b/adapters/oidc/as7-eap6/as7-adapter-spi/src/main/java/org/keycloak/adapters/jbossweb/JBossWebPrincipalFactory.java index 953697047f..f9e804d2a3 100755 --- a/adapters/oidc/as7-eap6/as7-adapter-spi/src/main/java/org/keycloak/adapters/jbossweb/JBossWebPrincipalFactory.java +++ b/adapters/oidc/as7-eap6/as7-adapter-spi/src/main/java/org/keycloak/adapters/jbossweb/JBossWebPrincipalFactory.java @@ -125,7 +125,7 @@ public class JBossWebPrincipalFactory extends GenericPrincipalFactory { Iterator iter = principals.iterator(); while (iter.hasNext()) { Object next = iter.next(); - if ((next instanceof Group) == false) + if (!(next instanceof Group)) continue; Group grp = (Group) next; if (grp.getName().equals(name)) { diff --git a/adapters/oidc/jetty/jetty9.1/src/main/java/org/keycloak/adapters/jetty/Jetty91RequestAuthenticator.java b/adapters/oidc/jetty/jetty9.1/src/main/java/org/keycloak/adapters/jetty/Jetty91RequestAuthenticator.java index cc3395ff83..ca00f0dfe6 100755 --- a/adapters/oidc/jetty/jetty9.1/src/main/java/org/keycloak/adapters/jetty/Jetty91RequestAuthenticator.java +++ b/adapters/oidc/jetty/jetty9.1/src/main/java/org/keycloak/adapters/jetty/Jetty91RequestAuthenticator.java @@ -24,7 +24,7 @@ public class Jetty91RequestAuthenticator extends JettyRequestAuthenticator { if (session == null) { return request.getSession(true).getId(); } - if (deployment.isTurnOffChangeSessionIdOnLogin() == false) return request.changeSessionId(); + if (!deployment.isTurnOffChangeSessionIdOnLogin()) return request.changeSessionId(); else return session.getId(); } } diff --git a/adapters/oidc/jetty/jetty9.2/src/main/java/org/keycloak/adapters/jetty/Jetty92RequestAuthenticator.java b/adapters/oidc/jetty/jetty9.2/src/main/java/org/keycloak/adapters/jetty/Jetty92RequestAuthenticator.java index 9c7e127009..f1dd6aa406 100755 --- a/adapters/oidc/jetty/jetty9.2/src/main/java/org/keycloak/adapters/jetty/Jetty92RequestAuthenticator.java +++ b/adapters/oidc/jetty/jetty9.2/src/main/java/org/keycloak/adapters/jetty/Jetty92RequestAuthenticator.java @@ -24,7 +24,7 @@ public class Jetty92RequestAuthenticator extends JettyRequestAuthenticator { if (session == null) { return request.getSession(true).getId(); } - if (deployment.isTurnOffChangeSessionIdOnLogin() == false) return request.changeSessionId(); + if (!deployment.isTurnOffChangeSessionIdOnLogin()) return request.changeSessionId(); else return session.getId(); } } diff --git a/adapters/oidc/tomcat/tomcat8/src/main/java/org/keycloak/adapters/tomcat/Tomcat8RequestAuthenticator.java b/adapters/oidc/tomcat/tomcat8/src/main/java/org/keycloak/adapters/tomcat/Tomcat8RequestAuthenticator.java index b221129442..fa58fcd552 100755 --- a/adapters/oidc/tomcat/tomcat8/src/main/java/org/keycloak/adapters/tomcat/Tomcat8RequestAuthenticator.java +++ b/adapters/oidc/tomcat/tomcat8/src/main/java/org/keycloak/adapters/tomcat/Tomcat8RequestAuthenticator.java @@ -22,7 +22,7 @@ public class Tomcat8RequestAuthenticator extends CatalinaRequestAuthenticator { if (session == null) { return request.getSession(true).getId(); } - if (deployment.isTurnOffChangeSessionIdOnLogin() == false) return request.changeSessionId(); + if (!deployment.isTurnOffChangeSessionIdOnLogin()) return request.changeSessionId(); else return session.getId(); } } diff --git a/adapters/oidc/undertow/src/main/java/org/keycloak/adapters/undertow/ServletRequestAuthenticator.java b/adapters/oidc/undertow/src/main/java/org/keycloak/adapters/undertow/ServletRequestAuthenticator.java index 2c288acf60..95618ffb81 100755 --- a/adapters/oidc/undertow/src/main/java/org/keycloak/adapters/undertow/ServletRequestAuthenticator.java +++ b/adapters/oidc/undertow/src/main/java/org/keycloak/adapters/undertow/ServletRequestAuthenticator.java @@ -64,7 +64,7 @@ public class ServletRequestAuthenticator extends AbstractUndertowRequestAuthenti @Override protected String changeHttpSessionId(boolean create) { - if (deployment.isTurnOffChangeSessionIdOnLogin() == false) return ChangeSessionId.changeSessionId(exchange, create); + if (!deployment.isTurnOffChangeSessionIdOnLogin()) return ChangeSessionId.changeSessionId(exchange, create); else return getHttpSessionId(create); } diff --git a/adapters/oidc/wildfly/wildfly-adapter/src/main/java/org/keycloak/adapters/wildfly/SecurityInfoHelper.java b/adapters/oidc/wildfly/wildfly-adapter/src/main/java/org/keycloak/adapters/wildfly/SecurityInfoHelper.java index 33c149b405..6fe3c8ae7f 100755 --- a/adapters/oidc/wildfly/wildfly-adapter/src/main/java/org/keycloak/adapters/wildfly/SecurityInfoHelper.java +++ b/adapters/oidc/wildfly/wildfly-adapter/src/main/java/org/keycloak/adapters/wildfly/SecurityInfoHelper.java @@ -89,7 +89,7 @@ public class SecurityInfoHelper { Iterator iter = principals.iterator(); while (iter.hasNext()) { Object next = iter.next(); - if ((next instanceof Group) == false) + if (!(next instanceof Group)) continue; Group grp = (Group) next; if (grp.getName().equals(name)) { diff --git a/adapters/oidc/wildfly/wildfly-adapter/src/main/java/org/keycloak/adapters/wildfly/WildflyRequestAuthenticator.java b/adapters/oidc/wildfly/wildfly-adapter/src/main/java/org/keycloak/adapters/wildfly/WildflyRequestAuthenticator.java index 80ed882e68..3f5782f070 100755 --- a/adapters/oidc/wildfly/wildfly-adapter/src/main/java/org/keycloak/adapters/wildfly/WildflyRequestAuthenticator.java +++ b/adapters/oidc/wildfly/wildfly-adapter/src/main/java/org/keycloak/adapters/wildfly/WildflyRequestAuthenticator.java @@ -108,7 +108,7 @@ public class WildflyRequestAuthenticator extends ServletRequestAuthenticator { Iterator iter = principals.iterator(); while (iter.hasNext()) { Object next = iter.next(); - if ((next instanceof Group) == false) + if (!(next instanceof Group)) continue; Group grp = (Group) next; if (grp.getName().equals(name)) { diff --git a/adapters/saml/jetty/jetty9.1/src/main/java/org/keycloak/adapters/saml/jetty/Jetty9SamlSessionStore.java b/adapters/saml/jetty/jetty9.1/src/main/java/org/keycloak/adapters/saml/jetty/Jetty9SamlSessionStore.java index 56a26ca83f..291568e909 100755 --- a/adapters/saml/jetty/jetty9.1/src/main/java/org/keycloak/adapters/saml/jetty/Jetty9SamlSessionStore.java +++ b/adapters/saml/jetty/jetty9.1/src/main/java/org/keycloak/adapters/saml/jetty/Jetty9SamlSessionStore.java @@ -21,7 +21,7 @@ public class Jetty9SamlSessionStore extends JettySamlSessionStore { @Override protected String changeSessionId(HttpSession session) { Request request = this.request; - if (deployment.turnOffChangeSessionIdOnLogin() == false) return request.changeSessionId(); + if (!deployment.turnOffChangeSessionIdOnLogin()) return request.changeSessionId(); else return session.getId(); } } diff --git a/adapters/saml/jetty/jetty9.2/src/main/java/org/keycloak/adapters/saml/jetty/Jetty9SamlSessionStore.java b/adapters/saml/jetty/jetty9.2/src/main/java/org/keycloak/adapters/saml/jetty/Jetty9SamlSessionStore.java index 56a26ca83f..291568e909 100755 --- a/adapters/saml/jetty/jetty9.2/src/main/java/org/keycloak/adapters/saml/jetty/Jetty9SamlSessionStore.java +++ b/adapters/saml/jetty/jetty9.2/src/main/java/org/keycloak/adapters/saml/jetty/Jetty9SamlSessionStore.java @@ -21,7 +21,7 @@ public class Jetty9SamlSessionStore extends JettySamlSessionStore { @Override protected String changeSessionId(HttpSession session) { Request request = this.request; - if (deployment.turnOffChangeSessionIdOnLogin() == false) return request.changeSessionId(); + if (!deployment.turnOffChangeSessionIdOnLogin()) return request.changeSessionId(); else return session.getId(); } } diff --git a/adapters/saml/tomcat/tomcat8/src/main/java/org/keycloak/adapters/saml/tomcat/Tomcat8SamlSessionStore.java b/adapters/saml/tomcat/tomcat8/src/main/java/org/keycloak/adapters/saml/tomcat/Tomcat8SamlSessionStore.java index 4bd9cfaabc..d7b7450c94 100755 --- a/adapters/saml/tomcat/tomcat8/src/main/java/org/keycloak/adapters/saml/tomcat/Tomcat8SamlSessionStore.java +++ b/adapters/saml/tomcat/tomcat8/src/main/java/org/keycloak/adapters/saml/tomcat/Tomcat8SamlSessionStore.java @@ -22,7 +22,7 @@ public class Tomcat8SamlSessionStore extends CatalinaSamlSessionStore { @Override protected String changeSessionId(Session session) { Request request = this.request; - if (deployment.turnOffChangeSessionIdOnLogin() == false) return request.changeSessionId(); + if (!deployment.turnOffChangeSessionIdOnLogin()) return request.changeSessionId(); else return session.getId(); } } diff --git a/adapters/saml/undertow/src/main/java/org/keycloak/adapters/saml/undertow/ServletSamlSessionStore.java b/adapters/saml/undertow/src/main/java/org/keycloak/adapters/saml/undertow/ServletSamlSessionStore.java index cd6f217638..c58f6d026b 100755 --- a/adapters/saml/undertow/src/main/java/org/keycloak/adapters/saml/undertow/ServletSamlSessionStore.java +++ b/adapters/saml/undertow/src/main/java/org/keycloak/adapters/saml/undertow/ServletSamlSessionStore.java @@ -165,7 +165,7 @@ public class ServletSamlSessionStore implements SamlSessionStore { } protected String changeSessionId(HttpSession session) { - if (deployment.turnOffChangeSessionIdOnLogin() == false) return ChangeSessionId.changeSessionId(exchange, false); + if (!deployment.turnOffChangeSessionIdOnLogin()) return ChangeSessionId.changeSessionId(exchange, false); else return session.getId(); } diff --git a/adapters/saml/wildfly/wildfly-adapter/src/main/java/org/keycloak/adapters/saml/wildfly/SecurityInfoHelper.java b/adapters/saml/wildfly/wildfly-adapter/src/main/java/org/keycloak/adapters/saml/wildfly/SecurityInfoHelper.java index 7170ac6d03..f6c8f0ebff 100755 --- a/adapters/saml/wildfly/wildfly-adapter/src/main/java/org/keycloak/adapters/saml/wildfly/SecurityInfoHelper.java +++ b/adapters/saml/wildfly/wildfly-adapter/src/main/java/org/keycloak/adapters/saml/wildfly/SecurityInfoHelper.java @@ -89,7 +89,7 @@ public class SecurityInfoHelper { Iterator iter = principals.iterator(); while (iter.hasNext()) { Object next = iter.next(); - if ((next instanceof Group) == false) + if (!(next instanceof Group)) continue; Group grp = (Group) next; if (grp.getName().equals(name)) { diff --git a/adapters/spi/jboss-adapter-core/src/main/java/org/keycloak/adapters/jboss/KeycloakLoginModule.java b/adapters/spi/jboss-adapter-core/src/main/java/org/keycloak/adapters/jboss/KeycloakLoginModule.java index 250517e813..9050851598 100755 --- a/adapters/spi/jboss-adapter-core/src/main/java/org/keycloak/adapters/jboss/KeycloakLoginModule.java +++ b/adapters/spi/jboss-adapter-core/src/main/java/org/keycloak/adapters/jboss/KeycloakLoginModule.java @@ -30,7 +30,7 @@ public class KeycloakLoginModule extends AbstractServerLoginModule { @Override public boolean login() throws LoginException { log.debug("KeycloakLoginModule.login()"); - if (super.login() == true) { + if (super.login()) { log.debug("super.login()==true"); return true; } diff --git a/adapters/spi/tomcat-adapter-spi/src/main/java/org/keycloak/adapters/tomcat/GenericPrincipalFactory.java b/adapters/spi/tomcat-adapter-spi/src/main/java/org/keycloak/adapters/tomcat/GenericPrincipalFactory.java index 201a409d00..37cdd083ba 100755 --- a/adapters/spi/tomcat-adapter-spi/src/main/java/org/keycloak/adapters/tomcat/GenericPrincipalFactory.java +++ b/adapters/spi/tomcat-adapter-spi/src/main/java/org/keycloak/adapters/tomcat/GenericPrincipalFactory.java @@ -81,7 +81,7 @@ public abstract class GenericPrincipalFactory { Iterator iter = principals.iterator(); while (iter.hasNext()) { Object next = iter.next(); - if ((next instanceof Group) == false) + if (!(next instanceof Group)) continue; Group grp = (Group) next; if (grp.getName().equals(name)) { diff --git a/common/src/main/java/org/keycloak/common/util/StringPropertyReplacer.java b/common/src/main/java/org/keycloak/common/util/StringPropertyReplacer.java index a01665b003..b5b5e9d206 100755 --- a/common/src/main/java/org/keycloak/common/util/StringPropertyReplacer.java +++ b/common/src/main/java/org/keycloak/common/util/StringPropertyReplacer.java @@ -207,7 +207,7 @@ public final class StringPropertyReplacer } // No properties - if (properties == false) + if (!properties) return string; // Collect the trailing characters diff --git a/saml-core/src/main/java/org/keycloak/saml/common/util/StringUtil.java b/saml-core/src/main/java/org/keycloak/saml/common/util/StringUtil.java index 3db64c2085..15ce2f04d1 100755 --- a/saml-core/src/main/java/org/keycloak/saml/common/util/StringUtil.java +++ b/saml-core/src/main/java/org/keycloak/saml/common/util/StringUtil.java @@ -130,7 +130,7 @@ public class StringUtil { * @param second */ public static void match(String first, String second) { - if (first.equals(second) == false) + if (!first.equals(second)) throw logger.notEqualError(first, second); } diff --git a/saml-core/src/main/java/org/keycloak/saml/common/util/TransformerUtil.java b/saml-core/src/main/java/org/keycloak/saml/common/util/TransformerUtil.java index dd4a9d0e1f..508a66a9a3 100755 --- a/saml-core/src/main/java/org/keycloak/saml/common/util/TransformerUtil.java +++ b/saml-core/src/main/java/org/keycloak/saml/common/util/TransformerUtil.java @@ -191,7 +191,7 @@ public class TransformerUtil { public void transform(Source xmlSource, Result outputTarget) throws TransformerException { if (!(xmlSource instanceof StAXSource)) throw logger.wrongTypeError("xmlSource should be a stax source"); - if (outputTarget instanceof DOMResult == false) + if (!(outputTarget instanceof DOMResult)) throw logger.wrongTypeError("outputTarget should be a dom result"); String rootTag = null; @@ -208,7 +208,7 @@ public class TransformerUtil { try { XMLEvent xmlEvent = StaxParserUtil.getNextEvent(xmlEventReader); - if (xmlEvent instanceof StartElement == false) + if (!(xmlEvent instanceof StartElement)) throw new TransformerException(ErrorCodes.WRITER_SHOULD_START_ELEMENT); StartElement rootElement = (StartElement) xmlEvent; diff --git a/saml-core/src/main/java/org/keycloak/saml/processing/core/saml/v2/util/StatementUtil.java b/saml-core/src/main/java/org/keycloak/saml/processing/core/saml/v2/util/StatementUtil.java index c184e58ea7..77268b9910 100755 --- a/saml-core/src/main/java/org/keycloak/saml/processing/core/saml/v2/util/StatementUtil.java +++ b/saml-core/src/main/java/org/keycloak/saml/processing/core/saml/v2/util/StatementUtil.java @@ -167,7 +167,7 @@ public class StatementUtil { * @return */ public static AttributeStatementType createAttributeStatementForRoles(List roles, boolean multivalued) { - if (multivalued == false) { + if (!multivalued) { return createAttributeStatement(roles); } AttributeStatementType attrStatement = new AttributeStatementType(); diff --git a/saml-core/src/main/java/org/keycloak/saml/processing/core/util/JAXPValidationUtil.java b/saml-core/src/main/java/org/keycloak/saml/processing/core/util/JAXPValidationUtil.java index 836b3fcb06..9ab4c1562d 100755 --- a/saml-core/src/main/java/org/keycloak/saml/processing/core/util/JAXPValidationUtil.java +++ b/saml-core/src/main/java/org/keycloak/saml/processing/core/util/JAXPValidationUtil.java @@ -136,7 +136,7 @@ public class JAXPValidationUtil { public void error(SAXParseException ex) throws SAXException { logException(ex); - if (ex.getMessage().contains("null") == false) { + if (!ex.getMessage().contains("null")) { throw ex; } }