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 178248 Details for
Bug 324367
IJavaProject.findPackageFragmentRoots(IClasspathEntry cpe) returns empty list
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Updated patch with test
bug_324367.txt (text/plain), 3.52 KB, created by
Jay Arthanareeswaran
on 2010-09-06 04:44:47 EDT
(
hide
)
Description:
Updated patch with test
Filename:
MIME Type:
Creator:
Jay Arthanareeswaran
Created:
2010-09-06 04:44:47 EDT
Size:
3.52 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: model/org/eclipse/jdt/internal/core/JavaProject.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaProject.java,v >retrieving revision 1.435 >diff -u -r1.435 JavaProject.java >--- model/org/eclipse/jdt/internal/core/JavaProject.java 3 Sep 2010 15:44:26 -0000 1.435 >+++ model/org/eclipse/jdt/internal/core/JavaProject.java 6 Sep 2010 08:41:12 -0000 >@@ -1210,10 +1210,12 @@ > IClasspathEntry[] classpath = getRawClasspath(); > for (int i = 0, length = classpath.length; i < length; i++) { > if (classpath[i].equals(entry)) { // entry may need to be resolved >+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=324367 >+ // consider referred projects as per API doc > return > computePackageFragmentRoots( > resolveClasspath(new IClasspathEntry[] {entry}), >- false, // don't retrieve exported roots >+ true, > null); /*no reverse map*/ > } > } >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/model/ClasspathTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClasspathTests.java,v >retrieving revision 1.215 >diff -u -r1.215 ClasspathTests.java >--- src/org/eclipse/jdt/core/tests/model/ClasspathTests.java 27 May 2010 10:10:45 -0000 1.215 >+++ src/org/eclipse/jdt/core/tests/model/ClasspathTests.java 6 Sep 2010 08:41:15 -0000 >@@ -6747,5 +6747,49 @@ > ContainerInitializer.setInitializer(null); > } > } >+/** >+ * @bug 324367: IJavaProject.findPackageFragmentRoots(IClasspathEntry cpe) returns empty list >+ * >+ * Test that exported classpath entries from the referenced project are included when invoked >+ * the API org.eclipse.jdt.core.IJavaProject.findPackageFragmentRoots(IClasspathEntry) >+ * >+ * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=324367" >+ * @throws Exception >+ */ >+public void testBug324367() throws Exception { >+ try { >+ IJavaProject referencingProject = this.createJavaProject("ReferencingProject", new String[] {}, "bin"); >+ IJavaProject referencedProject = this.createJavaProject("ReferencedProject", new String[] {}, "bin"); >+ >+ addLibrary(referencedProject, "lib.jar", null, new String[0], >+ new String[] { >+ "META-INF/MANIFEST.MF", >+ "Manifest-Version: 1.0\n", >+ }, >+ JavaCore.VERSION_1_4); >+ IClasspathEntry[] classpath = new IClasspathEntry[1]; >+ classpath[0] = JavaCore.newLibraryEntry(new Path("/ReferencedProject/lib.jar"), null, null,true); >+ setClasspath(referencedProject, classpath); >+ >+ classpath = new IClasspathEntry[1]; >+ classpath[0] = JavaCore.newProjectEntry(new Path("/ReferencedProject"), false); >+ setClasspath(referencingProject, classpath); >+ >+ IClasspathEntry referencedProjectCPE = null; >+ IClasspathEntry[] rawClasspath = referencingProject.getRawClasspath(); >+ for(int index = 0; index < rawClasspath.length; index++) { >+ IClasspathEntry cpe = rawClasspath[index]; >+ if (cpe.getPath().equals(referencedProject.getPath())) { >+ referencedProjectCPE = cpe; >+ break; >+ } >+ } >+ assertEquals("No package fragment roots found referenced project", 1, referencingProject.findPackageFragmentRoots(referencedProjectCPE).length); >+ >+ } finally { >+ deleteProject("ReferencingProject"); >+ deleteProject("ReferencedProject"); >+ } >+} > > }
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 324367
:
178116
|
178134
|
178248
|
179224
|
184336
|
184342
|
184524