Skip to content

Commit

Permalink
Fixes #10760 - Remove StringUtil.equals
Browse files Browse the repository at this point in the history
  • Loading branch information
joakime committed Oct 24, 2023
1 parent 82aea42 commit 16dea21
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -259,23 +259,6 @@ public static boolean asciiEqualsIgnoreCase(String string, String other)
return true;
}

/**
* Check for string equality.
* @param string The string to check
* @param other The other string to check
* @return true if the strings are equal.
*/
public static boolean equals(String string, String other)
{
if (string == null)
return other == null;

if (other == null)
return false;

return string.equals(other);
}

/**
* Check for a string prefix, ignoring {@link StandardCharsets#US_ASCII} case differences.
* @param string The string to check
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Objects;

import org.eclipse.jetty.util.IO;
import org.eclipse.jetty.util.StringUtil;
Expand Down Expand Up @@ -97,7 +98,7 @@ public boolean contains(Resource other)
return false;

// Different authorities? not a valid contains() check
if (!StringUtil.equals(thisURI.getAuthority(), otherURI.getAuthority()))
if (!Objects.equals(thisURI.getAuthority(), otherURI.getAuthority()))
return false;

// Ensure that if `file` scheme is used, it's using a consistent convention to allow for startsWith check
Expand Down

0 comments on commit 16dea21

Please sign in to comment.