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 79412 Details for
Bug 154593
PDE Tools > Update Classpath deletes Access-Rules
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]
Work in progress
154593ClasspathAccessRules.patch (text/plain), 4.04 KB, created by
Curtis Windatt
on 2007-09-28 13:11:12 EDT
(
hide
)
Description:
Work in progress
Filename:
MIME Type:
Creator:
Curtis Windatt
Created:
2007-09-28 13:11:12 EDT
Size:
4.04 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.pde.ui >Index: src/org/eclipse/pde/internal/ui/wizards/plugin/ClasspathComputer.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/ClasspathComputer.java,v >retrieving revision 1.15 >diff -u -r1.15 ClasspathComputer.java >--- src/org/eclipse/pde/internal/ui/wizards/plugin/ClasspathComputer.java 8 Jun 2007 16:37:10 -0000 1.15 >+++ src/org/eclipse/pde/internal/ui/wizards/plugin/ClasspathComputer.java 28 Sep 2007 17:06:41 -0000 >@@ -59,24 +59,22 @@ > } > > public static IClasspathEntry[] getClasspath(IProject project, IPluginModelBase model, boolean clear) throws CoreException { >- >+ IJavaProject javaProject = JavaCore.create(project); > ArrayList result = new ArrayList(); >- > IBuild build = getBuild(project); > > // add own libraries/source > addSourceAndLibraries(project, model, build, clear, result); >- >+ > // add JRE and set compliance options > String ee = getExecutionEnvironment(model.getBundleDescription()); >- result.add(createJREEntry(ee)); >+ result.add(createJREEntryUsingPreviousEntry(javaProject, ee)); > setComplianceOptions(JavaCore.create(project), ExecutionEnvironmentAnalyzer.getCompliance(ee)); > > // add pde container > result.add(createContainerEntry()); > > IClasspathEntry[] entries = (IClasspathEntry[]) result.toArray(new IClasspathEntry[result.size()]); >- IJavaProject javaProject = JavaCore.create(project); > IJavaModelStatus validation = > JavaConventions.validateClasspath( > javaProject, >@@ -295,8 +293,46 @@ > } > } > >+ /** >+ * Returns a new classpath container entry for the given execution environment. If the given java project >+ * has an existing JRE/EE classpath entry, the access rules, extra attributes and isExported settings of >+ * the existing entry will be added to the new execution entry. >+ * >+ * @param javaProject project to check for existing JRE/EE classpath entries >+ * @param ee id of the execution environment to create an entry for >+ * @return new classpath container entry >+ * @throws CoreException if there is a problem accessing the classpath entries of the project >+ */ >+ public static IClasspathEntry createJREEntryUsingPreviousEntry(IJavaProject javaProject, String ee) throws CoreException { >+ IClasspathEntry existingEntry = null; >+ IClasspathEntry[] entries = javaProject.getRawClasspath(); >+ for (int i = 0; i < entries.length; i++) { >+ if (entries[i].getPath().segment(0).equals(JavaRuntime.JRE_CONTAINER)){ >+ existingEntry = entries[i]; >+ break; >+ } >+ } >+ if (existingEntry == null){ >+ return createJREEntry(ee); >+ } >+ return JavaCore.newContainerEntry(getEEPath(ee), existingEntry.getAccessRules(), existingEntry.getExtraAttributes(), existingEntry.isExported()); >+ } > >+ /** >+ * Returns a classpath container entry for the given execution environment. >+ * @param ee id of the execution environment >+ * @return classpath container entry >+ */ > public static IClasspathEntry createJREEntry(String ee) { >+ return JavaCore.newContainerEntry(getEEPath(ee)); >+ } >+ >+ /** >+ * Returns the JRE container path for the execution environment with the given id. >+ * @param ee execution environment id >+ * @return JRE container path for the execution environment >+ */ >+ private static IPath getEEPath(String ee){ > IPath path = null; > if (ee != null) { > IExecutionEnvironmentsManager manager = JavaRuntime.getExecutionEnvironmentsManager(); >@@ -304,11 +340,15 @@ > if (env != null) > path = JavaRuntime.newJREContainerPath(env); > } >- if (path == null) >+ if (path == null){ > path = JavaRuntime.newDefaultJREContainerPath(); >- return JavaCore.newContainerEntry(path); >+ } >+ return path; > } > >+ /** >+ * @return a new classpath container entry for a required plugin container >+ */ > public static IClasspathEntry createContainerEntry() { > return JavaCore.newContainerEntry(PDECore.REQUIRED_PLUGINS_CONTAINER_PATH); > }
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 154593
:
79412
|
87709
|
88893
|
88894