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 117694 Details for
Bug 254955
Collector should handle duplicates
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]
Fix
patch.txt (text/plain), 7.79 KB, created by
John Arthorne
on 2008-11-12 14:20:29 EST
(
hide
)
Description:
Fix
Filename:
MIME Type:
Creator:
John Arthorne
Created:
2008-11-12 14:20:29 EST
Size:
7.79 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.equinox.p2.metadata.generator >Index: src/org/eclipse/equinox/internal/p2/metadata/generator/ProductQuery.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/internal/p2/metadata/generator/ProductQuery.java,v >retrieving revision 1.5 >diff -u -r1.5 ProductQuery.java >--- src/org/eclipse/equinox/internal/p2/metadata/generator/ProductQuery.java 4 Mar 2008 15:25:38 -0000 1.5 >+++ src/org/eclipse/equinox/internal/p2/metadata/generator/ProductQuery.java 12 Nov 2008 19:20:01 -0000 >@@ -41,7 +41,7 @@ > IInstallableUnit existing = (IInstallableUnit) elements.get(iu.getId()); > if (existing.getVersion().compareTo(iu.getVersion()) >= 0) > return true; >- getList().remove(existing); >+ getCollection().remove(existing); > } > elements.put(iu.getId(), iu); > return super.accept(object); >#P org.eclipse.equinox.p2.ui >Index: src/org/eclipse/equinox/internal/p2/ui/query/CategoryElementCollector.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/query/CategoryElementCollector.java,v >retrieving revision 1.2 >diff -u -r1.2 CategoryElementCollector.java >--- src/org/eclipse/equinox/internal/p2/ui/query/CategoryElementCollector.java 7 Oct 2008 23:04:42 -0000 1.2 >+++ src/org/eclipse/equinox/internal/p2/ui/query/CategoryElementCollector.java 12 Nov 2008 19:20:02 -0000 >@@ -132,15 +132,15 @@ > ElementQueryDescriptor queryDescriptor = element.getQueryProvider().getQueryDescriptor(element); > Collector collector = queryDescriptor.queryable.query(queryDescriptor.query, queryDescriptor.collector, null); > if (!collector.isEmpty()) >- getList().add(element); >+ getCollection().add(element); > } > > private void removeNestedCategories() { >- CategoryElement[] categoryIUs = (CategoryElement[]) getList().toArray(new CategoryElement[getList().size()]); >+ CategoryElement[] categoryIUs = (CategoryElement[]) getCollection().toArray(new CategoryElement[getCollection().size()]); > // If any other element refers to a category element, remove it from the list > for (int i = 0; i < categoryIUs.length; i++) { > if (referredIUs.contains(categoryIUs[i].getIU().getId())) { >- getList().remove(categoryIUs[i]); >+ getCollection().remove(categoryIUs[i]); > } > } > } >Index: src/org/eclipse/equinox/internal/p2/ui/query/LatestIUVersionCollector.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/query/LatestIUVersionCollector.java,v >retrieving revision 1.2 >diff -u -r1.2 LatestIUVersionCollector.java >--- src/org/eclipse/equinox/internal/p2/ui/query/LatestIUVersionCollector.java 7 Oct 2008 23:04:42 -0000 1.2 >+++ src/org/eclipse/equinox/internal/p2/ui/query/LatestIUVersionCollector.java 12 Nov 2008 19:20:02 -0000 >@@ -46,7 +46,7 @@ > Object matchElement = uniqueIds.get(iu.getId()); > if (matchElement == null || iu.getVersion().compareTo(getIU(matchElement).getVersion()) > 0) { > if (matchElement != null) >- getList().remove(matchElement); >+ getCollection().remove(matchElement); > matchElement = makeDefaultElement(iu); > uniqueIds.put(iu.getId(), matchElement); > return super.accept(matchElement); >#P org.eclipse.equinox.p2.director.app >Index: src/org/eclipse/equinox/internal/p2/director/app/LatestIUVersionCollector.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.director.app/src/org/eclipse/equinox/internal/p2/director/app/LatestIUVersionCollector.java,v >retrieving revision 1.3 >diff -u -r1.3 LatestIUVersionCollector.java >--- src/org/eclipse/equinox/internal/p2/director/app/LatestIUVersionCollector.java 9 Jul 2008 21:09:07 -0000 1.3 >+++ src/org/eclipse/equinox/internal/p2/director/app/LatestIUVersionCollector.java 12 Nov 2008 19:20:02 -0000 >@@ -22,7 +22,7 @@ > Object matchElement = uniqueIds.get(iu.getId()); > if (matchElement == null || iu.getVersion().compareTo(getIU(matchElement).getVersion()) > 0) { > if (matchElement != null) >- getList().remove(matchElement); >+ getCollection().remove(matchElement); > > matchElement = makeDefaultElement(iu); > uniqueIds.put(iu.getId(), matchElement); >#P org.eclipse.equinox.p2.core >Index: src/org/eclipse/equinox/internal/provisional/p2/query/Collector.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/provisional/p2/query/Collector.java,v >retrieving revision 1.2 >diff -u -r1.2 Collector.java >--- src/org/eclipse/equinox/internal/provisional/p2/query/Collector.java 15 Feb 2008 21:55:39 -0000 1.2 >+++ src/org/eclipse/equinox/internal/provisional/p2/query/Collector.java 12 Nov 2008 19:20:03 -0000 >@@ -23,7 +23,7 @@ > * to perform different processing on the objects passed to it. > */ > public class Collector { >- private ArrayList collected = null; >+ private Set collected = null; > > /** > * Creates a new collector. >@@ -45,17 +45,21 @@ > * or <code>false</code> to indicate the traversal should stop. > */ > public boolean accept(Object object) { >- getList().add(object); >+ getCollection().add(object); > return true; > } > > /** >- * Returns the list that is being used to collect results. >- * @return the list being used to collect results. >+ * Returns the collection that is being used to collect results. Unlike {@toCollection}, >+ * this returns the actual modifiable collection that is being used to store results. The >+ * return value is only intended to be used within subclasses and should not be exposed >+ * outside of a collection class. >+ * >+ * @return the collection being used to collect results. > */ >- protected List getList() { >+ protected Collection getCollection() { > if (collected == null) >- collected = new ArrayList(); >+ collected = new HashSet(); > return collected; > } > >@@ -100,7 +104,12 @@ > return result; > } > >+ /** >+ * Returns the collected objects as an immutable collection. >+ * >+ * @return An unmodifiable collection of the collected objects >+ */ > public Collection toCollection() { >- return collected == null ? Collections.EMPTY_LIST : Collections.unmodifiableList(collected); >+ return collected == null ? Collections.EMPTY_SET : Collections.unmodifiableSet(collected); > } > } >#P org.eclipse.equinox.p2.reconciler.dropins >Index: src/org/eclipse/equinox/internal/p2/reconciler/dropins/ProfileSynchronizer.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/ProfileSynchronizer.java,v >retrieving revision 1.33 >diff -u -r1.33 ProfileSynchronizer.java >--- src/org/eclipse/equinox/internal/p2/reconciler/dropins/ProfileSynchronizer.java 27 Oct 2008 18:56:28 -0000 1.33 >+++ src/org/eclipse/equinox/internal/p2/reconciler/dropins/ProfileSynchronizer.java 12 Nov 2008 19:20:03 -0000 >@@ -43,12 +43,6 @@ > private static final String NO_TIMESTAMP = "-1"; //$NON-NLS-1$ > private static final String PROP_FROM_DROPINS = "org.eclipse.equinox.p2.reconciler.dropins"; //$NON-NLS-1$ > >- public class ListCollector extends Collector { >- public List getList() { >- return super.getList(); >- } >- } >- > private static final String CACHE_EXTENSIONS = "org.eclipse.equinox.p2.cache.extensions"; //$NON-NLS-1$ > private static final String PIPE = "|"; //$NON-NLS-1$ > final IProfile profile;
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 254955
: 117694