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 63833 Details for
Bug 182454
ISystemViewElementAdapter.getAbsoluteName() must be clearly documented
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch removing the return of the element adapters hashcode
bugzilla182454_SystemView_IElementComparer.patch (text/plain), 5.32 KB, created by
Uwe Stieber
on 2007-04-15 09:06:16 EDT
(
hide
)
Description:
Patch removing the return of the element adapters hashcode
Filename:
MIME Type:
Creator:
Uwe Stieber
Created:
2007-04-15 09:06:16 EDT
Size:
5.32 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.rse.ui >Index: UI/org/eclipse/rse/internal/ui/view/SystemView.java >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemView.java,v >retrieving revision 1.90 >diff -u -r1.90 SystemView.java >--- UI/org/eclipse/rse/internal/ui/view/SystemView.java 4 Apr 2007 13:45:20 -0000 1.90 >+++ UI/org/eclipse/rse/internal/ui/view/SystemView.java 15 Apr 2007 13:03:45 -0000 >@@ -384,55 +384,61 @@ > _setList = new ArrayList(); > busyCursor = new Cursor(shell.getDisplay(), SWT.CURSOR_WAIT); > >- setUseHashlookup(true); // new for our 2nd release. Attempt to fix 38 minutes to refresh for 15K elements >- setComparer(new IElementComparer() >- { >- public boolean equals(Object a, Object b) >- { >- if(a==b) return true; >- if(a==null || b==null) return false; >- if(a.equals(b)) return true; >- >- ISystemViewElementAdapter identa= null; >- if(a instanceof IAdaptable) { >- identa = (ISystemViewElementAdapter) >- ((IAdaptable)a).getAdapter(ISystemViewElementAdapter.class); >- } >- if(identa != null) { >- ISystemViewElementAdapter identb = null; >- if(b instanceof IAdaptable) { >- identb = (ISystemViewElementAdapter) >- ((IAdaptable)b).getAdapter(ISystemViewElementAdapter.class); >- } >- if (identb != null){ >- if(identa.getAbsoluteName(a).equals(identb.getAbsoluteName(b))) return true; >- } >- } >- >- return false; >- } >- >- public int hashCode(Object element) >- { >- ISystemViewElementAdapter ident=null; >- if(element instanceof IAdaptable) { >- ident = (ISystemViewElementAdapter) >- ((IAdaptable)element).getAdapter(ISystemViewElementAdapter.class); >- if(ident!=null) { >- String absName = ident.getAbsoluteName(element); >- if(absName!=null) return absName.hashCode(); >- return ident.hashCode(); >- } >- } >- if (element != null) // adding check because I hit a null exception here once at startup >- return element.hashCode(); >- else >- { >- //System.out.println("null element"); >- return 0; >- } >- } >- }); >+ // new for our 2nd release. Attempt to fix 38 minutes to refresh for 15K elements >+ setUseHashlookup(true); >+ setComparer(new IElementComparer() { >+ /* (non-Javadoc) >+ * @see org.eclipse.jface.viewers.IElementComparer#equals(java.lang.Object, java.lang.Object) >+ */ >+ public boolean equals(Object a, Object b) { >+ if (a == b) return true; >+ if (a == null || b == null) return false; >+ if (a.equals(b)) return true; >+ >+ ISystemViewElementAdapter identa = null; >+ if (a instanceof IAdaptable) { >+ identa = (ISystemViewElementAdapter)((IAdaptable)a).getAdapter(ISystemViewElementAdapter.class); >+ } >+ if (identa != null) { >+ ISystemViewElementAdapter identb = null; >+ if (b instanceof IAdaptable) { >+ identb = (ISystemViewElementAdapter)((IAdaptable)b).getAdapter(ISystemViewElementAdapter.class); >+ } >+ if (identb != null) { >+ if (identa.getAbsoluteName(a).equals(identb.getAbsoluteName(b))) >+ return true; >+ } >+ } >+ >+ return false; >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.jface.viewers.IElementComparer#hashCode(java.lang.Object) >+ */ >+ public int hashCode(Object element) { >+ ISystemViewElementAdapter ident = null; >+ if (element instanceof IAdaptable) { >+ ident = (ISystemViewElementAdapter)((IAdaptable)element).getAdapter(ISystemViewElementAdapter.class); >+ if (ident != null) { >+ String absName = ident.getAbsoluteName(element); >+ if (absName != null) { >+ //System.err.println("hashCode: " + absName.hashCode() + " [" + absName + " (" + element.toString() + ")]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ >+ return absName.hashCode(); >+ } >+ } >+ } >+ >+ // adding check because I hit a null exception here once at startup >+ if (element != null) { >+ //System.err.println("hashCode: " + element.hashCode() + " [" + element.getClass().getName() + " (" + element.toString() + ")]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ >+ return element.hashCode(); >+ } else { >+ //System.err.println("hashCode: 0 [null element]"); //$NON-NLS-1$ >+ return 0; >+ } >+ } >+ }); > > > // set content provider >@@ -3120,7 +3126,11 @@ > while (i.hasNext()) { > Object element = i.next(); > if (parentElement == null) { >- parentItem = getParentItem((Item) findItem(element)); >+ Item item = (Item) findItem(element); >+ if (item == null) { >+ findItem(element); >+ } >+ parentItem = getParentItem(item); > if ((parentItem != null) && (parentItem instanceof Item)) parentElement = ((Item) parentItem).getData(); > } > if (getViewAdapter(element) != null) {
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 182454
:
63833
|
63902