This is an automated email from the ASF dual-hosted git repository.

songxiaosheng pushed a commit to branch 3.2
in repository https://gitbox.apache.org/repos/asf/dubbo.git


The following commit(s) were added to refs/heads/3.2 by this push:
     new e887bab83b remove unuse code (#13036)
e887bab83b is described below

commit e887bab83b3582351a92b8a893610a46545517b8
Author: wxbty <38374721+wx...@users.noreply.github.com>
AuthorDate: Tue Sep 12 20:21:38 2023 +0800

    remove unuse code (#13036)
    
    Co-authored-by: songxiaosheng <songxiaosh...@elastic.link>
---
 .../org/apache/dubbo/metrics/event/EmptyEvent.java | 36 ----------------------
 .../event/SimpleMetricsEventMulticaster.java       |  7 -----
 .../event/SimpleMetricsEventMulticasterTest.java   | 10 ------
 3 files changed, 53 deletions(-)

diff --git 
a/dubbo-metrics/dubbo-metrics-api/src/main/java/org/apache/dubbo/metrics/event/EmptyEvent.java
 
b/dubbo-metrics/dubbo-metrics-api/src/main/java/org/apache/dubbo/metrics/event/EmptyEvent.java
deleted file mode 100644
index 70c9764dd3..0000000000
--- 
a/dubbo-metrics/dubbo-metrics-api/src/main/java/org/apache/dubbo/metrics/event/EmptyEvent.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.dubbo.metrics.event;
-
-import org.apache.dubbo.rpc.model.ApplicationModel;
-
-/**
- * EmptyEvent, do nothing.
- */
-public class EmptyEvent extends MetricsEvent {
-
-    private static final EmptyEvent empty = new EmptyEvent(null);
-
-    private EmptyEvent(ApplicationModel source) {
-        super(source, null);
-    }
-
-    public static EmptyEvent instance() {
-        return empty;
-    }
-}
diff --git 
a/dubbo-metrics/dubbo-metrics-api/src/main/java/org/apache/dubbo/metrics/event/SimpleMetricsEventMulticaster.java
 
b/dubbo-metrics/dubbo-metrics-api/src/main/java/org/apache/dubbo/metrics/event/SimpleMetricsEventMulticaster.java
index a88745ca46..ed172de6ee 100644
--- 
a/dubbo-metrics/dubbo-metrics-api/src/main/java/org/apache/dubbo/metrics/event/SimpleMetricsEventMulticaster.java
+++ 
b/dubbo-metrics/dubbo-metrics-api/src/main/java/org/apache/dubbo/metrics/event/SimpleMetricsEventMulticaster.java
@@ -40,10 +40,6 @@ public class SimpleMetricsEventMulticaster implements 
MetricsEventMulticaster {
     @Override
     @SuppressWarnings({"rawtypes", "unchecked"})
     public void publishEvent(MetricsEvent event) {
-        if (event instanceof EmptyEvent) {
-            return;
-        }
-
         if (validateIfApplicationConfigExist(event)) return;
         for (MetricsListener listener : listeners) {
             if (listener.isSupport(event)) {
@@ -75,9 +71,6 @@ public class SimpleMetricsEventMulticaster implements 
MetricsEventMulticaster {
     @SuppressWarnings({"rawtypes"})
     private void publishTimeEvent(MetricsEvent event, 
Consumer<MetricsLifeListener> consumer) {
         if (validateIfApplicationConfigExist(event)) return;
-        if (event instanceof EmptyEvent) {
-            return;
-        }
         if (event instanceof TimeCounterEvent) {
             ((TimeCounterEvent) event).getTimePair().end();
         }
diff --git 
a/dubbo-metrics/dubbo-metrics-api/src/test/java/org/apache/dubbo/metrics/event/SimpleMetricsEventMulticasterTest.java
 
b/dubbo-metrics/dubbo-metrics-api/src/test/java/org/apache/dubbo/metrics/event/SimpleMetricsEventMulticasterTest.java
index 1e3b2f4c56..ef2e173994 100644
--- 
a/dubbo-metrics/dubbo-metrics-api/src/test/java/org/apache/dubbo/metrics/event/SimpleMetricsEventMulticasterTest.java
+++ 
b/dubbo-metrics/dubbo-metrics-api/src/test/java/org/apache/dubbo/metrics/event/SimpleMetricsEventMulticasterTest.java
@@ -58,16 +58,6 @@ public class SimpleMetricsEventMulticasterTest {
     }
 
 
-    @Test
-    void testPublishEvent() {
-
-        // emptyEvent do nothing
-        MetricsEvent emptyEvent = EmptyEvent.instance();
-        eventMulticaster.publishEvent(emptyEvent);
-        Assertions.assertSame(obj, objects[0]);
-
-    }
-
     @Test
     void testPublishFinishEvent() {
 

Reply via email to