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 187774 Details for
Bug 335610
Regression: p2 downloads are much slower due to picking remote artifacts even when a local file: URL is available
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
patch
335610.txt (text/plain), 3.13 KB, created by
DJ Houghton
on 2011-01-27 15:44:52 EST
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
DJ Houghton
Created:
2011-01-27 15:44:52 EST
Size:
3.13 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.equinox.p2.engine >Index: src/org/eclipse/equinox/internal/p2/engine/DownloadManager.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/DownloadManager.java,v >retrieving revision 1.16 >diff -u -r1.16 DownloadManager.java >--- src/org/eclipse/equinox/internal/p2/engine/DownloadManager.java 1 Apr 2010 19:50:08 -0000 1.16 >+++ src/org/eclipse/equinox/internal/p2/engine/DownloadManager.java 27 Jan 2011 20:44:25 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2007, 2009 IBM Corporation and others. >+ * Copyright (c) 2007, 2011 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -11,8 +11,7 @@ > *******************************************************************************/ > package org.eclipse.equinox.internal.p2.engine; > >-import java.util.ArrayList; >-import java.util.Iterator; >+import java.util.*; > import org.eclipse.core.runtime.*; > import org.eclipse.equinox.internal.p2.engine.phases.Collect; > import org.eclipse.equinox.p2.core.IProvisioningAgent; >@@ -27,6 +26,25 @@ > ArrayList<IArtifactRequest> requestsToProcess = new ArrayList<IArtifactRequest>(); > private IProvisioningAgent agent = null; > >+ /** >+ * This Comparator sorts the repositories such that local repositories are first. >+ * TODO: This is copied from the ProvisioningContext class. Can we combine them? >+ * See https://bugs.eclipse.org/335153. >+ */ >+ private static final Comparator<IArtifactRepository> LOCAL_FIRST_COMPARATOR = new Comparator<IArtifactRepository>() { >+ private static final String FILE_PROTOCOL = "file"; //$NON-NLS-1$ >+ >+ public int compare(IArtifactRepository arg0, IArtifactRepository arg1) { >+ String protocol0 = arg0.getLocation().getScheme(); >+ String protocol1 = arg1.getLocation().getScheme(); >+ if (FILE_PROTOCOL.equals(protocol0) && !FILE_PROTOCOL.equals(protocol1)) >+ return -1; >+ if (!FILE_PROTOCOL.equals(protocol0) && FILE_PROTOCOL.equals(protocol1)) >+ return 1; >+ return 0; >+ } >+ }; >+ > public DownloadManager(ProvisioningContext context, IProvisioningAgent agent) { > provContext = context; > this.agent = agent; >@@ -74,6 +92,10 @@ > IArtifactRepository[] repositories = repoQueryable.query(all, subMonitor.newChild(250)).toArray(IArtifactRepository.class); > if (repositories.length == 0) > return new Status(IStatus.ERROR, EngineActivator.ID, Messages.download_no_repository, new Exception(Collect.NO_ARTIFACT_REPOSITORIES_AVAILABLE)); >+ // Although we get a sorted list back from the ProvisioningContext above, it >+ // gets unsorted when we convert the queryable into an array so we must re-sort it. >+ // See https://bugs.eclipse.org/335153. >+ Arrays.sort(repositories, LOCAL_FIRST_COMPARATOR); > fetch(repositories, subMonitor.newChild(500)); > return overallStatus(monitor); > } finally {
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 335610
: 187774