Update of /cvsroot/sblim/jsr48-client/src/javax/cim
In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv26892/src/javax/cim
Modified Files:
CIMObjectPath.java
Log Message:
2660 CIMObjectPath.equalsModelPath same as equals
Index: CIMObjectPath.java
===================================================================
RCS file: /cvsroot/sblim/jsr48-client/src/javax/cim/CIMObjectPath.java,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- CIMObjectPath.java 6 Sep 2012 19:12:24 -0000 1.33
+++ CIMObjectPath.java 12 Sep 2013 14:18:29 -0000 1.34
@@ -1,5 +1,5 @@
/**
- * (C) Copyright IBM Corp. 2006, 2012
+ * (C) Copyright IBM Corp. 2006, 2013
*
* THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
* ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
@@ -33,6 +33,7 @@
* 3521131 2012-04-24 blaschke-oss Sync up javax.* javadoc with JSR48 1.0.0 Final II
* 3521119 2012-04-24 blaschke-oss JSR48 1.0.0: remove CIMObjectPath 2/3/4-parm ctors
* 3529151 2012-08-22 blaschke-oss TCK: CIMInstance property APIs include keys from COP
+ * 2660 2013-09-04 blaschke-oss CIMObjectPath.equalsModelPath same as equals
*/
package javax.cim;
@@ -419,14 +420,22 @@
*/
@Override
public boolean equals(Object pObj) {
+ return equalsWorker(pObj, true);
+ }
+
+ private boolean equalsWorker(Object pObj, boolean pIncludeNamespacePath) {
if (!(pObj instanceof CIMObjectPath)) return false;
CIMObjectPath that = (CIMObjectPath) pObj;
// hostname information is not any longer part of the comparison, since
// there is no reliable way to attach hostnames
- return (this.iNamespace == null ? that.iNamespace == null : this.iNamespace
- .equalsIgnoreCase(that.iNamespace))
- && (this.iObjectName == null ? that.iObjectName == null : this.iObjectName
- .equalsIgnoreCase(that.iObjectName)) && keysEqual(that);
+ if (pIncludeNamespacePath) {
+ boolean namespaceEqual = (this.iNamespace == null ? that.iNamespace == null
+ : this.iNamespace.equalsIgnoreCase(that.iNamespace));
+ if (!namespaceEqual) return false;
+ }
+ return (this.iObjectName == null ? that.iObjectName == null : this.iObjectName
+ .equalsIgnoreCase(that.iObjectName))
+ && keysEqual(that);
}
/**
@@ -513,8 +522,7 @@
* object, otherwise <code>false</code>.
*/
public boolean equalsModelPath(CIMObjectPath pModelPath) {
- // FIXME: what should this function do?
- return equals(pModelPath);
+ return equalsWorker(pModelPath, false);
}
/**
|