mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-08 18:26:01 +02:00
Model builder running in UI-thread, partial fix for 238940.
This commit is contained in:
parent
4fbf9e4dc7
commit
2b164faf3e
1 changed files with 3 additions and 12 deletions
|
@ -10,10 +10,11 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.ui.cview;
|
package org.eclipse.cdt.internal.ui.cview;
|
||||||
|
|
||||||
|
import org.eclipse.jface.viewers.IElementComparer;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.model.ICElement;
|
import org.eclipse.cdt.core.model.ICElement;
|
||||||
import org.eclipse.cdt.core.model.ITranslationUnit;
|
import org.eclipse.cdt.core.model.ITranslationUnit;
|
||||||
import org.eclipse.cdt.core.model.IWorkingCopy;
|
import org.eclipse.cdt.core.model.IWorkingCopy;
|
||||||
import org.eclipse.jface.viewers.IElementComparer;
|
|
||||||
|
|
||||||
public class CViewElementComparer implements IElementComparer {
|
public class CViewElementComparer implements IElementComparer {
|
||||||
|
|
||||||
|
@ -55,16 +56,6 @@ public class CViewElementComparer implements IElementComparer {
|
||||||
}
|
}
|
||||||
|
|
||||||
public int hashCode(Object o1) {
|
public int hashCode(Object o1) {
|
||||||
ICElement c1= (o1 instanceof ICElement) ? (ICElement)o1 : null;
|
return o1.hashCode();
|
||||||
if (c1 == null)
|
|
||||||
return o1.hashCode();
|
|
||||||
ITranslationUnit u1= (ITranslationUnit)c1.getAncestor(ICElement.C_UNIT);
|
|
||||||
if (u1 == null || !u1.isWorkingCopy())
|
|
||||||
return o1.hashCode();
|
|
||||||
// From here on c1 is a working copy.
|
|
||||||
c1= ((IWorkingCopy)u1).getOriginal(c1);
|
|
||||||
if (c1 == null)
|
|
||||||
return o1.hashCode();
|
|
||||||
return c1.hashCode();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue