Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] IndexOutOfBoundsException in RawParseUtils.decodeNoFallback

Shawn Pearce wrote:
> On Mon, Mar 22, 2010 at 8:00 AM, Marc Strapetz
> <marc.strapetz@xxxxxxxxxxx> wrote:
>> One of our users has reported following exception against an older
>> version of jgit (so I have skipped line numbers):
>>
>> java.lang.IndexOutOfBoundsException
>>  at java.nio.ByteBuffer.wrap
>>  at org.eclipse.jgit.util.RawParseUtils.decodeNoFallback
>>  at org.eclipse.jgit.util.RawParseUtils.decode
>>  at org.eclipse.jgit.util.RawParseUtils.parsePersonIdent
>>  at org.eclipse.jgit.revwalk.RevCommit.getAuthorIdent
>>
>> AFAIU this is caused by a strange (or even invalid?) author-line in the
>> commit. RawParseUtils.parsePersonIdent is not fault-tolerant here. Now
>> I'm wondering how to fix that best:
>>
>> Check emailB and emailE and, if these indices are bad, return a PersonIdent?
>>
>> Or even return null if something is wrong?
> 
> Return null if the identity cannot be parsed.  A malformed identity is
> essentially not present.  Though I'd be interested in knowing what the
> malformed identity looks like, maybe our parsing is being a bit too
> strict.

User told us that the repository has been converted by hg-fast-export.
The problem is already present in the hg repository and "git show" gives
him:

> git show 95f79d23b223215addf2cf4fbd204a83dc9b29e4
commit 95f79d23b223215addf2cf4fbd204a83dc9b29e4
Author: <>
Date:   Thu Jan 1 00:00:00 1970 +0000

    Added tag RELEASE_2_0_13 for changeset 484f76fab6c7

--
Best regards,
Marc Strapetz
=============
syntevo GmbH
http://www.syntevo.com
http://blog.syntevo.com


Back to the top