### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core.tests.model Index: src/org/eclipse/jdt/core/tests/model/JavaProjectTests.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaProjectTests.java,v retrieving revision 1.100 diff -u -r1.100 JavaProjectTests.java --- src/org/eclipse/jdt/core/tests/model/JavaProjectTests.java 27 Jun 2008 16:02:38 -0000 1.100 +++ src/org/eclipse/jdt/core/tests/model/JavaProjectTests.java 18 Aug 2008 11:17:49 -0000 @@ -961,6 +961,23 @@ } } /* + * Ensures that an internal jar referred to with its OS-path is not part of the non-Java resources + */ +public void testGetNonJavaResources5() throws CoreException { + try { + IJavaProject project = this.createJavaProject("P", new String[] {"src"}, "bin"); + IFile file = createFile("/P/lib.jar", ""); + addLibraryEntry(project, file.getLocation(), false/*not exported*/); + assertResourcesEqual( + "Unexpected non-java resources for project", + "/P/.classpath\n" + + "/P/.project", + project.getNonJavaResources()); + } finally { + this.deleteProject("P"); + } +} +/* * Ensures that getRequiredProjectNames() returns the project names in the classpath order * (regression test for bug 25605 [API] someJavaProject.getRequiredProjectNames(); API should specify that the array is returned in ClassPath order) */ #P org.eclipse.jdt.core Index: model/org/eclipse/jdt/internal/core/JavaProjectElementInfo.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaProjectElementInfo.java,v retrieving revision 1.55 diff -u -r1.55 JavaProjectElementInfo.java --- model/org/eclipse/jdt/internal/core/JavaProjectElementInfo.java 27 Jun 2008 16:03:50 -0000 1.55 +++ model/org/eclipse/jdt/internal/core/JavaProjectElementInfo.java 18 Aug 2008 11:17:50 -0000 @@ -134,7 +134,8 @@ String resName = res.getName(); // ignore a jar file on the classpath - if (isClasspathResolved && isClasspathEntryOrOutputLocation(resFullPath, classpath, projectOutput)) { + if (isClasspathResolved && + isClasspathEntryOrOutputLocation(resFullPath, res.getLocation()/* see https://bugs.eclipse.org/bugs/show_bug.cgi?id=244406 */, classpath, projectOutput)) { break; } // ignore .java file if src == project @@ -164,7 +165,7 @@ // ignore non-excluded folders on the classpath or that correspond to an output location if ((srcIsProject && !Util.isExcluded(res, inclusionPatterns, exclusionPatterns) && Util.isValidFolderNameForPackage(res.getName(), sourceLevel, complianceLevel)) - || (isClasspathResolved && isClasspathEntryOrOutputLocation(resFullPath, classpath, projectOutput))) { + || (isClasspathResolved && isClasspathEntryOrOutputLocation(resFullPath, res.getLocation(), classpath, projectOutput))) { break; } // else add non java resource @@ -264,11 +265,12 @@ /* * Returns whether the given path is a classpath entry or an output location. */ - private boolean isClasspathEntryOrOutputLocation(IPath path, IClasspathEntry[] resolvedClasspath, IPath projectOutput) { + private boolean isClasspathEntryOrOutputLocation(IPath path, IPath location, IClasspathEntry[] resolvedClasspath, IPath projectOutput) { if (projectOutput.equals(path)) return true; for (int i = 0, length = resolvedClasspath.length; i < length; i++) { IClasspathEntry entry = resolvedClasspath[i]; - if (entry.getPath().equals(path)) { + IPath entryPath; + if ((entryPath = entry.getPath()).equals(path) || entryPath.equals(location)) { return true; } IPath output;