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 globalPathMatches = false; |
205 |
// the most nested path should be the selected one |
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 currentPathMatch = 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 |
currentPathMatch = true; |
210 |
matchingPathName = matchCandidate; |
212 |
if (matchingPathName == null) { |
|
|
213 |
matchingPathName = matchCandidate; |
214 |
} else { |
215 |
if (currentPathMatch) { |
216 |
// we have a second source folder that matches the path of the source file |
217 |
if (matchCandidate.length > matchingPathName.length) { |
218 |
// we want to preserve the shortest possible path |
219 |
matchingPathName = matchCandidate; |
220 |
} |
221 |
} else { |
222 |
// we want to preserve the shortest possible path |
223 |
if (!globalPathMatches && matchCandidate.length < matchingPathName.length) { |
224 |
matchingPathName = matchCandidate; |
225 |
} |
226 |
} |
227 |
} |
228 |
if (currentPathMatch) { |
229 |
globalPathMatches = true; |
230 |
} |
211 |
} |
231 |
} |
212 |
} |
232 |
} |
213 |
if (matchingPathName == null) { |
233 |
if (matchingPathName == null) { |