diff options
Diffstat (limited to 'holmes-actions/src/main')
-rw-r--r-- | holmes-actions/src/main/java/org/openo/holmes/common/api/stat/Alarm.java | 2 | ||||
-rw-r--r-- | holmes-actions/src/main/java/org/openo/holmes/common/producer/MQProducer.java | 6 |
2 files changed, 3 insertions, 5 deletions
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<MQConfig> mqConfigProvider;
private ConnectionFactory connectionFactory;
- public MQProducer() {
-
- }
-
public void init() {
String brokerURL =
|