Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jgit-dev] AIOOBE in DirCacheTree.namecmp

I've received a .git/index for which an ArrayIndexOutOfBoundsException is raised in org.eclipse.jgit.dircache.DirCacheTree#namecmp, line 553:

  if (bPos == bLen)
    return a[aPos] == '/' ? 0 : -1;

Debug values look like:

new String(a) = "foo/bar/Headers"
ct.toString() = "Headers"
aPos = 14 // aPos == a.length

So from my understanding, the .git/index contains a tree and a file which have the same path.

Any suggestions on how to fix this (i.e. should it return 0 or 1 in this case)?

-Marc





Back to the top