You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@eventmesh.apache.org by jo...@apache.org on 2023/02/23 01:05:36 UTC
[incubator-eventmesh] branch master updated: [ISSUE #2998] literal string comparison changed in 4 lines (#3236)
This is an automated email from the ASF dual-hosted git repository.
jonyang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-eventmesh.git
The following commit(s) were added to refs/heads/master by this push:
new c68fa8cd2 [ISSUE #2998] literal string comparison changed in 4 lines (#3236)
c68fa8cd2 is described below
commit c68fa8cd2c62dd45ff598772f82624b2d8a4162e
Author: Chelsea <88...@users.noreply.github.com>
AuthorDate: Thu Feb 23 06:35:31 2023 +0530
[ISSUE #2998] literal string comparison changed in 4 lines (#3236)
---
.../org/apache/eventmesh/runtime/admin/handler/EventHandler.java | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/admin/handler/EventHandler.java b/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/admin/handler/EventHandler.java
index 238d1e329..ec8495321 100644
--- a/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/admin/handler/EventHandler.java
+++ b/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/admin/handler/EventHandler.java
@@ -104,7 +104,7 @@ public class EventHandler extends AbstractHttpHandler {
try (OutputStream out = httpExchange.getResponseBody()) {
String queryString = httpExchange.getRequestURI().getQuery();
- if (queryString == null || queryString.equals("")) {
+ if (queryString == null || "".equals(queryString)) {
httpExchange.sendResponseHeaders(401, 0);
out.close();
return;
@@ -181,13 +181,13 @@ public class EventHandler extends AbstractHttpHandler {
@Override
public void handle(HttpExchange httpExchange) throws IOException {
- if (httpExchange.getRequestMethod().equals("OPTIONS")) {
+ if ("OPTIONS".equals(httpExchange.getRequestMethod())) {
preflight(httpExchange);
}
- if (httpExchange.getRequestMethod().equals("POST")) {
+ if ("POST".equals(httpExchange.getRequestMethod())) {
post(httpExchange);
}
- if (httpExchange.getRequestMethod().equals("GET")) {
+ if ("GET".equals(httpExchange.getRequestMethod())) {
get(httpExchange);
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: commits-help@eventmesh.apache.org