code compares Long values with == which will work for Long cached values

Fixed by switch to use .equals

Signed-off-by: Prasanna Santhanam <t...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/49faa002
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/49faa002
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/49faa002

Branch: refs/heads/vmsync
Commit: 49faa002e220311f10a5f99993fad66a22836dad
Parents: 45d2e60
Author: Dave Brosius <dbros...@mebigfatguy.com>
Authored: Tue May 21 11:45:10 2013 +0530
Committer: Prasanna Santhanam <t...@apache.org>
Committed: Tue May 21 11:45:10 2013 +0530

----------------------------------------------------------------------
 .../subsystem/api/storage/AbstractScope.java       |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/49faa002/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/AbstractScope.java
----------------------------------------------------------------------
diff --git 
a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/AbstractScope.java
 
b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/AbstractScope.java
index c94db66..083b1fe 100644
--- 
a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/AbstractScope.java
+++ 
b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/AbstractScope.java
@@ -21,10 +21,6 @@ package org.apache.cloudstack.engine.subsystem.api.storage;
 public abstract class AbstractScope implements Scope {
     @Override
     public boolean isSameScope(Scope scope) {
-        if (this.getScopeType() == scope.getScopeType() && this.getScopeId() 
== scope.getScopeId()) {
-            return true;
-        } else {
-            return false;
-        }
+        return this.getScopeType() == scope.getScopeType() && 
this.getScopeId().equals(scope.getScopeId());
     }
 }

Reply via email to