Integer instantation removed Two Integer object was created for each comparison, just in order to compare the two values. This is replaced with Integer.compare()
Signed-off-by: Laszlo Hornyak <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/b4e972da Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/b4e972da Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/b4e972da Branch: refs/heads/master Commit: b4e972da035e1de36c154da396c06de11960501a Parents: 7edb4d3 Author: Laszlo Hornyak <[email protected]> Authored: Wed Oct 23 19:33:48 2013 +0200 Committer: Laszlo Hornyak <[email protected]> Committed: Wed Oct 23 20:50:00 2013 +0200 ---------------------------------------------------------------------- .../engine/subsystem/api/storage/StrategyPriority.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b4e972da/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/StrategyPriority.java ---------------------------------------------------------------------- diff --git a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/StrategyPriority.java b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/StrategyPriority.java index 81034b1..e930d10 100644 --- a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/StrategyPriority.java +++ b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/StrategyPriority.java @@ -57,7 +57,7 @@ public class StrategyPriority { public int compare(SnapshotStrategy o1, SnapshotStrategy o2) { int i1 = o1.canHandle(snapshot).ordinal(); int i2 = o2.canHandle(snapshot).ordinal(); - return new Integer(i2).compareTo(new Integer(i1)); + return Integer.compare(i2, i1); } } @@ -74,7 +74,7 @@ public class StrategyPriority { public int compare(DataMotionStrategy o1, DataMotionStrategy o2) { int i1 = o1.canHandle(srcData, destData).ordinal(); int i2 = o2.canHandle(srcData, destData).ordinal(); - return new Integer(i2).compareTo(new Integer(i1)); + return Integer.compare(i2, i1); } } @@ -93,7 +93,7 @@ public class StrategyPriority { public int compare(DataMotionStrategy o1, DataMotionStrategy o2) { int i1 = o1.canHandle(volumeMap, srcHost, destHost).ordinal(); int i2 = o2.canHandle(volumeMap, srcHost, destHost).ordinal(); - return new Integer(i2).compareTo(new Integer(i1)); + return Integer.compare(i2, i1); } } }
