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 87709 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
[patch]
Patch
154593UpdateClasspath.patch (text/plain), 4.19 KB, created by
Curtis Windatt
on 2008-01-23 16:47:59 EST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Curtis Windatt
Created:
2008-01-23 16:47:59 EST
Size:
4.19 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.18 >diff -u -r1.18 ClasspathComputer.java >--- src/org/eclipse/pde/internal/ui/wizards/plugin/ClasspathComputer.java 16 Jan 2008 17:08:33 -0000 1.18 >+++ src/org/eclipse/pde/internal/ui/wizards/plugin/ClasspathComputer.java 23 Jan 2008 21:45:43 -0000 >@@ -40,9 +40,8 @@ > } > > 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 >@@ -50,14 +49,13 @@ > > // 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, entries, javaProject.getOutputLocation()); > if (!validation.isOK()) { > PDECore.logErrorMessage(validation.getMessage()); >@@ -275,7 +273,48 @@ > } > } > >+ /** >+ * 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; >+ } >+ } >+ IPath newPath = getEEPath(ee); >+ if (existingEntry != null && existingEntry.getPath().equals(newPath)) { >+ return JavaCore.newContainerEntry(getEEPath(ee), existingEntry.getAccessRules(), existingEntry.getExtraAttributes(), existingEntry.isExported()); >+ } >+ return JavaCore.newContainerEntry(newPath); >+ >+ } >+ >+ /** >+ * 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(); >@@ -283,11 +322,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