Optimise - Is a tiny faster as the extra add is not needed as we dont use the returned value.
Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/ba7eee50 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/ba7eee50 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/ba7eee50 Branch: refs/heads/master Commit: ba7eee50f55170f719861f94b0f84b83d89d313a Parents: 1e1bae9 Author: Claus Ibsen <davscl...@apache.org> Authored: Sat Jun 24 23:00:00 2017 +0200 Committer: Claus Ibsen <davscl...@apache.org> Committed: Sat Jun 24 23:00:00 2017 +0200 ---------------------------------------------------------------------- .../java/org/apache/camel/management/mbean/StatisticCounter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/ba7eee50/camel-core/src/main/java/org/apache/camel/management/mbean/StatisticCounter.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/management/mbean/StatisticCounter.java b/camel-core/src/main/java/org/apache/camel/management/mbean/StatisticCounter.java index 27620c7..e2e3839 100644 --- a/camel-core/src/main/java/org/apache/camel/management/mbean/StatisticCounter.java +++ b/camel-core/src/main/java/org/apache/camel/management/mbean/StatisticCounter.java @@ -23,7 +23,7 @@ public class StatisticCounter extends Statistic { private final AtomicLong value = new AtomicLong(0); public void updateValue(long newValue) { - value.addAndGet(newValue); + value.getAndAdd(newValue); } public long getValue() {