diff options
author | Shawn O. Pearce <spearce@spearce.org> | 2010-08-23 09:46:14 -0700 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2010-08-23 09:46:14 -0700 |
commit | 22b285695a2980824c15363ef5fec709ebc3d434 (patch) | |
tree | 911f67d4c6edbb7f4cc653ce874265ada774b791 /org.eclipse.jgit/src/org/eclipse/jgit/lib | |
parent | 6a51d97948a29c262c5b506466425c3169a56947 (diff) | |
download | jgit-22b285695a2980824c15363ef5fec709ebc3d434.tar.gz jgit-22b285695a2980824c15363ef5fec709ebc3d434.zip |
Rename Commit, Tag to CommitBuilder, TagBuilder
Since these types no longer support reading, calling them a Builder
is a better description of what they do. They help the caller to
build a commit or a tag object.
Change-Id: I53cae5a800a66ea1721b0fe5e702599df31da05d
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/lib')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/lib/CommitBuilder.java (renamed from org.eclipse.jgit/src/org/eclipse/jgit/lib/Commit.java) | 4 | ||||
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectInserter.java | 4 | ||||
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectWriter.java | 4 | ||||
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java | 4 | ||||
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/lib/TagBuilder.java (renamed from org.eclipse.jgit/src/org/eclipse/jgit/lib/Tag.java) | 2 |
5 files changed, 9 insertions, 9 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Commit.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/CommitBuilder.java index 8fc46c915c..8457d45496 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Commit.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/CommitBuilder.java @@ -59,7 +59,7 @@ import java.util.List; * and obtain a {@link org.eclipse.jgit.revwalk.RevCommit} instance by calling * {@link org.eclipse.jgit.revwalk.RevWalk#parseCommit(AnyObjectId)}. */ -public class Commit { +public class CommitBuilder { private static final ObjectId[] EMPTY_OBJECTID_LIST = new ObjectId[0]; private ObjectId commitId; @@ -77,7 +77,7 @@ public class Commit { private Charset encoding; /** Initialize an empty commit. */ - public Commit() { + public CommitBuilder() { parentIds = EMPTY_OBJECTID_LIST; encoding = Constants.CHARSET; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectInserter.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectInserter.java index 369dd6e4c2..94d792858f 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectInserter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectInserter.java @@ -303,7 +303,7 @@ public abstract class ObjectInserter { * @throws UnsupportedEncodingException * the commit's chosen encoding isn't supported on this JVM. */ - public final byte[] format(Commit commit) + public final byte[] format(CommitBuilder commit) throws UnsupportedEncodingException { Charset encoding = commit.getEncoding(); ByteArrayOutputStream os = new ByteArrayOutputStream(); @@ -362,7 +362,7 @@ public abstract class ObjectInserter { * the tag object to format * @return canonical encoding of the tag object. */ - public final byte[] format(Tag tag) { + public final byte[] format(TagBuilder tag) { ByteArrayOutputStream os = new ByteArrayOutputStream(); OutputStreamWriter w = new OutputStreamWriter(os, Constants.CHARSET); try { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectWriter.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectWriter.java index ce91efb8e4..5cb4b21689 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectWriter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectWriter.java @@ -172,7 +172,7 @@ public class ObjectWriter { * @return SHA-1 of the commit * @throws IOException */ - public ObjectId writeCommit(Commit commit) throws IOException { + public ObjectId writeCommit(CommitBuilder commit) throws IOException { try { ObjectId id = inserter.insert(OBJ_COMMIT, inserter.format(commit)); inserter.flush(); @@ -190,7 +190,7 @@ public class ObjectWriter { * @return SHA-1 of the tag * @throws IOException */ - public ObjectId writeTag(Tag tag) throws IOException { + public ObjectId writeTag(TagBuilder tag) throws IOException { try { ObjectId id = inserter.insert(OBJ_TAG, inserter.format(tag)); inserter.flush(); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java index 2742cd4e50..c910889f68 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java @@ -1091,7 +1091,7 @@ public abstract class Repository { * file operations triggering a merge will store the IDs of all heads which * should be merged together with HEAD. * - * @return a list of {@link Commit}s which IDs are listed in the MERGE_HEAD + * @return a list of commits which IDs are listed in the MERGE_HEAD * file or {@code null} if this file doesn't exist. Also if the file * exists but is empty {@code null} will be returned * @throws IOException @@ -1130,7 +1130,7 @@ public abstract class Repository { * the file will be deleted * * @param heads - * a list of {@link Commit}s which IDs should be written to + * a list of commits which IDs should be written to * $GIT_DIR/MERGE_HEAD or <code>null</code> to delete the file * @throws IOException */ diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Tag.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/TagBuilder.java index fda6b1cb1b..6cd0e9e882 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Tag.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/TagBuilder.java @@ -57,7 +57,7 @@ import org.eclipse.jgit.revwalk.RevObject; * and obtain a {@link org.eclipse.jgit.revwalk.RevTag} instance by calling * {@link org.eclipse.jgit.revwalk.RevWalk#parseTag(AnyObjectId)}. */ -public class Tag { +public class TagBuilder { private ObjectId tagId; private ObjectId object; |