From 9fcfaa6fcd8854afeab4b71962f773693ff7c3b7 Mon Sep 17 00:00:00 2001 From: FengLiang Date: Thu, 9 Mar 2017 09:45:09 +0800 Subject: Modify restructure Change-Id: Ia5ffd78bf9a0b2dc0339d198362fc1e1bde7c93c Issue-ID:HOLMES-51 Signed-off-by: FengLiang --- .../src/main/java/org/openo/holmes/common/api/stat/Alarm.java | 2 +- .../src/main/java/org/openo/holmes/common/producer/MQProducer.java | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'holmes-actions/src/main') diff --git a/holmes-actions/src/main/java/org/openo/holmes/common/api/stat/Alarm.java b/holmes-actions/src/main/java/org/openo/holmes/common/api/stat/Alarm.java index 3ea3715..c12b549 100644 --- a/holmes-actions/src/main/java/org/openo/holmes/common/api/stat/Alarm.java +++ b/holmes-actions/src/main/java/org/openo/holmes/common/api/stat/Alarm.java @@ -201,7 +201,7 @@ public class Alarm implements AplusData, Cloneable, Serializable { @Override public boolean equals(Object arg0) { - if (arg0 == null) { + if (arg0 == null || !(arg0 instanceof Alarm)) { return false; } return this.alarmKey.equals(((Alarm) arg0).getAlarmKey()); diff --git a/holmes-actions/src/main/java/org/openo/holmes/common/producer/MQProducer.java b/holmes-actions/src/main/java/org/openo/holmes/common/producer/MQProducer.java index 0de1289..d258695 100644 --- a/holmes-actions/src/main/java/org/openo/holmes/common/producer/MQProducer.java +++ b/holmes-actions/src/main/java/org/openo/holmes/common/producer/MQProducer.java @@ -24,6 +24,7 @@ import javax.jms.JMSException; import javax.jms.MessageProducer; import javax.jms.ObjectMessage; import javax.jms.Session; +import lombok.NoArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.glassfish.hk2.api.IterableProvider; import org.jvnet.hk2.annotations.Service; @@ -36,16 +37,13 @@ import org.apache.activemq.ActiveMQConnectionFactory; @Service @Slf4j +@NoArgsConstructor public class MQProducer { @Inject private IterableProvider mqConfigProvider; private ConnectionFactory connectionFactory; - public MQProducer() { - - } - public void init() { String brokerURL = -- cgit 1.2.3-korg