You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by mi...@apache.org on 2019/04/29 10:27:20 UTC
[activemq-artemis] 03/05: ARTEMIS-2320 Fix BadComparable errorprone
warning
This is an automated email from the ASF dual-hosted git repository.
michaelpearce pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git
commit d076d1ca594202af5a96e1fbb65b69d1b26194e8
Author: Jiri Danek <jd...@redhat.com>
AuthorDate: Thu Apr 25 16:08:53 2019 +0200
ARTEMIS-2320 Fix BadComparable errorprone warning
Possible sign flip from narrowing conversion
(see https://errorprone.info/bugpattern/BadComparable)
---
.../artemis/core/management/impl/ActiveMQServerControlImpl.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
index db34645..b19a0b9 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
@@ -1641,7 +1641,7 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active
@Override
public int compare(final Entry<Xid, Long> entry1, final Entry<Xid, Long> entry2) {
// sort by creation time, oldest first
- return (int) (entry1.getValue() - entry2.getValue());
+ return entry1.getValue().compareTo(entry2.getValue());
}
});
String[] s = new String[xidsSortedByCreationTime.size()];
@@ -1680,7 +1680,7 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active
@Override
public int compare(final Entry<Xid, Long> entry1, final Entry<Xid, Long> entry2) {
// sort by creation time, oldest first
- return (int) (entry1.getValue() - entry2.getValue());
+ return entry1.getValue().compareTo(entry2.getValue());
}
});
@@ -1727,7 +1727,7 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active
@Override
public int compare(final Entry<Xid, Long> entry1, final Entry<Xid, Long> entry2) {
// sort by creation time, oldest first
- return (int) (entry1.getValue() - entry2.getValue());
+ return entry1.getValue().compareTo(entry2.getValue());
}
});