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 245565 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/pde/internal/ui/wizards/imports/PluginImportWizard.java (-1 / +1 lines)
Lines 136-142 Link Here
136
		PluginImportOperation.IImportQuery query = new ImportQuery(shell);
136
		PluginImportOperation.IImportQuery query = new ImportQuery(shell);
137
		PluginImportOperation.IImportQuery executionQuery = new ImportQuery(shell);
137
		PluginImportOperation.IImportQuery executionQuery = new ImportQuery(shell);
138
		final PluginImportOperation op = new PluginImportOperation(models, importType, query, executionQuery, forceAutobuild);
138
		final PluginImportOperation op = new PluginImportOperation(models, importType, query, executionQuery, forceAutobuild);
139
		op.setLaunchedConfiguration(launchedConfiguration);
139
		op.setPluginsInUse(launchedConfiguration);
140
		Job job = new Job(PDEUIMessages.ImportWizard_title) {
140
		Job job = new Job(PDEUIMessages.ImportWizard_title) {
141
			protected IStatus run(IProgressMonitor monitor) {
141
			protected IStatus run(IProgressMonitor monitor) {
142
				try {
142
				try {
(-)src/org/eclipse/pde/internal/ui/wizards/imports/PluginImportOperation.java (-246 / +247 lines)
Lines 38-44 Link Here
38
import org.eclipse.pde.internal.core.util.CoreUtility;
38
import org.eclipse.pde.internal.core.util.CoreUtility;
39
import org.eclipse.pde.internal.ui.PDEPlugin;
39
import org.eclipse.pde.internal.ui.PDEPlugin;
40
import org.eclipse.pde.internal.ui.PDEUIMessages;
40
import org.eclipse.pde.internal.ui.PDEUIMessages;
41
import org.eclipse.swt.widgets.Display;
42
import org.eclipse.team.core.RepositoryProvider;
41
import org.eclipse.team.core.RepositoryProvider;
43
import org.eclipse.team.core.TeamException;
42
import org.eclipse.team.core.TeamException;
44
import org.eclipse.ui.wizards.datatransfer.FileSystemStructureProvider;
43
import org.eclipse.ui.wizards.datatransfer.FileSystemStructureProvider;
Lines 63-73 Link Here
63
	private boolean fForceAutobuild;
62
	private boolean fForceAutobuild;
64
	private IImportQuery fExecutionQuery;
63
	private IImportQuery fExecutionQuery;
65
64
66
	private boolean fLaunchedConfigurations = false;
65
	private boolean fPluginsAreInUse = false;
67
	/**
68
	 * A list of plugins that were unable to be deleted
69
	 */
70
	private ArrayList fUnableToDeletePlugins;
71
66
72
	public interface IImportQuery {
67
	public interface IImportQuery {
73
		public static final int CANCEL = 0;
68
		public static final int CANCEL = 0;
Lines 83-108 Link Here
83
	 * @param importType one of three types specified by constants, binary, binary with links, source
78
	 * @param importType one of three types specified by constants, binary, binary with links, source
84
	 * @param replaceQuery defines what to do if the project already exists in the workspace
79
	 * @param replaceQuery defines what to do if the project already exists in the workspace
85
	 * @param executionQuery defines what to do if the project requires an unsupported execution environment
80
	 * @param executionQuery defines what to do if the project requires an unsupported execution environment
81
	 * @param forceAutobuild whether to force a build after the import
86
	 */
82
	 */
87
	public PluginImportOperation(IPluginModelBase[] models, int importType, IImportQuery replaceQuery, IImportQuery executionQuery) {
83
	public PluginImportOperation(IPluginModelBase[] models, int importType, IImportQuery replaceQuery, IImportQuery executionQuery, boolean forceAutobuild) {
88
		fModels = models;
84
		fModels = models;
89
		fImportType = importType;
85
		fImportType = importType;
90
		fReplaceQuery = replaceQuery;
86
		fReplaceQuery = replaceQuery;
91
		fExecutionQuery = executionQuery;
87
		fExecutionQuery = executionQuery;
92
		fUnableToDeletePlugins = new ArrayList();
88
		fForceAutobuild = forceAutobuild;
93
	}
89
	}
94
90
95
	/**
91
	/**
96
	 * Constructor
92
	 * Sets whether some of the plug-ins being imported are currently in use by a launched
97
	 * @param models models of plugins to import
93
	 * Eclipse instance.  Setting this to true will force an additional check before deleting
98
	 * @param importType one of three types specified by constants, binary, binary with links, source
94
	 * a plug-in.
99
	 * @param replaceQuery defines what to do if the project already exists in the workspace
95
	 * @param pluginsInUse
100
	 * @param executionQuery defines what to do if the project requires an unsupported execution environment
101
	 * @param forceAutobuild whether to force a build after the import
102
	 */
96
	 */
103
	public PluginImportOperation(IPluginModelBase[] models, int importType, IImportQuery replaceQuery, IImportQuery executionQuery, boolean forceAutobuild) {
97
	public void setPluginsInUse(boolean pluginsInUse) {
104
		this(models, importType, replaceQuery, executionQuery);
98
		// TODO Determine if this is actually necessary.
105
		fForceAutobuild = forceAutobuild;
99
		fPluginsAreInUse = pluginsInUse;
106
	}
100
	}
107
101
108
	/* (non-Javadoc)
102
	/* (non-Javadoc)
Lines 123-177 Link Here
123
					multiStatus.merge(e.getStatus());
117
					multiStatus.merge(e.getStatus());
124
				}
118
				}
125
				if (monitor.isCanceled()) {
119
				if (monitor.isCanceled()) {
120
//					TODO Set classpaths individually
126
					setClasspaths(new SubProgressMonitor(monitor, 1));
121
					setClasspaths(new SubProgressMonitor(monitor, 1));
127
					throw new OperationCanceledException();
122
					throw new OperationCanceledException();
128
				}
123
				}
129
			}
124
			}
125
//			TODO Set classpaths individually?
130
			setClasspaths(new SubProgressMonitor(monitor, 1));
126
			setClasspaths(new SubProgressMonitor(monitor, 1));
131
			if (!ResourcesPlugin.getWorkspace().isAutoBuilding() && fForceAutobuild)
127
			if (!ResourcesPlugin.getWorkspace().isAutoBuilding() && fForceAutobuild)
132
				runBuildJob();
128
				runBuildJob();
129
			// TODO Test that non-deleted plug-ins throw nice error status
133
			if (!multiStatus.isOK())
130
			if (!multiStatus.isOK())
134
				throw new CoreException(multiStatus);
131
				throw new CoreException(multiStatus);
135
		} finally {
132
		} finally {
136
			monitor.done();
133
			monitor.done();
137
			if (!fUnableToDeletePlugins.isEmpty()) {
138
				final Display display = Display.getDefault();
139
				display.syncExec(new Runnable() {
140
					public void run() {
141
						PluginImportFinishDialog dialog = new PluginImportFinishDialog(display.getActiveShell());
142
						dialog.setTitle(PDEUIMessages.PluginImportInfoDialog_title);
143
						dialog.setMessage(PDEUIMessages.PluginImportInfoDialog_message);
144
						dialog.setInput(fUnableToDeletePlugins);
145
						dialog.open();
146
					}
147
148
				});
149
			}
150
		}
134
		}
151
	}
135
	}
152
136
153
	/**
137
	/**
154
	 * Starts a job that will build the workspace
155
	 */
156
	private void runBuildJob() {
157
		Job buildJob = new Job(PDEUIMessages.CompilersConfigurationBlock_building) {
158
			public boolean belongsTo(Object family) {
159
				return ResourcesPlugin.FAMILY_AUTO_BUILD == family;
160
			}
161
162
			protected IStatus run(IProgressMonitor monitor) {
163
				try {
164
					PDEPlugin.getWorkspace().build(IncrementalProjectBuilder.INCREMENTAL_BUILD, monitor);
165
				} catch (CoreException e) {
166
				}
167
				return Status.OK_STATUS;
168
			}
169
		};
170
		buildJob.setRule(ResourcesPlugin.getWorkspace().getRuleFactory().buildRule());
171
		buildJob.schedule();
172
	}
173
174
	/**
175
	 * Sets the raw classpath of projects that need to be updated
138
	 * Sets the raw classpath of projects that need to be updated
176
	 * @param monitor
139
	 * @param monitor
177
	 * @throws JavaModelException if a classpath could not be set
140
	 * @throws JavaModelException if a classpath could not be set
Lines 197-250 Link Here
197
	 */
160
	 */
198
	private void importPlugin(IPluginModelBase model, IProgressMonitor monitor) throws CoreException {
161
	private void importPlugin(IPluginModelBase model, IProgressMonitor monitor) throws CoreException {
199
		String id = model.getPluginBase().getId();
162
		String id = model.getPluginBase().getId();
200
		monitor.beginTask(NLS.bind(PDEUIMessages.ImportWizard_operation_creating2, id), 6);
201
		try {
163
		try {
202
			BundleDescription desc = model.getBundleDescription();
164
			monitor.beginTask(NLS.bind(PDEUIMessages.ImportWizard_operation_creating2, id), 6);
203
			if (desc != null) {
204
				IExecutionEnvironmentsManager manager = JavaRuntime.getExecutionEnvironmentsManager();
205
				String[] envs = desc.getExecutionEnvironments();
206
				boolean found = false;
207
				for (int i = 0; i < envs.length; i++) {
208
					if (manager.getEnvironment(envs[i]) != null) {
209
						found = true;
210
						break;
211
					}
212
				}
213
				if (envs.length > 0 && !found) {
214
					String message = NLS.bind(PDEUIMessages.PluginImportOperation_executionEnvironment, id, envs[0]);
215
					if (!queryExecutionEnvironment(message))
216
						return;
217
				}
218
			}
219
220
			IProject project = findProject(id);
221
165
222
			if (project.exists() || new File(project.getParent().getLocation().toFile(), project.getName()).exists()) {
166
			// Test is the required execution environment is supported
223
				if (!queryReplace(project))
167
			if (!testExecutionEnvironment(model)) {
224
					return;
168
				return;
225
				if (RepositoryProvider.isShared(project))
226
					RepositoryProvider.unmap(project);
227
				if (!project.exists())
228
					project.create(new SubProgressMonitor(monitor, 1));
229
				if (!safeDeleteCheck(project, monitor)) {
230
					fUnableToDeletePlugins.add(model);
231
					return;
232
				}
233
				try {
234
					project.delete(true, true, monitor);
235
				} catch (CoreException e) {
236
					fUnableToDeletePlugins.add(model);
237
					return;
238
				}
239
			}
169
			}
170
			// Create the project or ask to overwrite if project exists
171
			IProject project = createProject(model, new SubProgressMonitor(monitor, 1));
240
172
241
			project.create(monitor);
173
			// Target Weaving: if we are importing plug-ins in the runtime workbench from the host workbench, import everything as-is and return
242
			if (!project.isOpen())
243
				project.open(monitor);
244
			monitor.worked(1);
245
246
			if (Platform.inDevelopmentMode()) {
174
			if (Platform.inDevelopmentMode()) {
247
				// if we are importing plug-ins in the runtime workbench from the host workbench, import everything as-is and return
248
				File location = new File(model.getInstallLocation());
175
				File location = new File(model.getInstallLocation());
249
				if (location.isDirectory()) {
176
				if (location.isDirectory()) {
250
					File classpathFile = new File(location, ".classpath"); //$NON-NLS-1$
177
					File classpathFile = new File(location, ".classpath"); //$NON-NLS-1$
Lines 256-286 Link Here
256
				}
183
				}
257
			}
184
			}
258
185
186
			// Perform the import
187
			Map sourceMap = null;
259
			switch (fImportType) {
188
			switch (fImportType) {
260
				case IMPORT_BINARY :
189
				case IMPORT_BINARY :
261
					importAsBinary(project, model, true, new SubProgressMonitor(monitor, 4));
190
					sourceMap = importAsBinary(project, model, new SubProgressMonitor(monitor, 4));
262
					break;
191
					break;
263
				case IMPORT_BINARY_WITH_LINKS :
192
				case IMPORT_BINARY_WITH_LINKS :
264
					if (id.startsWith("org.eclipse.swt") && !isJARd(model)) { //$NON-NLS-1$
193
					if (id.startsWith("org.eclipse.swt") && !isJARd(model)) { //$NON-NLS-1$
265
						importAsBinary(project, model, true, monitor);
194
						importAsBinary(project, model, monitor);
266
					} else {
195
					} else {
267
						importAsBinaryWithLinks(project, model, new SubProgressMonitor(monitor, 4));
196
						importAsBinaryWithLinks(project, model, new SubProgressMonitor(monitor, 4));
268
					}
197
					}
269
					break;
198
					break;
270
				case IMPORT_WITH_SOURCE :
199
				case IMPORT_WITH_SOURCE :
271
					if (isExempt(model)) {
200
					if (isExempt(model)) {
272
						importAsBinary(project, model, true, new SubProgressMonitor(monitor, 4));
201
						importAsBinary(project, model, new SubProgressMonitor(monitor, 4));
273
					} else {
202
					} else {
274
						importAsSource(project, model, new SubProgressMonitor(monitor, 4));
203
						importAsSource(project, model, new SubProgressMonitor(monitor, 4));
275
					}
204
					}
276
			}
205
			}
277
206
278
			setProjectDescription(project, model);
207
			setProjectNatures(project, model);
279
208
209
			// Set the classpath
280
			if (project.hasNature(JavaCore.NATURE_ID) && project.findMember(".classpath") == null) //$NON-NLS-1$
210
			if (project.hasNature(JavaCore.NATURE_ID) && project.findMember(".classpath") == null) //$NON-NLS-1$
281
				fProjectClasspaths.put(project, ClasspathComputer.getClasspath(project, model, true, false));
211
				fProjectClasspaths.put(project, ClasspathComputer.getClasspath(project, model, sourceMap, true, false));
282
		} catch (CoreException e) {
212
		} finally {
283
			PDEPlugin.logException(e);
213
			monitor.done();
214
		}
215
	}
216
217
	/**
218
	 * Creates the project to add to the workspace.  If the project already exists in 
219
	 * the workspace ask the user if it is ok to overwrite.  Will return <code>null</code>
220
	 * if no project could be created for the import (i.e. the user chooses to not overwrite).
221
	 * 
222
	 * @param model plug-in being imported
223
	 * @param monitor progress monitor
224
	 * @return the project to use or <code>null</code> if no project could be created/overwritten
225
	 * @throws TeamException if an existing project is shared and an error occurs disconnecting it
226
	 * @throws CoreException if an error occurs when working with the project
227
	 */
228
	private IProject createProject(IPluginModelBase model, IProgressMonitor monitor) throws TeamException, CoreException {
229
		try {
230
			monitor.beginTask("Creating the project", 2);
231
			IProject project = findProject(model.getPluginBase().getId());
232
			if (project.exists() || new File(project.getParent().getLocation().toFile(), project.getName()).exists()) {
233
				// Query the user to see if we should overwrite
234
				switch (fReplaceQuery.doQuery(NLS.bind(PDEUIMessages.ImportWizard_messages_exists, project.getName()))) {
235
					case IImportQuery.CANCEL :
236
						throw new OperationCanceledException();
237
					case IImportQuery.NO :
238
						return null;
239
				}
240
				if (RepositoryProvider.isShared(project))
241
					RepositoryProvider.unmap(project);
242
				if (!project.exists())
243
					project.create(new SubProgressMonitor(monitor, 1));
244
				if (!safeDeleteCheck(project, monitor)) {
245
					throw new CoreException(new Status(IStatus.ERROR, PDEPlugin.getPluginId(), NLS.bind(PDEUIMessages.PluginImportOperation_could_not_delete_project, project.getName())));
246
				}
247
				project.delete(true, true, monitor);
248
			}
249
250
			project.create(monitor);
251
			if (!project.isOpen())
252
				project.open(monitor);
253
			monitor.worked(1);
254
255
			return project;
256
284
		} finally {
257
		} finally {
285
			monitor.done();
258
			monitor.done();
286
		}
259
		}
Lines 305-314 Link Here
305
		return id + "_" + version; //$NON-NLS-1$
278
		return id + "_" + version; //$NON-NLS-1$
306
	}
279
	}
307
280
308
	// returns true if it is safe to delete the project.  It is not safe to delete if
281
	/**
309
	// one of its libraries is locked by a running launch configuration.
282
	 * Returns true if it is safe to delete the project.  It is not safe to delete if
283
	 * one of its libraries is locked by a running launch configuration.
284
	 * 
285
	 * @param project project to test
286
	 * @param monitor progress monitor
287
	 * @return true is it is safe to delete the project, false otherwise
288
	 */
310
	private boolean safeDeleteCheck(IProject project, IProgressMonitor monitor) {
289
	private boolean safeDeleteCheck(IProject project, IProgressMonitor monitor) {
311
		if (!fLaunchedConfigurations)
290
		if (!fPluginsAreInUse)
312
			return true;
291
			return true;
313
		IPluginModelBase base = PluginRegistry.findModel(project);
292
		IPluginModelBase base = PluginRegistry.findModel(project);
314
		if (base != null) {
293
		if (base != null) {
Lines 372-412 Link Here
372
	 * Imports the contents of the plugin and imports source files as binary files that will not be compiled.
351
	 * Imports the contents of the plugin and imports source files as binary files that will not be compiled.
373
	 * @param project destination project of the import
352
	 * @param project destination project of the import
374
	 * @param model model representing the plugin to import
353
	 * @param model model representing the plugin to import
375
	 * @param markAsBinary whether to mark the project as a binary project
376
	 * @param monitor progress monitor
354
	 * @param monitor progress monitor
355
	 * @return a mapping of libraries to source locations to use in the classpath
377
	 * @throws CoreException if there is a problem completing the import
356
	 * @throws CoreException if there is a problem completing the import
378
	 */
357
	 */
379
	private void importAsBinary(IProject project, IPluginModelBase model, boolean markAsBinary, IProgressMonitor monitor) throws CoreException {
358
	private Map importAsBinary(IProject project, IPluginModelBase model, IProgressMonitor monitor) throws CoreException {
380
		monitor.beginTask("", 4); //$NON-NLS-1$
359
381
		if (isJARd(model)) {
360
		try {
382
			extractJARdPlugin(project, model, new SubProgressMonitor(monitor, 3));
361
			monitor.beginTask(NLS.bind("Importing {0}", model.getPluginBase().getId()), 4);
383
		} else {
362
384
			importContent(new File(model.getInstallLocation()), project.getFullPath(), FileSystemStructureProvider.INSTANCE, null, new SubProgressMonitor(monitor, 1));
363
			// Import the plug-in content
385
			importSourceArchives(project, model, new SubProgressMonitor(monitor, 1));
364
			File srcFile = new File(model.getInstallLocation());
365
			if (isJARd(model)) {
366
				importArchive(project, srcFile, new Path(srcFile.getName()));
367
			} else {
368
				importContent(new File(model.getInstallLocation()), project.getFullPath(), FileSystemStructureProvider.INSTANCE, null, new SubProgressMonitor(monitor, 1));
369
			}
370
371
			// Import source from known source locations
372
			Map sourceMap = copySourceArchives(project, model, new SubProgressMonitor(monitor, 1));
386
373
387
			// make sure all libraries have been imported
374
			// Import missing libraries from fragments
388
			// if any are missing, check in fragments		
375
			// TODO Needs testing, might be obsolete
389
			IFragment[] fragments = getFragmentsFor(model);
376
			IFragment[] fragments = getFragmentsFor(model);
390
			IPluginLibrary[] libraries = model.getPluginBase().getLibraries();
377
			IPluginLibrary[] libraries = model.getPluginBase().getLibraries();
391
378
392
			IProgressMonitor fragmentMonitor = new SubProgressMonitor(monitor, 1);
393
			fragmentMonitor.beginTask("", libraries.length); //$NON-NLS-1$
394
			for (int i = 0; i < libraries.length; i++) {
379
			for (int i = 0; i < libraries.length; i++) {
395
				String libraryName = libraries[i].getName();
380
				String libraryName = ClasspathUtilCore.expandLibraryName(libraries[i].getName());
396
				if (ClasspathUtilCore.containsVariables(libraryName) && !project.exists(new Path(ClasspathUtilCore.expandLibraryName(libraryName)))) {
381
				Path libPath = new Path(libraryName);
382
				if (!project.exists(libPath)) {
397
					for (int j = 0; j < fragments.length; j++) {
383
					for (int j = 0; j < fragments.length; j++) {
398
						importJarFromFragment(project, fragments[j], libraryName);
384
						// TODO Fragments are always a specific shape?
399
						importSourceFromFragment(project, fragments[j], libraryName, new SubProgressMonitor(monitor, 1));
385
						// Import the fragment
386
						File jar = new File(fragments[i].getModel().getInstallLocation(), libPath.toString());
387
						if (jar.exists()) {
388
							importArchive(project, jar, libPath);
389
						}
390
						// Import the source
391
						// TODO Edit copySourceArchives to handle fragments to save the code duplication, don't forget the source map			
392
						SourceLocationManager manager = PDECore.getDefault().getSourceLocationManager();
393
						String zipName = ClasspathUtilCore.getSourceZipName(libraryName);
394
						IPath srcPath = manager.findSourcePath(fragments[i], new Path(zipName));
395
						if (srcPath != null) {
396
							// TODO Determine the best way to make the name, can be just the source location. 
397
							if ("src.zip".equals(zipName) && isJARd(model)) { //$NON-NLS-1$
398
								// We want a more meaningful name than src.zip
399
								zipName = ClasspathUtilCore.getSourceZipName(new File(model.getInstallLocation()).getName());
400
							}
401
							IPath dstPath = new Path(zipName);
402
							sourceMap.put(libraries[i], dstPath);
403
							if (project.findMember(dstPath) == null) {
404
								importArchive(project, new File(srcPath.toOSString()), dstPath);
405
							}
406
						}
400
					}
407
					}
401
				} else {
402
					monitor.worked(1);
403
				}
408
				}
404
			}
409
			}
405
		}
410
			monitor.worked(1);
406
		if (markAsBinary) {
411
412
			// Mark the project as binary
407
			project.setPersistentProperty(PDECore.EXTERNAL_PROJECT_PROPERTY, PDECore.BINARY_PROJECT_VALUE);
413
			project.setPersistentProperty(PDECore.EXTERNAL_PROJECT_PROPERTY, PDECore.BINARY_PROJECT_VALUE);
408
			importAdditionalResources(project, model, new SubProgressMonitor(monitor, 1));
414
409
		} else {
415
			// TODO Test if schema extraction is necessary
416
//			importAdditionalResources(project, model, new SubProgressMonitor(monitor, 1));
417
418
			return sourceMap;
419
420
		} finally {
410
			monitor.done();
421
			monitor.done();
411
		}
422
		}
412
	}
423
	}
Lines 420-426 Link Here
420
	 */
431
	 */
421
	private void importAsSource(IProject project, IPluginModelBase model, SubProgressMonitor monitor) throws CoreException {
432
	private void importAsSource(IProject project, IPluginModelBase model, SubProgressMonitor monitor) throws CoreException {
422
		monitor.beginTask("", 4); //$NON-NLS-1$
433
		monitor.beginTask("", 4); //$NON-NLS-1$
423
		importAsBinary(project, model, false, new SubProgressMonitor(monitor, 2));
434
//		importAsBinary(project, model, false, new SubProgressMonitor(monitor, 2));
424
		List list = importAdditionalResources(project, model, new SubProgressMonitor(monitor, 1));
435
		List list = importAdditionalResources(project, model, new SubProgressMonitor(monitor, 1));
425
		WorkspaceBuildModel buildModel = new WorkspaceBuildModel(project.getFile("build.properties")); //$NON-NLS-1$
436
		WorkspaceBuildModel buildModel = new WorkspaceBuildModel(project.getFile("build.properties")); //$NON-NLS-1$
426
		if (!isJARd(model) || containsCode(new File(model.getInstallLocation()))) {
437
		if (!isJARd(model) || containsCode(new File(model.getInstallLocation()))) {
Lines 739-812 Link Here
739
		monitor.done();
750
		monitor.done();
740
	}
751
	}
741
752
742
	private void importSourceArchives(IProject project, IPluginModelBase model, IProgressMonitor monitor) throws CoreException {
753
	private Map copySourceArchives(IProject project, IPluginModelBase model, IProgressMonitor monitor) throws CoreException {
743
		String[] libraries = getLibraryNames(model, true);
754
		String[] libraries = getLibraryNames(model, true);
744
		monitor.beginTask(PDEUIMessages.ImportWizard_operation_copyingSource, libraries.length);
755
		try {
745
756
			monitor.beginTask(PDEUIMessages.ImportWizard_operation_copyingSource, libraries.length);
746
		SourceLocationManager manager = PDECore.getDefault().getSourceLocationManager();
747
748
		Set roots = null;
749
		if (manager.hasBundleManifestLocation(model.getPluginBase()))
750
			roots = manager.findSourceRoots(model.getPluginBase());
751
752
		for (int i = 0; i < libraries.length; i++) {
753
			String zipName = ClasspathUtilCore.getSourceZipName(libraries[i]);
754
			IPath path = new Path(zipName);
755
			if (project.findMember(path) == null) {
756
				// if we are importing the source through a sourceBundle header...
757
				if (roots != null) {
758
					IPath sourceLocation = manager.findSourcePath(model.getPluginBase(), null);
759
					String currentRoot = ".".equals(libraries[i]) ? "." : path.removeFileExtension().toString(); //$NON-NLS-1$ //$NON-NLS-2$
760
					if (roots.contains(currentRoot)) {
761
						if (".".equals(currentRoot)) { //$NON-NLS-1$
762
							// Save to a special folder name based on the install location
763
							IPath sourceName = getDefaultSourceNameForProject(model);
764
							sourceName = sourceName.removeFileExtension();
765
							IFolder dest = project.getFolder(sourceName);
766
							if (!dest.exists()) {
767
								dest.create(true, true, null);
768
							}
769
770
							// List all of the other source roots so they are not included when importing source from the root, ".", of the jar
771
							Set allBundleRoots = manager.findAllSourceRootsInSourceLocation(model.getPluginBase());
772
							List rootsToExclude = new ArrayList(allBundleRoots.size() - 1);
773
							for (Iterator iterator2 = allBundleRoots.iterator(); iterator2.hasNext();) {
774
								String rootString = (String) iterator2.next();
775
								if (!".".equals(rootString)) { //$NON-NLS-1$
776
									rootsToExclude.add(new Path(rootString));
777
								}
778
							}
779
757
780
							// Extract folders containing java source
758
			Map sourceMap = new HashMap(libraries.length);
781
							extractJavaSource(new File(sourceLocation.toOSString()), rootsToExclude, dest, monitor);
759
			SourceLocationManager manager = PDECore.getDefault().getSourceLocationManager();
782
						} else {
760
			for (int i = 0; i < libraries.length; i++) {
783
							// Extract the specific library from it's folder
761
				String zipName = ClasspathUtilCore.getSourceZipName(libraries[i]);
784
							extractResourcesFromFolder(new File(sourceLocation.toOSString()), new Path(currentRoot), project, monitor);
762
				IPath srcPath = manager.findSourcePath(model.getPluginBase(), new Path(zipName));
785
						}
763
				if (srcPath != null) {
786
					}
764
					zipName = srcPath.lastSegment();
787
				} else {
765
					// TODO Determine the best way to make the name, can be just the source location. 
788
					IPath srcPath = manager.findSourcePath(model.getPluginBase(), path);
766
					if ("src.zip".equals(zipName)) { //$NON-NLS-1$
789
					if (srcPath != null) {
767
						// We want a more meaningful name than src.zip
790
						if ("src.zip".equals(zipName) && isJARd(model)) { //$NON-NLS-1$
768
						zipName = ClasspathUtilCore.getSourceZipName(new File(model.getInstallLocation()).getName());
791
							path = getDefaultSourceNameForProject(model);
769
					}
792
						}
770
					IPath dstPath = new Path(zipName);
793
						importArchive(project, new File(srcPath.toOSString()), path);
771
					sourceMap.put(libraries[i], dstPath);
772
					if (project.findMember(dstPath) == null) {
773
						importArchive(project, new File(srcPath.toOSString()), dstPath);
794
					}
774
					}
775
795
				}
776
				}
777
				monitor.worked(1);
796
			}
778
			}
797
			monitor.worked(1);
779
			return sourceMap;
780
		} finally {
781
			monitor.done();
798
		}
782
		}
799
		monitor.done();
800
	}
801
802
	/**
803
	 * Creates a path representing a zip file that is named based on the plugin install location.
804
	 * Used to replace src.zip with a more unique and meaningful name.
805
	 * @param model model that the src.zip containg source for
806
	 * @return a new path describing the zip file
807
	 */
808
	private IPath getDefaultSourceNameForProject(IPluginModelBase model) {
809
		return new Path(ClasspathUtilCore.getSourceZipName(new File(model.getInstallLocation()).getName()));
810
	}
783
	}
811
784
812
	private String[] getLibraryNames(IPluginModelBase model, boolean expand) {
785
	private String[] getLibraryNames(IPluginModelBase model, boolean expand) {
Lines 854-860 Link Here
854
					if (fImportType == IMPORT_BINARY_WITH_LINKS) {
827
					if (fImportType == IMPORT_BINARY_WITH_LINKS) {
855
						linkSourceArchives(project, model, new SubProgressMonitor(monitor, 1));
828
						linkSourceArchives(project, model, new SubProgressMonitor(monitor, 1));
856
					} else {
829
					} else {
857
						importSourceArchives(project, model, new SubProgressMonitor(monitor, 1));
830
						copySourceArchives(project, model, new SubProgressMonitor(monitor, 1));
858
					}
831
					}
859
				}
832
				}
860
			}
833
			}
Lines 926-952 Link Here
926
		return PDEPlugin.getWorkspace().getRoot().getProject(id);
899
		return PDEPlugin.getWorkspace().getRoot().getProject(id);
927
	}
900
	}
928
901
929
	private boolean queryReplace(IProject project) throws OperationCanceledException {
902
	/**
930
		switch (fReplaceQuery.doQuery(NLS.bind(PDEUIMessages.ImportWizard_messages_exists, project.getName()))) {
903
	 * Tests whether the required execution environment of the given plugin is supported by
931
			case IImportQuery.CANCEL :
904
	 * the current known JREs.  If not, ask the user whether to continue.
932
				throw new OperationCanceledException();
905
	 * @param model the plug-in model to test
933
			case IImportQuery.NO :
906
	 * @return true is the import should continue, false if the plug-in should be skipped
934
				return false;
907
	 * @throws OperationCanceledException if the user chooses to cancel the operation
935
		}
908
	 */
936
		return true;
909
	private boolean testExecutionEnvironment(IPluginModelBase model) throws OperationCanceledException {
937
	}
910
		BundleDescription desc = model.getBundleDescription();
938
911
		if (desc != null) {
939
	private boolean queryExecutionEnvironment(String message) throws OperationCanceledException {
912
			IExecutionEnvironmentsManager manager = JavaRuntime.getExecutionEnvironmentsManager();
940
		switch (fExecutionQuery.doQuery(message)) {
913
			String[] envs = desc.getExecutionEnvironments();
941
			case IImportQuery.CANCEL :
914
			boolean found = false;
942
				throw new OperationCanceledException();
915
			for (int i = 0; i < envs.length; i++) {
943
			case IImportQuery.NO :
916
				if (manager.getEnvironment(envs[i]) != null) {
944
				return false;
917
					found = true;
918
					break;
919
				}
920
			}
921
			if (envs.length > 0 && !found) {
922
				switch (fExecutionQuery.doQuery(NLS.bind(PDEUIMessages.PluginImportOperation_executionEnvironment, model.getPluginBase().getId(), envs[0]))) {
923
					case IImportQuery.CANCEL :
924
						throw new OperationCanceledException();
925
					case IImportQuery.NO :
926
						return false;
927
				}
928
			}
945
		}
929
		}
946
		return true;
930
		return true;
947
	}
931
	}
948
932
949
	private void setProjectDescription(IProject project, IPluginModelBase model) throws CoreException {
933
	private void setProjectNatures(IProject project, IPluginModelBase model) throws CoreException {
950
		IProjectDescription desc = project.getDescription();
934
		IProjectDescription desc = project.getDescription();
951
		if (!desc.hasNature(PDE.PLUGIN_NATURE))
935
		if (!desc.hasNature(PDE.PLUGIN_NATURE))
952
			CoreUtility.addNatureToProject(project, PDE.PLUGIN_NATURE, null);
936
			CoreUtility.addNatureToProject(project, PDE.PLUGIN_NATURE, null);
Lines 1027-1069 Link Here
1027
		return (IFragment[]) result.toArray(new IFragment[result.size()]);
1011
		return (IFragment[]) result.toArray(new IFragment[result.size()]);
1028
	}
1012
	}
1029
1013
1030
	private void importJarFromFragment(IProject project, IFragment fragment, String name) throws CoreException {
1014
//	private void importJarFromFragment(IProject project, IFragment fragment, String name) throws CoreException {
1031
		IPath jarPath = new Path(ClasspathUtilCore.expandLibraryName(name));
1015
//		IPath jarPath = new Path(ClasspathUtilCore.expandLibraryName(name));
1032
		File jar = new File(fragment.getModel().getInstallLocation(), jarPath.toString());
1016
//		File jar = new File(fragment.getModel().getInstallLocation(), jarPath.toString());
1033
		if (jar.exists()) {
1017
//		if (jar.exists()) {
1034
			importArchive(project, jar, jarPath);
1018
//			importArchive(project, jar, jarPath);
1035
		}
1019
//		}
1036
	}
1020
//	}
1037
1021
1038
	/**
1022
//	/**
1039
	 * Imports the source for a library from a fragment.
1023
//	 * Imports the source for a library from a fragment.
1040
	 * @param project destination project of the import
1024
//	 * @param project destination project of the import
1041
	 * @param fragment fragment to import the library from
1025
//	 * @param fragment fragment to import the library from
1042
	 * @param libraryName name of the library to import, 
1026
//	 * @param libraryName name of the library to import, 
1043
	 * @param monitor progress monitor
1027
//	 * @param monitor progress monitor
1044
	 * @throws CoreException if there is a problem completing the import
1028
//	 * @throws CoreException if there is a problem completing the import
1045
	 */
1029
//	 */
1046
	private void importSourceFromFragment(IProject project, IFragment fragment, String libraryName, IProgressMonitor monitor) throws CoreException {
1030
//	private void importSourceFromFragment(IProject project, IFragment fragment, String libraryName, IProgressMonitor monitor) throws CoreException {
1047
		try {
1031
//		try {
1048
			IPath jarPath = new Path(ClasspathUtilCore.expandLibraryName(libraryName));
1032
//			IPath jarPath = new Path(ClasspathUtilCore.expandLibraryName(libraryName));
1049
			String zipName = ClasspathUtilCore.getSourceZipName(jarPath.toString());
1033
//			String zipName = ClasspathUtilCore.getSourceZipName(jarPath.toString());
1050
			IPath path = new Path(zipName);
1034
//			IPath path = new Path(zipName);
1051
			if (project.findMember(path) == null) {
1035
//			if (project.findMember(path) == null) {
1052
				SourceLocationManager manager = PDECore.getDefault().getSourceLocationManager();
1036
//				SourceLocationManager manager = PDECore.getDefault().getSourceLocationManager();
1053
				IPath srcPath = manager.findSourcePath(fragment, path);
1037
//				IPath srcPath = manager.findSourcePath(fragment, path);
1054
				if (srcPath != null) {
1038
//				if (srcPath != null) {
1055
					if (manager.hasBundleManifestLocation(fragment)) {
1039
//					if (manager.hasBundleManifestLocation(fragment)) {
1056
						// Extract the specific library from it's folder
1040
//						// Extract the specific library from it's folder
1057
						extractResourcesFromFolder(new File(srcPath.toOSString()), path.removeFileExtension(), project, monitor);
1041
//						extractResourcesFromFolder(new File(srcPath.toOSString()), path.removeFileExtension(), project, monitor);
1058
					} else {
1042
//					} else {
1059
						importArchive(project, new File(srcPath.toOSString()), path);
1043
//						importArchive(project, new File(srcPath.toOSString()), path);
1060
					}
1044
//					}
1061
				}
1045
//				}
1062
			}
1046
//			}
1063
		} finally {
1047
//		} finally {
1064
			monitor.done();
1048
//			monitor.done();
1065
		}
1049
//		}
1066
	}
1050
//	}
1067
1051
1068
	protected void collectAdditionalResources(ZipFileStructureProvider provider, Object element, ArrayList collected, IProject project) {
1052
	protected void collectAdditionalResources(ZipFileStructureProvider provider, Object element, ArrayList collected, IProject project) {
1069
		collectAdditionalResources(provider, element, collected);
1053
		collectAdditionalResources(provider, element, collected);
Lines 1093-1100 Link Here
1093
		}
1077
		}
1094
	}
1078
	}
1095
1079
1096
	public void setLaunchedConfiguration(boolean launchedConfiguration) {
1080
	/**
1097
		fLaunchedConfigurations = launchedConfiguration;
1081
	 * Starts a job that will build the workspace
1082
	 */
1083
	private void runBuildJob() {
1084
		Job buildJob = new Job(PDEUIMessages.CompilersConfigurationBlock_building) {
1085
			public boolean belongsTo(Object family) {
1086
				return ResourcesPlugin.FAMILY_AUTO_BUILD == family;
1087
			}
1088
1089
			protected IStatus run(IProgressMonitor monitor) {
1090
				try {
1091
					PDEPlugin.getWorkspace().build(IncrementalProjectBuilder.INCREMENTAL_BUILD, monitor);
1092
				} catch (CoreException e) {
1093
				}
1094
				return Status.OK_STATUS;
1095
			}
1096
		};
1097
		buildJob.setRule(ResourcesPlugin.getWorkspace().getRuleFactory().buildRule());
1098
		buildJob.schedule();
1098
	}
1099
	}
1099
1100
1100
}
1101
}
(-)src/org/eclipse/pde/internal/ui/pderesources.properties (-2 / +1 lines)
Lines 1070-1077 Link Here
1070
PluginSelectionDialog_title = Plug-in Selection
1070
PluginSelectionDialog_title = Plug-in Selection
1071
PluginStructureCreator_name=Plug-in Structure Compare
1071
PluginStructureCreator_name=Plug-in Structure Compare
1072
PluginSelectionDialog_message = &Select a Plug-in:
1072
PluginSelectionDialog_message = &Select a Plug-in:
1073
PluginImportInfoDialog_message=Could not fully delete existing plug-ins with the same name.\nImporting the following plug-ins failed:
1073
PluginImportOperation_could_not_delete_project=Import operation could not delete the following project: {0}
1074
PluginImportInfoDialog_title=Deleting Plug-ins Failed
1075
PluginImportOperation_linking=Linking content...
1074
PluginImportOperation_linking=Linking content...
1076
PluginImportOperation_executionEnvironment=Plug-in ''{0}'' requires an ''{1}'' execution environment that is not supported by any of the installed JREs. Import anyway?
1075
PluginImportOperation_executionEnvironment=Plug-in ''{0}'' requires an ''{1}'' execution environment that is not supported by any of the installed JREs. Import anyway?
1077
PluginImportWizard_runningConfigDesc=An application is currently running. Some of the selected plug-ins may not be imported if they are locked by it. Do you want to continue?
1076
PluginImportWizard_runningConfigDesc=An application is currently running. Some of the selected plug-ins may not be imported if they are locked by it. Do you want to continue?
(-)src/org/eclipse/pde/internal/ui/PDEUIMessages.java (-3 / +1 lines)
Lines 1594-1602 Link Here
1594
1594
1595
	public static String PluginSelectionDialog_title;
1595
	public static String PluginSelectionDialog_title;
1596
	public static String PluginSelectionDialog_message;
1596
	public static String PluginSelectionDialog_message;
1597
	public static String PluginImportInfoDialog_message;
1597
	public static String PluginImportOperation_could_not_delete_project;
1598
1599
	public static String PluginImportInfoDialog_title;
1600
1598
1601
	public static String PluginImportOperation_linking;
1599
	public static String PluginImportOperation_linking;
1602
	public static String PluginContentPage_appQuestion;
1600
	public static String PluginContentPage_appQuestion;
(-)src/org/eclipse/pde/internal/core/ClasspathComputer.java (-24 / +22 lines)
Lines 34-44 Link Here
34
	private static final int SEVERITY_IGNORE = 1;
34
	private static final int SEVERITY_IGNORE = 1;
35
35
36
	public static void setClasspath(IProject project, IPluginModelBase model) throws CoreException {
36
	public static void setClasspath(IProject project, IPluginModelBase model) throws CoreException {
37
		IClasspathEntry[] entries = getClasspath(project, model, false, true);
37
		IClasspathEntry[] entries = getClasspath(project, model, null, false, true);
38
		JavaCore.create(project).setRawClasspath(entries, null);
38
		JavaCore.create(project).setRawClasspath(entries, null);
39
	}
39
	}
40
40
41
	public static IClasspathEntry[] getClasspath(IProject project, IPluginModelBase model, boolean clear, boolean overrideCompliance) throws CoreException {
41
	// TODO Javadoc
42
	public static IClasspathEntry[] getClasspath(IProject project, IPluginModelBase model, Map sourceLibraryMap, boolean clear, boolean overrideCompliance) throws CoreException {
42
		IJavaProject javaProject = JavaCore.create(project);
43
		IJavaProject javaProject = JavaCore.create(project);
43
		ArrayList result = new ArrayList();
44
		ArrayList result = new ArrayList();
44
		IBuild build = getBuild(project);
45
		IBuild build = getBuild(project);
Lines 52-58 Link Here
52
		result.add(createEntryUsingPreviousEntry(javaProject, ee, PDECore.REQUIRED_PLUGINS_CONTAINER_PATH));
53
		result.add(createEntryUsingPreviousEntry(javaProject, ee, PDECore.REQUIRED_PLUGINS_CONTAINER_PATH));
53
54
54
		// add own libraries/source
55
		// add own libraries/source
55
		addSourceAndLibraries(project, model, build, clear, result);
56
		addSourceAndLibraries(project, model, build, clear, sourceLibraryMap, result);
56
57
57
		IClasspathEntry[] entries = (IClasspathEntry[]) result.toArray(new IClasspathEntry[result.size()]);
58
		IClasspathEntry[] entries = (IClasspathEntry[]) result.toArray(new IClasspathEntry[result.size()]);
58
		IJavaModelStatus validation = JavaConventions.validateClasspath(javaProject, entries, javaProject.getOutputLocation());
59
		IJavaModelStatus validation = JavaConventions.validateClasspath(javaProject, entries, javaProject.getOutputLocation());
Lines 63-69 Link Here
63
		return (IClasspathEntry[]) result.toArray(new IClasspathEntry[result.size()]);
64
		return (IClasspathEntry[]) result.toArray(new IClasspathEntry[result.size()]);
64
	}
65
	}
65
66
66
	public static void addSourceAndLibraries(IProject project, IPluginModelBase model, IBuild build, boolean clear, ArrayList result) throws CoreException {
67
	private static void addSourceAndLibraries(IProject project, IPluginModelBase model, IBuild build, boolean clear, Map sourceLibraryMap, ArrayList result) throws CoreException {
67
68
68
		HashSet paths = new HashSet();
69
		HashSet paths = new HashSet();
69
70
Lines 86-95 Link Here
86
			if (buildEntry != null) {
87
			if (buildEntry != null) {
87
				addSourceFolder(buildEntry, project, paths, result);
88
				addSourceFolder(buildEntry, project, paths, result);
88
			} else {
89
			} else {
90
				IPath sourceAttachment = sourceLibraryMap != null ? (IPath) sourceLibraryMap.get(libraries[i].getName()) : null;
89
				if (libraries[i].getName().equals(".")) //$NON-NLS-1$
91
				if (libraries[i].getName().equals(".")) //$NON-NLS-1$
90
					addJARdPlugin(project, ClasspathUtilCore.getFilename(model), attrs, result);
92
					addJARdPlugin(project, ClasspathUtilCore.getFilename(model), sourceAttachment, attrs, result);
91
				else
93
				else
92
					addLibraryEntry(project, libraries[i], attrs, result);
94
					addLibraryEntry(project, libraries[i], sourceAttachment, attrs, result);
93
			}
95
			}
94
		}
96
		}
95
		if (libraries.length == 0) {
97
		if (libraries.length == 0) {
Lines 99-105 Link Here
99
					addSourceFolder(buildEntry, project, paths, result);
101
					addSourceFolder(buildEntry, project, paths, result);
100
				}
102
				}
101
			} else if (ClasspathUtilCore.hasBundleStructure(model)) {
103
			} else if (ClasspathUtilCore.hasBundleStructure(model)) {
102
				addJARdPlugin(project, ClasspathUtilCore.getFilename(model), attrs, result);
104
				IPath sourceAttachment = sourceLibraryMap != null ? (IPath) sourceLibraryMap.get(".") : null; //$NON-NLS-1$
105
				addJARdPlugin(project, ClasspathUtilCore.getFilename(model), sourceAttachment, attrs, result);
103
			}
106
			}
104
		}
107
		}
105
	}
108
	}
Lines 146-152 Link Here
146
		return (buildModel != null) ? buildModel.getBuild() : null;
149
		return (buildModel != null) ? buildModel.getBuild() : null;
147
	}
150
	}
148
151
149
	private static void addLibraryEntry(IProject project, IPluginLibrary library, IClasspathAttribute[] attrs, ArrayList result) throws JavaModelException {
152
	private static void addLibraryEntry(IProject project, IPluginLibrary library, IPath sourceAttachment, IClasspathAttribute[] attrs, ArrayList result) throws JavaModelException {
150
		String name = ClasspathUtilCore.expandLibraryName(library.getName());
153
		String name = ClasspathUtilCore.expandLibraryName(library.getName());
151
		IResource jarFile = project.findMember(name);
154
		IResource jarFile = project.findMember(name);
152
		if (jarFile == null)
155
		if (jarFile == null)
Lines 161-194 Link Here
161
			}
164
			}
162
		}
165
		}
163
166
164
		IClasspathEntry entry = createClasspathEntry(project, jarFile, name, attrs, library.isExported());
167
		IClasspathEntry entry = createClasspathEntry(project, jarFile, name, sourceAttachment, attrs, library.isExported());
165
		if (!result.contains(entry))
168
		if (!result.contains(entry))
166
			result.add(entry);
169
			result.add(entry);
167
	}
170
	}
168
171
169
	private static void addJARdPlugin(IProject project, String filename, IClasspathAttribute[] attrs, ArrayList result) {
172
	private static void addJARdPlugin(IProject project, String filename, IPath sourceAttachment, IClasspathAttribute[] attrs, ArrayList result) {
170
		String name = ClasspathUtilCore.expandLibraryName(filename);
173
		String name = ClasspathUtilCore.expandLibraryName(filename);
171
		IResource jarFile = project.findMember(name);
174
		IResource jarFile = project.findMember(name);
172
		if (jarFile != null) {
175
		if (jarFile != null) {
173
			IClasspathEntry entry = createClasspathEntry(project, jarFile, filename, attrs, true);
176
			IClasspathEntry entry = createClasspathEntry(project, jarFile, filename, sourceAttachment, attrs, true);
174
			if (!result.contains(entry))
177
			if (!result.contains(entry))
175
				result.add(entry);
178
				result.add(entry);
176
		}
179
		}
177
	}
180
	}
178
181
179
	private static IClasspathEntry createClasspathEntry(IProject project, IResource library, String fileName, IClasspathAttribute[] attrs, boolean isExported) {
182
	private static IClasspathEntry createClasspathEntry(IProject project, IResource library, String fileName, IPath sourceAttachment, IClasspathAttribute[] attrs, boolean isExported) {
180
		String sourceZipName = ClasspathUtilCore.getSourceZipName(fileName);
183
		IResource resource = sourceAttachment != null ? project.findMember(sourceAttachment) : project.findMember(ClasspathUtilCore.getSourceZipName(fileName));
181
		IResource resource = project.findMember(sourceZipName);
184
		// TODO This case may no longer be needed as the source can be any name, the source attachment should be specified in this case
182
		// if zip file does not exist, see if a directory with the source does.  This in necessary how we import source for individual source bundles.
185
//		if (resource == null) {
183
		if (resource == null && sourceZipName.endsWith(".zip")) { //$NON-NLS-1$
186
//			// If a specific library zip can't be found, look for the common source jar as is may have multiple source roots
184
			resource = project.findMember(sourceZipName.substring(0, sourceZipName.length() - 4));
187
//			resource = project.getFile(project.getName() + "src.zip"); //$NON-NLS-1$
185
			if (resource == null)
188
//		}		
186
				// if we can't find the the source for a library, then try to find the common source location set up to share source from one jar to all libraries.
189
		return JavaCore.newLibraryEntry(library.getFullPath(), resource == null ? null : resource.getFullPath(), null, new IAccessRule[0], attrs, isExported);
187
				// see PluginImportOperation.linkSourceArchives
188
				resource = project.getFile(project.getName() + "src.zip"); //$NON-NLS-1$
189
		}
190
		IPath srcAttachment = resource != null ? resource.getFullPath() : library.getFullPath();
191
		return JavaCore.newLibraryEntry(library.getFullPath(), srcAttachment, null, new IAccessRule[0], attrs, isExported);
192
	}
190
	}
193
191
194
	private static String getExecutionEnvironment(BundleDescription bundleDescription) {
192
	private static String getExecutionEnvironment(BundleDescription bundleDescription) {

Return to bug 245565