]> source.dussan.org Git - jgit.git/commitdiff
Correct CommitBuilder, TagBuilder method to be build() 26/2026/1
authorShawn O. Pearce <spearce@spearce.org>
Fri, 3 Dec 2010 20:23:39 +0000 (12:23 -0800)
committerShawn O. Pearce <spearce@spearce.org>
Fri, 3 Dec 2010 20:28:00 +0000 (12:28 -0800)
The correct names for these is build(), as that is what a Java
developer will expect given the "builder" pattern.

Bug: 323541
Change-Id: I35042bdc95a955beeaee29e54bde10e4240b2a71
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Reviewed-by: Chris Aniszczyk <caniszczyk@gmail.com>
org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevCommitParseTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevTagParseTest.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/CommitBuilder.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectInserter.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/TagBuilder.java

index 0ad724731e4fbdbd7afd23573d165b8d3e1a1c38..2f278473475d931c270d357c38aa1bd007ce7397 100644 (file)
@@ -338,7 +338,7 @@ public class RevCommitParseTest extends RepositoryTestCase {
                src.setCommitter(committer);
                src.setMessage("Test commit\n\nThis is a test.\n");
 
-               RevCommit p = RevCommit.parse(src.format());
+               RevCommit p = RevCommit.parse(src.build());
                assertEquals(src.getTreeId(), p.getTree());
                assertEquals(0, p.getParentCount());
                assertEquals(author, p.getAuthorIdent());
index c694add449a49205c6106d33588a45b97873ca1f..9300ae2e1b18755b56a2683e8f7a8dbf99c5f538 100644 (file)
@@ -407,7 +407,7 @@ public class RevTagParseTest extends RepositoryTestCase {
                src.setTag("a.test");
                src.setMessage("Test tag\n\nThis is a test.\n");
 
-               RevTag p = RevTag.parse(src.format());
+               RevTag p = RevTag.parse(src.build());
                assertEquals(src.getObjectId(), p.getObject());
                assertEquals(committer, p.getTaggerIdent());
                assertEquals("a.test", p.getTagName());
index 8bd02ee298cbb90a83bd4fc40298895efaee7390..288b1d4831c15171cc818d0c9b65f65693374fa5 100644 (file)
@@ -288,8 +288,8 @@ public class CommitBuilder {
         *             the encoding specified by {@link #getEncoding()} is not
         *             supported by this Java runtime.
         */
-       public byte[] format() throws UnsupportedEncodingException {
-               return format(new ObjectInserter.Formatter());
+       public byte[] build() throws UnsupportedEncodingException {
+               return build(new ObjectInserter.Formatter());
        }
 
        /**
@@ -308,7 +308,7 @@ public class CommitBuilder {
         *             the encoding specified by {@link #getEncoding()} is not
         *             supported by this Java runtime.
         */
-       public byte[] format(ObjectInserter oi) throws UnsupportedEncodingException {
+       public byte[] build(ObjectInserter oi) throws UnsupportedEncodingException {
                ByteArrayOutputStream os = new ByteArrayOutputStream();
                OutputStreamWriter w = new OutputStreamWriter(os, getEncoding());
                try {
index adc20b5b08013ec07274362d317b9a42d9fb7a12..7d02c86ddd36bf96a11e1f2fa2bda35f49e69e13 100644 (file)
@@ -189,7 +189,7 @@ public abstract class ObjectInserter {
         *             the object could not be stored.
         */
        public final ObjectId insert(CommitBuilder builder) throws IOException {
-               return insert(Constants.OBJ_COMMIT, builder.format(this));
+               return insert(Constants.OBJ_COMMIT, builder.build(this));
        }
 
        /**
@@ -205,7 +205,7 @@ public abstract class ObjectInserter {
         *             the object could not be stored.
         */
        public final ObjectId insert(TagBuilder builder) throws IOException {
-               return insert(Constants.OBJ_TAG, builder.format(this));
+               return insert(Constants.OBJ_TAG, builder.build(this));
        }
 
        /**
index 71e46494c61bb51812dae597a09c547ba86880b0..8eadb6145ca465bce8df7c35c960e20ad997d062 100644 (file)
@@ -182,8 +182,8 @@ public class TagBuilder {
         * @return this object in the canonical annotated tag format, suitable for
         *         storage in a repository.
         */
-       public byte[] format() {
-               return format(new ObjectInserter.Formatter());
+       public byte[] build() {
+               return build(new ObjectInserter.Formatter());
        }
 
        /**
@@ -199,7 +199,7 @@ public class TagBuilder {
         * @return this object in the canonical annotated tag format, suitable for
         *         storage in a repository.
         */
-       public byte[] format(ObjectInserter oi) {
+       public byte[] build(ObjectInserter oi) {
                ByteArrayOutputStream os = new ByteArrayOutputStream();
                OutputStreamWriter w = new OutputStreamWriter(os, Constants.CHARSET);
                try {