Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 393054

Summary: Candidate$BlobCandidate.getAuthor throws IAE
Product: [Technology] JGit Reporter: Markus Keller <markus.kell.r>
Component: JGitAssignee: Robin Stocker <robin>
Status: VERIFIED FIXED QA Contact:
Severity: major    
Priority: P3 CC: daniel_megert, matthias.sohn, robin, sop, stepper
Version: 2.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Bug Depends on: 352984    
Bug Blocks:    

Description Markus Keller CLA 2012-10-29 10:42:59 EDT
eclipse.buildId=I20121028-2000
org.eclipse.jgit_2.2.0.201210251911

Tried to perform Show Annotations on a dirty file (added one line).

Candidate$BlobCandidate.getAuthor throws an IAE. Bug 352984 changed the API but missed to fix existing callers. E.g. CommitOperation#setAuthorAndCommitter(CommitCommand) also doesn't ensure the emails are non-null.


Error
Mon Oct 29 15:28:57 CET 2012
E-mail address of PersonIdent must not be null.

java.lang.IllegalArgumentException: E-mail address of PersonIdent must not be null.
	at org.eclipse.jgit.lib.PersonIdent.<init>(PersonIdent.java:186)
	at org.eclipse.jgit.lib.PersonIdent.<init>(PersonIdent.java:162)
	at org.eclipse.jgit.lib.PersonIdent.<init>(PersonIdent.java:101)
	at org.eclipse.jgit.blame.Candidate$BlobCandidate.getAuthor(Candidate.java:383)
	at org.eclipse.jgit.blame.BlameGenerator.getSourceAuthor(BlameGenerator.java:825)
	at org.eclipse.jgit.blame.BlameResult.loadFrom(BlameResult.java:331)
	at org.eclipse.jgit.blame.BlameResult.computeAll(BlameResult.java:240)
	at org.eclipse.jgit.blame.BlameGenerator.computeBlameResult(BlameGenerator.java:436)
	at org.eclipse.jgit.api.BlameCommand.call(BlameCommand.java:221)
	at org.eclipse.egit.ui.internal.blame.BlameOperation.execute(BlameOperation.java:179)
	at org.eclipse.egit.core.internal.job.JobUtil$1.run(JobUtil.java:50)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
Comment 1 Robin Stocker CLA 2012-10-29 16:06:01 EDT
Fix for JGit blame:

https://git.eclipse.org/r/8402

CommitOperation does not handle the case, it's validated much earlier in CommitMessageComponent#getStatus. But it should also be checked in CommitOperation:

https://git.eclipse.org/r/8403
Comment 2 Robin Stocker CLA 2012-10-31 09:19:41 EDT
*** Bug 393230 has been marked as a duplicate of this bug. ***
Comment 3 Dani Megert CLA 2012-11-01 12:46:54 EDT
This is pretty ugly. Can a JGit committer please merge the change?
Comment 4 Shawn Pearce CLA 2012-11-01 12:49:02 EDT
Commit ecf97083e59968723be4a26c1fc12bd69688ae87 submitted for JGit blame.
Comment 5 Dani Megert CLA 2012-11-01 12:51:22 EDT
(In reply to comment #4)
> Commit ecf97083e59968723be4a26c1fc12bd69688ae87 submitted for JGit blame.

Thanks, that was fast!
Comment 6 Dani Megert CLA 2012-11-02 04:26:21 EDT
The "real" problem is fixed and verified in org.eclipse.jgit_2.2.0.201211012011.

https://git.eclipse.org/r/8403 just improved the error case.
Comment 7 Matthias Sohn CLA 2012-11-04 19:15:36 EST
merged https://git.eclipse.org/r/8403
as 4f1c9820d737d87140dd998863610fa9747e8929