View | Details | Raw Unified | Return to bug 154593 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/pde/internal/core/PDECore.java (-13 / +4 lines)
Lines 13-34 Link Here
13
import java.io.IOException;
13
import java.io.IOException;
14
import java.lang.reflect.InvocationTargetException;
14
import java.lang.reflect.InvocationTargetException;
15
import java.net.URL;
15
import java.net.URL;
16
17
import org.eclipse.core.resources.IWorkspace;
16
import org.eclipse.core.resources.IWorkspace;
18
import org.eclipse.core.resources.ResourcesPlugin;
17
import org.eclipse.core.resources.ResourcesPlugin;
19
import org.eclipse.core.runtime.CoreException;
18
import org.eclipse.core.runtime.*;
20
import org.eclipse.core.runtime.FileLocator;
19
import org.eclipse.jdt.launching.JavaRuntime;
21
import org.eclipse.core.runtime.IPath;
22
import org.eclipse.core.runtime.IStatus;
23
import org.eclipse.core.runtime.NullProgressMonitor;
24
import org.eclipse.core.runtime.Path;
25
import org.eclipse.core.runtime.Plugin;
26
import org.eclipse.core.runtime.QualifiedName;
27
import org.eclipse.core.runtime.Status;
28
import org.eclipse.pde.core.plugin.IPluginModelBase;
20
import org.eclipse.pde.core.plugin.IPluginModelBase;
29
import org.eclipse.pde.internal.core.builders.CompilerFlags;
21
import org.eclipse.pde.internal.core.builders.*;
30
import org.eclipse.pde.internal.core.builders.FeatureRebuilder;
31
import org.eclipse.pde.internal.core.builders.PluginRebuilder;
32
import org.eclipse.pde.internal.core.schema.SchemaRegistry;
22
import org.eclipse.pde.internal.core.schema.SchemaRegistry;
33
import org.eclipse.update.configurator.ConfiguratorUtils;
23
import org.eclipse.update.configurator.ConfiguratorUtils;
34
import org.osgi.framework.BundleContext;
24
import org.osgi.framework.BundleContext;
Lines 38-43 Link Here
38
28
39
	public static final IPath REQUIRED_PLUGINS_CONTAINER_PATH = new Path(PLUGIN_ID + ".requiredPlugins"); //$NON-NLS-1$
29
	public static final IPath REQUIRED_PLUGINS_CONTAINER_PATH = new Path(PLUGIN_ID + ".requiredPlugins"); //$NON-NLS-1$
40
	public static final IPath JAVA_SEARCH_CONTAINER_PATH = new Path(PLUGIN_ID + ".externalJavaSearch"); //$NON-NLS-1$
30
	public static final IPath JAVA_SEARCH_CONTAINER_PATH = new Path(PLUGIN_ID + ".externalJavaSearch"); //$NON-NLS-1$
31
	public static final IPath JRE_CONTAINER_PATH = new Path(JavaRuntime.JRE_CONTAINER);
41
32
42
	public static final String BINARY_PROJECT_VALUE = "binary"; //$NON-NLS-1$
33
	public static final String BINARY_PROJECT_VALUE = "binary"; //$NON-NLS-1$
43
	public static final String BINARY_REPOSITORY_PROVIDER = PLUGIN_ID + "." + "BinaryRepositoryProvider"; //$NON-NLS-1$ //$NON-NLS-2$
34
	public static final String BINARY_REPOSITORY_PROVIDER = PLUGIN_ID + "." + "BinaryRepositoryProvider"; //$NON-NLS-1$ //$NON-NLS-2$
(-)src/org/eclipse/pde/internal/ui/wizards/plugin/ClasspathComputer.java (-11 / +15 lines)
Lines 49-59 Link Here
49
49
50
		// add JRE and set compliance options
50
		// add JRE and set compliance options
51
		String ee = getExecutionEnvironment(model.getBundleDescription());
51
		String ee = getExecutionEnvironment(model.getBundleDescription());
52
		result.add(createJREEntryUsingPreviousEntry(javaProject, ee));
52
		result.add(createEntryUsingPreviousEntry(javaProject, ee, PDECore.JRE_CONTAINER_PATH));
53
		setComplianceOptions(JavaCore.create(project), ExecutionEnvironmentAnalyzer.getCompliance(ee));
53
		setComplianceOptions(JavaCore.create(project), ExecutionEnvironmentAnalyzer.getCompliance(ee));
54
54
55
		// add pde container
55
		// add pde container
56
		result.add(createContainerEntry());
56
		result.add(createEntryUsingPreviousEntry(javaProject, ee, PDECore.REQUIRED_PLUGINS_CONTAINER_PATH));
57
57
58
		IClasspathEntry[] entries = (IClasspathEntry[]) result.toArray(new IClasspathEntry[result.size()]);
58
		IClasspathEntry[] entries = (IClasspathEntry[]) result.toArray(new IClasspathEntry[result.size()]);
59
		IJavaModelStatus validation = JavaConventions.validateClasspath(javaProject, entries, javaProject.getOutputLocation());
59
		IJavaModelStatus validation = JavaConventions.validateClasspath(javaProject, entries, javaProject.getOutputLocation());
Lines 278-301 Link Here
278
	 * has an existing JRE/EE classpath entry, the access rules, extra attributes and isExported settings of
278
	 * has an existing JRE/EE classpath entry, the access rules, extra attributes and isExported settings of
279
	 * the existing entry will be added to the new execution entry.
279
	 * the existing entry will be added to the new execution entry.
280
	 *  
280
	 *  
281
	 * @param javaProject project to check for existing JRE/EE classpath entries
281
	 * @param javaProject project to check for existing classpath entries
282
	 * @param ee id of the execution environment to create an entry for
282
	 * @param ee id of the execution environment to create an entry for
283
	 * @param path id of the container to create an entry for
284
	 * 
283
	 * @return new classpath container entry
285
	 * @return new classpath container entry
284
	 * @throws CoreException if there is a problem accessing the classpath entries of the project
286
	 * @throws CoreException if there is a problem accessing the classpath entries of the project
285
	 */
287
	 */
286
	public static IClasspathEntry createJREEntryUsingPreviousEntry(IJavaProject javaProject, String ee) throws CoreException {
288
	public static IClasspathEntry createEntryUsingPreviousEntry(IJavaProject javaProject, String ee, IPath path) throws CoreException {
287
		IClasspathEntry existingEntry = null;
288
		IClasspathEntry[] entries = javaProject.getRawClasspath();
289
		IClasspathEntry[] entries = javaProject.getRawClasspath();
289
		for (int i = 0; i < entries.length; i++) {
290
		for (int i = 0; i < entries.length; i++) {
290
			if (entries[i].getPath().segment(0).equals(JavaRuntime.JRE_CONTAINER)) {
291
			if (entries[i].getPath().equals(path)) {
291
				existingEntry = entries[i];
292
				if (path.equals(PDECore.JRE_CONTAINER_PATH))
292
				break;
293
					return JavaCore.newContainerEntry(getEEPath(ee), entries[i].getAccessRules(), entries[i].getExtraAttributes(), entries[i].isExported());
294
295
				return JavaCore.newContainerEntry(path, entries[i].getAccessRules(), entries[i].getExtraAttributes(), entries[i].isExported());
293
			}
296
			}
294
		}
297
		}
295
		if (existingEntry == null) {
298
299
		if (path.equals(PDECore.JRE_CONTAINER_PATH))
296
			return createJREEntry(ee);
300
			return createJREEntry(ee);
297
		}
301
298
		return JavaCore.newContainerEntry(getEEPath(ee), existingEntry.getAccessRules(), existingEntry.getExtraAttributes(), existingEntry.isExported());
302
		return JavaCore.newContainerEntry(path);
299
	}
303
	}
300
304
301
	/**
305
	/**

Return to bug 154593