Lines 201-213
Link Here
|
201 |
fileName = CharOperation.subarray(fileName, 0, lastIndexOf); |
201 |
fileName = CharOperation.subarray(fileName, 0, lastIndexOf); |
202 |
} |
202 |
} |
203 |
CharOperation.replace(fileName, '\\', '/'); |
203 |
CharOperation.replace(fileName, '\\', '/'); |
|
|
204 |
boolean sourcePathMatches = false; |
205 |
// a source path folder should match over a classpath entry set up for both source and binary |
204 |
for (int j = 0, max = this.classpaths.length; j < max; j++) { |
206 |
for (int j = 0, max = this.classpaths.length; j < max; j++) { |
205 |
char[] matchCandidate = this.classpaths[j].normalizedPath(); |
207 |
char[] matchCandidate = this.classpaths[j].normalizedPath(); |
206 |
if (this.classpaths[j] instanceof ClasspathDirectory && |
208 |
boolean currentSourcePathMatch = false; |
207 |
CharOperation.prefixEquals(matchCandidate, fileName) && |
209 |
if (this.classpaths[j] instanceof ClasspathDirectory |
208 |
(matchingPathName == null || |
210 |
&& CharOperation.prefixEquals(matchCandidate, fileName)) { |
209 |
matchCandidate.length < matchingPathName.length)) { |
211 |
ClasspathDirectory classpathDirectory = (ClasspathDirectory) this.classpaths[j]; |
210 |
matchingPathName = matchCandidate; |
212 |
if ((classpathDirectory.mode & (ClasspathLocation.SOURCE | ClasspathLocation.BINARY)) == ClasspathLocation.SOURCE) { |
|
|
213 |
currentSourcePathMatch = true; |
214 |
} |
215 |
if (matchingPathName == null) { |
216 |
matchingPathName = matchCandidate; |
217 |
} else { |
218 |
// if not null, we must keep the current classpath directory if this is a source path folder |
219 |
if (currentSourcePathMatch) { |
220 |
// we have a second source folder that matches the path of the source file |
221 |
if (matchCandidate.length > matchingPathName.length) { |
222 |
// we want to preserve the shortest possible path |
223 |
matchingPathName = matchCandidate; |
224 |
} |
225 |
} else { |
226 |
// if (sourcePathMatches) one former source paths matched - ignore the current match |
227 |
if (!sourcePathMatches && matchCandidate.length < matchingPathName.length) { |
228 |
matchingPathName = matchCandidate; |
229 |
} |
230 |
} |
231 |
} |
232 |
if (currentSourcePathMatch) { |
233 |
sourcePathMatches = true; |
234 |
} |
211 |
} |
235 |
} |
212 |
} |
236 |
} |
213 |
if (matchingPathName == null) { |
237 |
if (matchingPathName == null) { |