squid:S1125 - Literal boolean values should not be used in condition expressions
This commit is contained in:
parent
b93deddda3
commit
92a494359d
19 changed files with 20 additions and 20 deletions
|
@ -125,7 +125,7 @@ public class JBossWebPrincipalFactory extends GenericPrincipalFactory {
|
|||
Iterator<Principal> 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)) {
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -89,7 +89,7 @@ public class SecurityInfoHelper {
|
|||
Iterator<Principal> 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)) {
|
||||
|
|
|
@ -108,7 +108,7 @@ public class WildflyRequestAuthenticator extends ServletRequestAuthenticator {
|
|||
Iterator<Principal> 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)) {
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -89,7 +89,7 @@ public class SecurityInfoHelper {
|
|||
Iterator<Principal> 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)) {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -81,7 +81,7 @@ public abstract class GenericPrincipalFactory {
|
|||
Iterator<Principal> 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)) {
|
||||
|
|
|
@ -207,7 +207,7 @@ public final class StringPropertyReplacer
|
|||
}
|
||||
|
||||
// No properties
|
||||
if (properties == false)
|
||||
if (!properties)
|
||||
return string;
|
||||
|
||||
// Collect the trailing characters
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -167,7 +167,7 @@ public class StatementUtil {
|
|||
* @return
|
||||
*/
|
||||
public static AttributeStatementType createAttributeStatementForRoles(List<String> roles, boolean multivalued) {
|
||||
if (multivalued == false) {
|
||||
if (!multivalued) {
|
||||
return createAttributeStatement(roles);
|
||||
}
|
||||
AttributeStatementType attrStatement = new AttributeStatementType();
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue