Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 311929
Collapse All | Expand All

(-)src/org/eclipse/equinox/p2/engine/ProvisioningContext.java (-9 / +18 lines)
Lines 37-43 Link Here
37
	private final List<IInstallableUnit> extraIUs = Collections.synchronizedList(new ArrayList<IInstallableUnit>());
37
	private final List<IInstallableUnit> extraIUs = Collections.synchronizedList(new ArrayList<IInstallableUnit>());
38
	private URI[] metadataRepositories; //metadata repositories to consult
38
	private URI[] metadataRepositories; //metadata repositories to consult
39
	private final Map<String, String> properties = new HashMap<String, String>();
39
	private final Map<String, String> properties = new HashMap<String, String>();
40
	private Map<String, IArtifactRepository> referencedArtifactRepositories = null;
40
	private Map<String, URI> referencedArtifactRepositories = null;
41
41
42
	private static final String FILE_PROTOCOL = "file"; //$NON-NLS-1$
42
	private static final String FILE_PROTOCOL = "file"; //$NON-NLS-1$
43
43
Lines 148-154 Link Here
148
		Arrays.sort(repositories, LOCAL_FIRST_COMPARATOR);
148
		Arrays.sort(repositories, LOCAL_FIRST_COMPARATOR);
149
149
150
		List<IArtifactRepository> repos = new ArrayList<IArtifactRepository>();
150
		List<IArtifactRepository> repos = new ArrayList<IArtifactRepository>();
151
		SubMonitor sub = SubMonitor.convert(monitor, repositories.length * 100);
151
		SubMonitor sub = SubMonitor.convert(monitor, (repositories.length + 1) * 100);
152
		for (int i = 0; i < repositories.length; i++) {
152
		for (int i = 0; i < repositories.length; i++) {
153
			if (sub.isCanceled())
153
			if (sub.isCanceled())
154
				throw new OperationCanceledException();
154
				throw new OperationCanceledException();
Lines 157-166 Link Here
157
			} catch (ProvisionException e) {
157
			} catch (ProvisionException e) {
158
				//skip unreadable repositories
158
				//skip unreadable repositories
159
			}
159
			}
160
			// Remove this URI from the list of extra references if it is there.
161
			if (referencedArtifactRepositories != null)
162
				referencedArtifactRepositories.remove(repositories[i]);
163
		}
164
		// Are there any extra artifact repository references to consider?
165
		if (referencedArtifactRepositories != null && referencedArtifactRepositories.size() > 0) {
166
			SubMonitor innerSub = SubMonitor.convert(sub.newChild(100), referencedArtifactRepositories.size() * 100);
167
			for (URI referencedURI : referencedArtifactRepositories.values()) {
168
				try {
169
					repos.add(repoManager.loadRepository(referencedURI, innerSub.newChild(100)));
170
				} catch (ProvisionException e) {
171
					// skip unreadable repositories
172
				}
173
			}
160
		}
174
		}
161
		if (referencedArtifactRepositories != null)
162
			for (IArtifactRepository repo : referencedArtifactRepositories.values())
163
				repos.add(repo);
164
		return repos;
175
		return repos;
165
	}
176
	}
166
177
Lines 172-178 Link Here
172
		SubMonitor sub = SubMonitor.convert(monitor, repositories.length * 100);
183
		SubMonitor sub = SubMonitor.convert(monitor, repositories.length * 100);
173
184
174
		// Clear out the list of remembered artifact repositories
185
		// Clear out the list of remembered artifact repositories
175
		referencedArtifactRepositories = new HashMap<String, IArtifactRepository>();
186
		referencedArtifactRepositories = new HashMap<String, URI>();
176
		for (int i = 0; i < repositories.length; i++) {
187
		for (int i = 0; i < repositories.length; i++) {
177
			if (sub.isCanceled())
188
			if (sub.isCanceled())
178
				throw new OperationCanceledException();
189
				throw new OperationCanceledException();
Lines 212-224 Link Here
212
					} else if (ref.getType() == IRepository.TYPE_ARTIFACT) {
223
					} else if (ref.getType() == IRepository.TYPE_ARTIFACT) {
213
						// We want to remember all enabled artifact repository locations.
224
						// We want to remember all enabled artifact repository locations.
214
						if (isEnabled(artifactManager, ref))
225
						if (isEnabled(artifactManager, ref))
215
							referencedArtifactRepositories.put(ref.getLocation().toString(), artifactManager.loadRepository(ref.getLocation(), repoSubMon.newChild(100)));
226
							referencedArtifactRepositories.put(ref.getLocation().toString(), ref.getLocation());
216
					}
227
					}
217
				} catch (IllegalArgumentException e) {
228
				} catch (IllegalArgumentException e) {
218
					// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=311338
229
					// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=311338
219
					// ignore invalid location and keep going
230
					// ignore invalid location and keep going
220
				} catch (ProvisionException e) {
221
					// ignore this one but keep looking at other references
222
				}
231
				}
223
			}
232
			}
224
		} else {
233
		} else {

Return to bug 311929