shulieTech / Takin

Takin is an Java-based, open-source system designed to measure online environmental performance test for full-links, Especially for microservices. Through Takin, middlewares and applications can identify real online traffic and test traffic, ensure that they enter the right databases.
Apache License 2.0
1.32k stars 330 forks source link

在开启压测任务的时候,对监听器方法排序的时候,比较器内的compare方法出错误 #29

Open lishun888 opened 3 years ago

lishun888 commented 3 years ago

、、、 public void doEvents(Event event) { Map<String,ListenerContainer.Listener> map = listenerContainer.getListeners().get(event.getEventName()); List list = new ArrayList(map.values()); Collections.sort(list, new Comparator() { @Override public int compare(ListenerContainer.Listener o1, ListenerContainer.Listener o2) { return o1.getIntrestFor().order() > o1.getIntrestFor().order() ? 1 : -1; }

        @Override
        public boolean equals(Object obj) {
            return false;
        }
    });
    for (ListenerContainer.Listener entry : list) {
        try {
            entry.getMethod().invoke(entry.getObject(), event);
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        } catch (InvocationTargetException e) {
            e.printStackTrace();
        }
    }
}

、、、

shulieTech commented 3 years ago

下周会发布一个全新的版本,感谢反馈。

pirateskipper commented 3 years ago

good!

zhaoyong6315 commented 3 years ago

目前更新新版本,这个问题还有再出现吗?