Skip to content

Commit

Permalink
remove usage of StringUtil
Browse files Browse the repository at this point in the history
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
  • Loading branch information
lachlan-roberts committed May 14, 2024
1 parent cb51f94 commit f48c889
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import com.google.common.base.Preconditions;
import com.google.common.html.HtmlEscapers;
import com.google.common.net.HttpHeaders;
import org.eclipse.jetty.util.StringUtil;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
Expand Down Expand Up @@ -730,7 +729,7 @@ public void sendError(int sc, String msg) throws IOException {
checkNotCommitted();
// This has to be re-implemented to avoid committing the response.
setStatus(sc, msg);
setErrorBody(sc + " " + (StringUtil.isEmpty(msg) ? "" : HtmlEscapers.htmlEscaper().escape(msg)));
setErrorBody(sc + " " + (msg == null ? "" : HtmlEscapers.htmlEscaper().escape(msg)));
}

/** Sets the response body to an HTML page with an error message.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import jakarta.servlet.http.HttpServletRequestWrapper;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletResponseWrapper;
import org.eclipse.jetty.util.StringUtil;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
Expand Down Expand Up @@ -731,7 +730,7 @@ public void sendError(int sc, String msg) throws IOException {
checkNotCommitted();
// This has to be re-implemented to avoid committing the response.
setStatus(sc);
setErrorBody(sc + " " + (StringUtil.isEmpty(msg) ? "" : HtmlEscapers.htmlEscaper().escape(msg)));
setErrorBody(sc + " " + (msg == null ? "" : HtmlEscapers.htmlEscaper().escape(msg)));
}

/** Sets the response body to an HTML page with an error message.
Expand Down

0 comments on commit f48c889

Please sign in to comment.