mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Composite bindings should not be considered equal if their composite factories are different.
This commit is contained in:
parent
b8ce1854d4
commit
0c4c2720e2
2 changed files with 6 additions and 14 deletions
|
@ -96,15 +96,13 @@ public abstract class CompositeIndexBinding implements IIndexBinding {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object obj) {
|
public boolean equals(Object other) {
|
||||||
if (obj == this)
|
if (other == this)
|
||||||
return true;
|
return true;
|
||||||
if (obj instanceof IIndexFragmentBinding)
|
if (!(other instanceof CompositeIndexBinding))
|
||||||
return rbinding.equals(obj);
|
return false;
|
||||||
if (obj instanceof CompositeIndexBinding)
|
CompositeIndexBinding otherComposite = (CompositeIndexBinding) other;
|
||||||
return rbinding.equals(((CompositeIndexBinding) obj).rbinding);
|
return rbinding.equals(otherComposite.rbinding) && cf.equals(otherComposite.cf);
|
||||||
|
|
||||||
return super.equals(obj);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -9,13 +9,11 @@
|
||||||
* Doug Schaefer (QNX) - Initial API and implementation
|
* Doug Schaefer (QNX) - Initial API and implementation
|
||||||
* Markus Schorn (Wind River Systems)
|
* Markus Schorn (Wind River Systems)
|
||||||
* Andrew Ferguson (Symbian)
|
* Andrew Ferguson (Symbian)
|
||||||
* Sergey Prigogin (Google)
|
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.pdom.dom;
|
package org.eclipse.cdt.internal.core.pdom.dom;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.CCorePlugin;
|
import org.eclipse.cdt.core.CCorePlugin;
|
||||||
import org.eclipse.cdt.core.dom.IPDOMVisitor;
|
import org.eclipse.cdt.core.dom.IPDOMVisitor;
|
||||||
import org.eclipse.cdt.internal.core.index.composite.CompositeIndexBinding;
|
|
||||||
import org.eclipse.cdt.internal.core.pdom.PDOM;
|
import org.eclipse.cdt.internal.core.pdom.PDOM;
|
||||||
import org.eclipse.cdt.internal.core.pdom.db.Database;
|
import org.eclipse.cdt.internal.core.pdom.db.Database;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
|
@ -103,10 +101,6 @@ public abstract class PDOMNode implements IInternalPDOMNode {
|
||||||
public final boolean equals(Object obj) {
|
public final boolean equals(Object obj) {
|
||||||
if (obj == this)
|
if (obj == this)
|
||||||
return true;
|
return true;
|
||||||
// For symmetry with CompositeIndexBinding.equals(Object)
|
|
||||||
if (obj instanceof CompositeIndexBinding) {
|
|
||||||
obj = ((CompositeIndexBinding) obj).getRawBinding();
|
|
||||||
}
|
|
||||||
if (obj instanceof PDOMNode) {
|
if (obj instanceof PDOMNode) {
|
||||||
PDOMNode other = (PDOMNode) obj;
|
PDOMNode other = (PDOMNode) obj;
|
||||||
return getPDOM() == other.getPDOM() && record == other.record;
|
return getPDOM() == other.getPDOM() && record == other.record;
|
||||||
|
|
Loading…
Add table
Reference in a new issue