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 261910 Details for
Bug 439299
[Import/Export] Expanded Export Wizard with sub-categories auto-collapses
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Patch including equals() and hashCode() implementations for WizardCollectionElement class
WCE_equals_hashCode_439299.patch (text/plain), 2.80 KB, created by
Craig Otis
on 2016-05-20 15:28:45 EDT
(
hide
)
Description:
Patch including equals() and hashCode() implementations for WizardCollectionElement class
Filename:
MIME Type:
Creator:
Craig Otis
Created:
2016-05-20 15:28:45 EDT
Size:
2.80 KB
patch
obsolete
>From b0d5cfee9dbbd164a7c3bdf933453b4b949c2f76 Mon Sep 17 00:00:00 2001 >From: Craig Otis <craigotis@gmail.com> >Date: Fri, 20 May 2016 15:25:17 -0400 >Subject: [PATCH] Implements the equals() and hashCode() methods of > WizardCollectionElement, comparing/including the id, pluginId, and name > properties of the instances. > >This alleviates a bug (439299) in which WCE instances were being refreshed >in a TreeViewer, and due to the lack of these implementations, were not >maintaining their collapsed/expanded status. > >Signed-off-by: Craig Otis <craigotis@gmail.com> >--- > .../internal/dialogs/WizardCollectionElement.java | 36 ++++++++++++++++++++++ > 1 file changed, 36 insertions(+) > >diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WizardCollectionElement.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WizardCollectionElement.java >index 3a94318..266e1a4 100644 >--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WizardCollectionElement.java >+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WizardCollectionElement.java >@@ -8,12 +8,14 @@ > * Contributors: > * IBM Corporation - initial API and implementation > * Jan-Hendrik Diederich, Bredex GmbH - bug 201052 >+ * Craig Otis - bug 439299 > *******************************************************************************/ > package org.eclipse.ui.internal.dialogs; > > import java.util.ArrayList; > import java.util.Iterator; > import java.util.List; >+import java.util.Objects; > import org.eclipse.core.runtime.IAdaptable; > import org.eclipse.core.runtime.IConfigurationElement; > import org.eclipse.core.runtime.IPath; >@@ -311,6 +313,40 @@ public class WizardCollectionElement extends AdaptableList implements IPluginCon > return size() == 0 && wizards.size() == 0; > } > >+ /** >+ * A shallow equals based only on stored string properties. Child wizards or >+ * children inherited from AdaptableList are not compared. >+ * >+ * See: Bug 439299 >+ * >+ * @author Craig Otis >+ */ >+ @Override >+ public boolean equals(Object obj) { >+ if (obj == this) { >+ return true; >+ } >+ if (!(obj instanceof WizardCollectionElement)) { >+ return false; >+ } >+ WizardCollectionElement other = (WizardCollectionElement) obj; >+ return Objects.equals(this.getId(), other.getId()) && Objects.equals(this.name, other.name) >+ && Objects.equals(this.getPluginId(), other.getPluginId()); >+ } >+ >+ /** >+ * A shallow hashCode based only on stored string properties. Child wizards >+ * or children inherited from AdaptableList are not included. >+ * >+ * See: Bug 439299 >+ * >+ * @author Craig Otis >+ */ >+ @Override >+ public int hashCode() { >+ return Objects.hash(getId(), this.name, getPluginId()); >+ } >+ > /** > * For debugging purposes. > */ >-- >2.7.2.windows.1 >
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 439299
:
244950
|
261909
| 261910