diff --git a/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/admin/handler/RegistryHandler.java b/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/admin/handler/RegistryHandler.java index 94a361766b..8c90266144 100755 --- a/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/admin/handler/RegistryHandler.java +++ b/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/admin/handler/RegistryHandler.java @@ -83,7 +83,7 @@ void get(HttpExchange httpExchange) throws IOException { ); getRegistryResponseList.add(getRegistryResponse); } - getRegistryResponseList.sort(Comparator.comparing(lhs -> lhs.getEventMeshClusterName())); + getRegistryResponseList.sort(Comparator.comparing(GetRegistryResponse::getEventMeshClusterName)); String result = JsonUtils.toJSONString(getRegistryResponseList); httpExchange.sendResponseHeaders(200, result.getBytes().length); @@ -117,10 +117,10 @@ void get(HttpExchange httpExchange) throws IOException { @Override public void handle(HttpExchange httpExchange) throws IOException { - if (httpExchange.getRequestMethod().equals("OPTION")) { + if ("OPTION".equals(httpExchange.getRequestMethod())) { preflight(httpExchange); } - if (httpExchange.getRequestMethod().equals("GET")) { + if ("GET".equals(httpExchange.getRequestMethod())) { get(httpExchange); } }