From eb2cfd4552ae07bbf490209717283993edd3a98a Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 7 Dec 2011 10:21:41 -0800 Subject: [PATCH] Use System.arraycopy to copy parent object id array Change-Id: Iee475584f0a65b8b77610cd277f15295b68dfe80 --- org.eclipse.jgit/src/org/eclipse/jgit/lib/CommitBuilder.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/CommitBuilder.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/CommitBuilder.java index 8c6f809cb..239140713 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/CommitBuilder.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/CommitBuilder.java @@ -204,8 +204,7 @@ public class CommitBuilder { setParentId(additionalParent); } else { ObjectId[] newParents = new ObjectId[parentIds.length + 1]; - for (int i = 0; i < parentIds.length; i++) - newParents[i] = parentIds[i]; + System.arraycopy(parentIds, 0, newParents, 0, parentIds.length); newParents[parentIds.length] = additionalParent.copy(); parentIds = newParents; }