Merge pull request #2129 from georgekankava/staging/literal-boolean-values-should-not-be-used-in-condition-expressions-fix-1

squid:S1125 - Literal boolean values should not be used in condition expressions
This commit is contained in:
Marek Posolda 2016-01-29 13:23:20 +01:00
commit 41551e08b0
19 changed files with 20 additions and 20 deletions

View file

@ -125,7 +125,7 @@ public class JBossWebPrincipalFactory extends GenericPrincipalFactory {
Iterator<Principal> iter = principals.iterator(); Iterator<Principal> iter = principals.iterator();
while (iter.hasNext()) { while (iter.hasNext()) {
Object next = iter.next(); Object next = iter.next();
if ((next instanceof Group) == false) if (!(next instanceof Group))
continue; continue;
Group grp = (Group) next; Group grp = (Group) next;
if (grp.getName().equals(name)) { if (grp.getName().equals(name)) {

View file

@ -24,7 +24,7 @@ public class Jetty91RequestAuthenticator extends JettyRequestAuthenticator {
if (session == null) { if (session == null) {
return request.getSession(true).getId(); return request.getSession(true).getId();
} }
if (deployment.isTurnOffChangeSessionIdOnLogin() == false) return request.changeSessionId(); if (!deployment.isTurnOffChangeSessionIdOnLogin()) return request.changeSessionId();
else return session.getId(); else return session.getId();
} }
} }

View file

@ -24,7 +24,7 @@ public class Jetty92RequestAuthenticator extends JettyRequestAuthenticator {
if (session == null) { if (session == null) {
return request.getSession(true).getId(); return request.getSession(true).getId();
} }
if (deployment.isTurnOffChangeSessionIdOnLogin() == false) return request.changeSessionId(); if (!deployment.isTurnOffChangeSessionIdOnLogin()) return request.changeSessionId();
else return session.getId(); else return session.getId();
} }
} }

View file

@ -22,7 +22,7 @@ public class Tomcat8RequestAuthenticator extends CatalinaRequestAuthenticator {
if (session == null) { if (session == null) {
return request.getSession(true).getId(); return request.getSession(true).getId();
} }
if (deployment.isTurnOffChangeSessionIdOnLogin() == false) return request.changeSessionId(); if (!deployment.isTurnOffChangeSessionIdOnLogin()) return request.changeSessionId();
else return session.getId(); else return session.getId();
} }
} }

View file

@ -64,7 +64,7 @@ public class ServletRequestAuthenticator extends AbstractUndertowRequestAuthenti
@Override @Override
protected String changeHttpSessionId(boolean create) { 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); else return getHttpSessionId(create);
} }

View file

@ -89,7 +89,7 @@ public class SecurityInfoHelper {
Iterator<Principal> iter = principals.iterator(); Iterator<Principal> iter = principals.iterator();
while (iter.hasNext()) { while (iter.hasNext()) {
Object next = iter.next(); Object next = iter.next();
if ((next instanceof Group) == false) if (!(next instanceof Group))
continue; continue;
Group grp = (Group) next; Group grp = (Group) next;
if (grp.getName().equals(name)) { if (grp.getName().equals(name)) {

View file

@ -108,7 +108,7 @@ public class WildflyRequestAuthenticator extends ServletRequestAuthenticator {
Iterator<Principal> iter = principals.iterator(); Iterator<Principal> iter = principals.iterator();
while (iter.hasNext()) { while (iter.hasNext()) {
Object next = iter.next(); Object next = iter.next();
if ((next instanceof Group) == false) if (!(next instanceof Group))
continue; continue;
Group grp = (Group) next; Group grp = (Group) next;
if (grp.getName().equals(name)) { if (grp.getName().equals(name)) {

View file

@ -21,7 +21,7 @@ public class Jetty9SamlSessionStore extends JettySamlSessionStore {
@Override @Override
protected String changeSessionId(HttpSession session) { protected String changeSessionId(HttpSession session) {
Request request = this.request; Request request = this.request;
if (deployment.turnOffChangeSessionIdOnLogin() == false) return request.changeSessionId(); if (!deployment.turnOffChangeSessionIdOnLogin()) return request.changeSessionId();
else return session.getId(); else return session.getId();
} }
} }

View file

@ -21,7 +21,7 @@ public class Jetty9SamlSessionStore extends JettySamlSessionStore {
@Override @Override
protected String changeSessionId(HttpSession session) { protected String changeSessionId(HttpSession session) {
Request request = this.request; Request request = this.request;
if (deployment.turnOffChangeSessionIdOnLogin() == false) return request.changeSessionId(); if (!deployment.turnOffChangeSessionIdOnLogin()) return request.changeSessionId();
else return session.getId(); else return session.getId();
} }
} }

View file

@ -22,7 +22,7 @@ public class Tomcat8SamlSessionStore extends CatalinaSamlSessionStore {
@Override @Override
protected String changeSessionId(Session session) { protected String changeSessionId(Session session) {
Request request = this.request; Request request = this.request;
if (deployment.turnOffChangeSessionIdOnLogin() == false) return request.changeSessionId(); if (!deployment.turnOffChangeSessionIdOnLogin()) return request.changeSessionId();
else return session.getId(); else return session.getId();
} }
} }

View file

@ -165,7 +165,7 @@ public class ServletSamlSessionStore implements SamlSessionStore {
} }
protected String changeSessionId(HttpSession session) { 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(); else return session.getId();
} }

View file

@ -89,7 +89,7 @@ public class SecurityInfoHelper {
Iterator<Principal> iter = principals.iterator(); Iterator<Principal> iter = principals.iterator();
while (iter.hasNext()) { while (iter.hasNext()) {
Object next = iter.next(); Object next = iter.next();
if ((next instanceof Group) == false) if (!(next instanceof Group))
continue; continue;
Group grp = (Group) next; Group grp = (Group) next;
if (grp.getName().equals(name)) { if (grp.getName().equals(name)) {

View file

@ -30,7 +30,7 @@ public class KeycloakLoginModule extends AbstractServerLoginModule {
@Override @Override
public boolean login() throws LoginException { public boolean login() throws LoginException {
log.debug("KeycloakLoginModule.login()"); log.debug("KeycloakLoginModule.login()");
if (super.login() == true) { if (super.login()) {
log.debug("super.login()==true"); log.debug("super.login()==true");
return true; return true;
} }

View file

@ -81,7 +81,7 @@ public abstract class GenericPrincipalFactory {
Iterator<Principal> iter = principals.iterator(); Iterator<Principal> iter = principals.iterator();
while (iter.hasNext()) { while (iter.hasNext()) {
Object next = iter.next(); Object next = iter.next();
if ((next instanceof Group) == false) if (!(next instanceof Group))
continue; continue;
Group grp = (Group) next; Group grp = (Group) next;
if (grp.getName().equals(name)) { if (grp.getName().equals(name)) {

View file

@ -207,7 +207,7 @@ public final class StringPropertyReplacer
} }
// No properties // No properties
if (properties == false) if (!properties)
return string; return string;
// Collect the trailing characters // Collect the trailing characters

View file

@ -130,7 +130,7 @@ public class StringUtil {
* @param second * @param second
*/ */
public static void match(String first, String second) { public static void match(String first, String second) {
if (first.equals(second) == false) if (!first.equals(second))
throw logger.notEqualError(first, second); throw logger.notEqualError(first, second);
} }

View file

@ -191,7 +191,7 @@ public class TransformerUtil {
public void transform(Source xmlSource, Result outputTarget) throws TransformerException { public void transform(Source xmlSource, Result outputTarget) throws TransformerException {
if (!(xmlSource instanceof StAXSource)) if (!(xmlSource instanceof StAXSource))
throw logger.wrongTypeError("xmlSource should be a stax source"); 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"); throw logger.wrongTypeError("outputTarget should be a dom result");
String rootTag = null; String rootTag = null;
@ -208,7 +208,7 @@ public class TransformerUtil {
try { try {
XMLEvent xmlEvent = StaxParserUtil.getNextEvent(xmlEventReader); XMLEvent xmlEvent = StaxParserUtil.getNextEvent(xmlEventReader);
if (xmlEvent instanceof StartElement == false) if (!(xmlEvent instanceof StartElement))
throw new TransformerException(ErrorCodes.WRITER_SHOULD_START_ELEMENT); throw new TransformerException(ErrorCodes.WRITER_SHOULD_START_ELEMENT);
StartElement rootElement = (StartElement) xmlEvent; StartElement rootElement = (StartElement) xmlEvent;

View file

@ -167,7 +167,7 @@ public class StatementUtil {
* @return * @return
*/ */
public static AttributeStatementType createAttributeStatementForRoles(List<String> roles, boolean multivalued) { public static AttributeStatementType createAttributeStatementForRoles(List<String> roles, boolean multivalued) {
if (multivalued == false) { if (!multivalued) {
return createAttributeStatement(roles); return createAttributeStatement(roles);
} }
AttributeStatementType attrStatement = new AttributeStatementType(); AttributeStatementType attrStatement = new AttributeStatementType();

View file

@ -136,7 +136,7 @@ public class JAXPValidationUtil {
public void error(SAXParseException ex) throws SAXException { public void error(SAXParseException ex) throws SAXException {
logException(ex); logException(ex);
if (ex.getMessage().contains("null") == false) { if (!ex.getMessage().contains("null")) {
throw ex; throw ex;
} }
} }