Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 149734 Details for
Bug 291214
[Sync View] "Link with Editor" doesn't show current editor's input in model sync trees
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Fix v02
bug291214_20091016-extracted.txt (text/plain), 3.15 KB, created by
Tomasz Zarna
on 2009-10-16 06:43:26 EDT
(
hide
)
Description:
Fix v02
Filename:
MIME Type:
Creator:
Tomasz Zarna
Created:
2009-10-16 06:43:26 EDT
Size:
3.15 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.team.ui >Index: src/org/eclipse/team/internal/ui/synchronize/SynchronizeView.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeView.java,v >retrieving revision 1.49 >diff -u -r1.49 SynchronizeView.java >--- src/org/eclipse/team/internal/ui/synchronize/SynchronizeView.java 16 Oct 2009 10:36:43 -0000 1.49 >+++ src/org/eclipse/team/internal/ui/synchronize/SynchronizeView.java 16 Oct 2009 10:44:50 -0000 >@@ -763,44 +763,33 @@ > return fLinkingEnabled; > } > >- IElementComparer COMPARER = new IElementComparer() { >- >- public int hashCode(Object element) { >- if (element instanceof SyncInfoModelElement) { >- SyncInfoModelElement sime = (SyncInfoModelElement) element; >- IResource local = sime.getResource(); >- if (local != null && local.exists()) >- return local.hashCode(); >- IResourceVariant remote = sime.getSyncInfo().getRemote(); >- if (remote != null) >- return remote.hashCode(); >+ private static IElementComparer COMPARER = new IElementComparer() { >+ >+ private Object getContributedResourceOrResourceVariant(Object o) { >+ IResource[] resources = Utils.getContributedResources(new Object[] {o}); >+ if (resources.length>0 && resources[0].exists()) >+ return resources[0]; >+ if (o instanceof SyncInfoModelElement) { >+ SyncInfoModelElement sime = (SyncInfoModelElement) o; >+ return sime.getSyncInfo().getRemote(); > } >+ return null; >+ } >+ >+ public int hashCode(Object element) { >+ Object r = getContributedResourceOrResourceVariant(element); >+ if (r != null) >+ return r.hashCode(); > return element.hashCode(); > } > > public boolean equals(Object a, Object b) { >- // no need to check null, CustomeHashtable cannot contain null keys >- if (a instanceof SyncInfoModelElement) { >- if (b instanceof IResource) { >- IResource r1 = ((SyncInfoModelElement) a).getResource(); >- IResource r2 = (IResource) b; >- return r2.equals(r1); // r1 may be null >- } else if (b instanceof IResourceVariant) { >- IResourceVariant r1 = ((SyncInfoModelElement) a).getSyncInfo().getRemote(); >- IResourceVariant r2 = (IResourceVariant) b; >- return r2.equals(r1); // r1 may be null >- } >- } >- if (b instanceof SyncInfoModelElement) { >- if (a instanceof IResource) { >- IResource r1 = (IResource) a; >- IResource r2 = ((SyncInfoModelElement) b).getResource(); >- return r1.equals(r2); >- } else if (a instanceof IResourceVariant) { >- IResourceVariant r1 = (IResourceVariant) a; >- IResourceVariant r2 = ((SyncInfoModelElement) b).getSyncInfo().getRemote(); >- return r1.equals(r2); >- } >+ // no need to check for null, CustomeHashtable cannot contain null keys >+ if (a instanceof IResource || a instanceof IResourceVariant) { >+ b = getContributedResourceOrResourceVariant(b); >+ } else if (b instanceof IResource || b instanceof IResourceVariant) { >+ a = getContributedResourceOrResourceVariant(a); >+ return b.equals(a); // a may be null > } > return a.equals(b); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 291214
:
149727
|
149728
| 149734