You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2016/04/11 22:53:57 UTC

[1/2] activemq-artemis git commit: This closes #452

Repository: activemq-artemis
Updated Branches:
  refs/heads/master c2d51c07f -> 038efc60d


This closes #452


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/038efc60
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/038efc60
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/038efc60

Branch: refs/heads/master
Commit: 038efc60d23434a8e50b05ccae05b4c244e60459
Parents: c2d51c0 cf00dd9
Author: Clebert Suconic <cl...@apache.org>
Authored: Mon Apr 11 16:53:48 2016 -0400
Committer: Clebert Suconic <cl...@apache.org>
Committed: Mon Apr 11 16:53:48 2016 -0400

----------------------------------------------------------------------
 .../activemq/artemis/utils/json/JSONArray.java  |  4 ++--
 .../activemq/artemis/utils/json/JSONObject.java |  2 +-
 .../selector/filter/ArithmeticExpression.java   | 22 ++++++++++----------
 3 files changed, 14 insertions(+), 14 deletions(-)
----------------------------------------------------------------------



[2/2] activemq-artemis git commit: Avoid instantiating some number objects

Posted by cl...@apache.org.
Avoid instantiating some number objects


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/cf00dd9b
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/cf00dd9b
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/cf00dd9b

Branch: refs/heads/master
Commit: cf00dd9b1b8738c816bd48da8322bf27b87a70cc
Parents: c2d51c0
Author: Ville Skyttä <vi...@iki.fi>
Authored: Sun Apr 10 12:46:05 2016 +0300
Committer: Clebert Suconic <cl...@apache.org>
Committed: Mon Apr 11 16:53:48 2016 -0400

----------------------------------------------------------------------
 .../activemq/artemis/utils/json/JSONArray.java  |  4 ++--
 .../activemq/artemis/utils/json/JSONObject.java |  2 +-
 .../selector/filter/ArithmeticExpression.java   | 22 ++++++++++----------
 3 files changed, 14 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/cf00dd9b/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/json/JSONArray.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/json/JSONArray.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/json/JSONArray.java
index b70bd21..0b8fd0c 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/json/JSONArray.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/json/JSONArray.java
@@ -606,7 +606,7 @@ public class JSONArray {
     * @throws JSONException if the value is not finite.
     */
    public JSONArray put(final double value) throws JSONException {
-      Double d = new Double(value);
+      Double d = Double.valueOf(value);
       JSONObject.testValidity(d);
       put(d);
       return this;
@@ -701,7 +701,7 @@ public class JSONArray {
     *                       not finite.
     */
    public JSONArray put(final int index, final double value) throws JSONException {
-      put(index, new Double(value));
+      put(index, Double.valueOf(value));
       return this;
    }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/cf00dd9b/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/json/JSONObject.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/json/JSONObject.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/json/JSONObject.java
index c23f7ee..ad9af03 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/json/JSONObject.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/json/JSONObject.java
@@ -978,7 +978,7 @@ public class JSONObject {
     * @throws JSONException If the key is null or if the number is invalid.
     */
    public JSONObject put(final String key, final double value) throws JSONException {
-      put(key, new Double(value));
+      put(key, Double.valueOf(value));
       return this;
    }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/cf00dd9b/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/ArithmeticExpression.java
----------------------------------------------------------------------
diff --git a/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/ArithmeticExpression.java b/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/ArithmeticExpression.java
index 7ce277b..3cff711 100755
--- a/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/ArithmeticExpression.java
+++ b/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/ArithmeticExpression.java
@@ -120,42 +120,42 @@ public abstract class ArithmeticExpression extends BinaryExpression {
    protected Number plus(Number left, Number right) {
       switch (numberType(left, right)) {
          case INTEGER:
-            return new Integer(left.intValue() + right.intValue());
+            return left.intValue() + right.intValue();
          case LONG:
-            return new Long(left.longValue() + right.longValue());
+            return left.longValue() + right.longValue();
          default:
-            return new Double(left.doubleValue() + right.doubleValue());
+            return left.doubleValue() + right.doubleValue();
       }
    }
 
    protected Number minus(Number left, Number right) {
       switch (numberType(left, right)) {
          case INTEGER:
-            return new Integer(left.intValue() - right.intValue());
+            return left.intValue() - right.intValue();
          case LONG:
-            return new Long(left.longValue() - right.longValue());
+            return left.longValue() - right.longValue();
          default:
-            return new Double(left.doubleValue() - right.doubleValue());
+            return left.doubleValue() - right.doubleValue();
       }
    }
 
    protected Number multiply(Number left, Number right) {
       switch (numberType(left, right)) {
          case INTEGER:
-            return new Integer(left.intValue() * right.intValue());
+            return left.intValue() * right.intValue();
          case LONG:
-            return new Long(left.longValue() * right.longValue());
+            return left.longValue() * right.longValue();
          default:
-            return new Double(left.doubleValue() * right.doubleValue());
+            return left.doubleValue() * right.doubleValue();
       }
    }
 
    protected Number divide(Number left, Number right) {
-      return new Double(left.doubleValue() / right.doubleValue());
+      return left.doubleValue() / right.doubleValue();
    }
 
    protected Number mod(Number left, Number right) {
-      return new Double(left.doubleValue() % right.doubleValue());
+      return left.doubleValue() % right.doubleValue();
    }
 
    private int numberType(Number left, Number right) {