Skip to content

Commit

Permalink
replaced == tests on Booleans with equals
Browse files Browse the repository at this point in the history
Signed-off-by: Greg Wilkins <gregw@webtide.com>
  • Loading branch information
gregw committed Sep 30, 2021
1 parent bc60a9b commit dfd1e09
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Expand Up @@ -670,7 +670,7 @@ else if (contentLength != field.getLongValue())
close = true;
_persistent = false;
}
if (keepAlive && _persistent == Boolean.FALSE)
if (keepAlive && Boolean.FALSE.equals(_persistent))
{
field = new HttpField(HttpHeader.CONNECTION,
Stream.of(field.getValues()).filter(s -> !HttpHeaderValue.KEEP_ALIVE.is(s))
Expand Down
Expand Up @@ -785,7 +785,7 @@ private void checkSegment(String uri, int segment, int end, boolean param)
if (ambiguous != null)
{
// Is the segment intrinsically ambiguous
if (ambiguous == Boolean.TRUE)
if (Boolean.TRUE.equals(ambiguous))
_violations.add(Violation.SEGMENT);
// Is the segment ambiguous with a parameter?
if (param)
Expand Down
Expand Up @@ -259,12 +259,12 @@ public static <T1, T2> boolean matchCombined(T1 item1, IncludeExcludeSet<?, T1>
Boolean match2 = set2.isIncludedAndNotExcluded(item2);

// if we are excluded from either set, then we do not match
if (match1 == Boolean.FALSE || match2 == Boolean.FALSE)
if (Boolean.FALSE.equals(match1) || Boolean.FALSE.equals(match2))
return false;

// If either set has any includes, then we must be included by one of them
if (set1.hasIncludes() || set2.hasIncludes())
return match1 == Boolean.TRUE || match2 == Boolean.TRUE;
return Boolean.TRUE.equals(match1) || Boolean.TRUE.equals(match2);

// If not excluded and no includes, then we match
return true;
Expand Down
Expand Up @@ -742,20 +742,20 @@ static boolean combine(IncludeExcludeSet<Entry, String> names, String name, Incl
Boolean byName = names.isIncludedAndNotExcluded(name);

// If we excluded by name, then no match
if (Boolean.FALSE == byName)
if (Boolean.FALSE.equals(byName))
return false;

// check the location set
URI uri = location.get();
Boolean byLocation = uri == null ? null : locations.isIncludedAndNotExcluded(uri);

// If we excluded by location or couldn't check location exclusion, then no match
if (Boolean.FALSE == byLocation || (locations.hasExcludes() && uri == null))
if (Boolean.FALSE.equals(byLocation) || (locations.hasExcludes() && uri == null))
return false;

// If there are includes, then we must be included to match.
if (names.hasIncludes() || locations.hasIncludes())
return byName == Boolean.TRUE || byLocation == Boolean.TRUE;
return Boolean.TRUE.equals(byName) || Boolean.TRUE.equals(byLocation);

// Otherwise there are no includes and it was not excluded, so match
return true;
Expand Down

0 comments on commit dfd1e09

Please sign in to comment.