Lines 134-140
Link Here
|
134 |
String resName = res.getName(); |
134 |
String resName = res.getName(); |
135 |
|
135 |
|
136 |
// ignore a jar file on the classpath |
136 |
// ignore a jar file on the classpath |
137 |
if (isClasspathResolved && isClasspathEntryOrOutputLocation(resFullPath, classpath, projectOutput)) { |
137 |
if (isClasspathResolved && |
|
|
138 |
isClasspathEntryOrOutputLocation(resFullPath, res.getLocation()/* see https://bugs.eclipse.org/bugs/show_bug.cgi?id=244406 */, classpath, projectOutput)) { |
138 |
break; |
139 |
break; |
139 |
} |
140 |
} |
140 |
// ignore .java file if src == project |
141 |
// ignore .java file if src == project |
Lines 164-170
Link Here
|
164 |
|
165 |
|
165 |
// ignore non-excluded folders on the classpath or that correspond to an output location |
166 |
// ignore non-excluded folders on the classpath or that correspond to an output location |
166 |
if ((srcIsProject && !Util.isExcluded(res, inclusionPatterns, exclusionPatterns) && Util.isValidFolderNameForPackage(res.getName(), sourceLevel, complianceLevel)) |
167 |
if ((srcIsProject && !Util.isExcluded(res, inclusionPatterns, exclusionPatterns) && Util.isValidFolderNameForPackage(res.getName(), sourceLevel, complianceLevel)) |
167 |
|| (isClasspathResolved && isClasspathEntryOrOutputLocation(resFullPath, classpath, projectOutput))) { |
168 |
|| (isClasspathResolved && isClasspathEntryOrOutputLocation(resFullPath, res.getLocation(), classpath, projectOutput))) { |
168 |
break; |
169 |
break; |
169 |
} |
170 |
} |
170 |
// else add non java resource |
171 |
// else add non java resource |
Lines 264-274
Link Here
|
264 |
/* |
265 |
/* |
265 |
* Returns whether the given path is a classpath entry or an output location. |
266 |
* Returns whether the given path is a classpath entry or an output location. |
266 |
*/ |
267 |
*/ |
267 |
private boolean isClasspathEntryOrOutputLocation(IPath path, IClasspathEntry[] resolvedClasspath, IPath projectOutput) { |
268 |
private boolean isClasspathEntryOrOutputLocation(IPath path, IPath location, IClasspathEntry[] resolvedClasspath, IPath projectOutput) { |
268 |
if (projectOutput.equals(path)) return true; |
269 |
if (projectOutput.equals(path)) return true; |
269 |
for (int i = 0, length = resolvedClasspath.length; i < length; i++) { |
270 |
for (int i = 0, length = resolvedClasspath.length; i < length; i++) { |
270 |
IClasspathEntry entry = resolvedClasspath[i]; |
271 |
IClasspathEntry entry = resolvedClasspath[i]; |
271 |
if (entry.getPath().equals(path)) { |
272 |
IPath entryPath; |
|
|
273 |
if ((entryPath = entry.getPath()).equals(path) || entryPath.equals(location)) { |
272 |
return true; |
274 |
return true; |
273 |
} |
275 |
} |
274 |
IPath output; |
276 |
IPath output; |