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 179224 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]
Patch with updated test
bug_324367.txt (text/plain), 3.63 KB, created by
Jay Arthanareeswaran
on 2010-09-20 03:28:10 EDT
(
hide
)
Description:
Patch with updated test
Filename:
MIME Type:
Creator:
Jay Arthanareeswaran
Created:
2010-09-20 03:28:10 EDT
Size:
3.63 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.437 >diff -u -r1.437 JavaProject.java >--- model/org/eclipse/jdt/internal/core/JavaProject.java 13 Sep 2010 18:26:08 -0000 1.437 >+++ model/org/eclipse/jdt/internal/core/JavaProject.java 20 Sep 2010 07:25:54 -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- IJavaProject#findPackageFragmentRoots > 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.216 >diff -u -r1.216 ClasspathTests.java >--- src/org/eclipse/jdt/core/tests/model/ClasspathTests.java 9 Sep 2010 06:18:14 -0000 1.216 >+++ src/org/eclipse/jdt/core/tests/model/ClasspathTests.java 20 Sep 2010 07:25:57 -0000 >@@ -6767,6 +6767,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[] {"src"}, "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[2]; >+ classpath[0] = JavaCore.newSourceEntry(new Path("/ReferencedProject/src"), new Path[0]); >+ classpath[1] = 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("Incorrect package fragment roots", 2, 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