Skip to main content

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

On Wed, Mar 1, 2017 at 6:45 PM, Marc Strapetz <marc.strapetz@xxxxxxxxxxx> wrote:
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

What's the debug value of ct.getPathString() ?
Can you provide the stack trace of the AIOOBE ?

-Matthias

Back to the top