DirCache: Fix getEntriesWithin("") to not include null entries
The internal array may be longer than entryCnt, in this case the tail of the array is padded with null entries. Do not return those to the caller of getEntriesWithin(). Change-Id: I19efb05e103fab6b739ced407f6e28155a48dba6
This commit is contained in:
parent
46e4992e92
commit
885879ffe9
|
@ -877,8 +877,8 @@ public DirCacheEntry getEntry(final String path) {
|
||||||
*/
|
*/
|
||||||
public DirCacheEntry[] getEntriesWithin(String path) {
|
public DirCacheEntry[] getEntriesWithin(String path) {
|
||||||
if (path.length() == 0) {
|
if (path.length() == 0) {
|
||||||
final DirCacheEntry[] r = new DirCacheEntry[sortedEntries.length];
|
DirCacheEntry[] r = new DirCacheEntry[entryCnt];
|
||||||
System.arraycopy(sortedEntries, 0, r, 0, sortedEntries.length);
|
System.arraycopy(sortedEntries, 0, r, 0, entryCnt);
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
if (!path.endsWith("/")) //$NON-NLS-1$
|
if (!path.endsWith("/")) //$NON-NLS-1$
|
||||||
|
|
Loading…
Reference in New Issue