{"thread":{"id":"20559","subject":"[JGIT PATCH] Rename RevTag.getName() to RevTag.getTagName()","startedAt":"2009-08-12T19:39:16Z","lastAt":"2009-08-12T20:51:08Z","messageCount":3,"participants":["Shawn O. Pearce","Robin Rosenberg"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"120434","messageId":"1250105956-17795-1-git-send-email-spearce@spearce.org","threadId":"20559","inReplyTo":null,"subject":"[JGIT PATCH] Rename RevTag.getName() to RevTag.getTagName()","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2009-08-12T19:39:16Z","receivedAt":"2009-08-12T19:39:16Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"The method getName() conflicts semantically with the method name()\nwe have inherited from our base class, ObjectId.  It is a rather\nunfortunate turn of events that for performance reasons we wind up\nsubclassing what should be a property of this class, but since we\ndo that we need to pay attention to the methods declared on our\nbase class.\n\nWe want to use getName() to be a mirror of name() on AnyObjectId,\nas it has a more JavaBeans style feel to the accessing of that\nparticular value.  So, rename getTagName() so it doesn't wind up\nconflicting with the SHA-1 hex formatted string.\n\nNoticed-by: Alex Blewitt <alex.blewitt@gmail.com>\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n .../src/org/spearce/jgit/revwalk/RevTag.java       |    8 ++++----\n 1 files changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/org.spearce.jgit/src/org/spearce/jgit/revwalk/RevTag.java b/org.spearce.jgit/src/org/spearce/jgit/revwalk/RevTag.java\nindex 2fab266..51ff49b 100644\n--- a/org.spearce.jgit/src/org/spearce/jgit/revwalk/RevTag.java\n+++ b/org.spearce.jgit/src/org/spearce/jgit/revwalk/RevTag.java\n@@ -56,7 +56,7 @@\n \n \tprivate byte[] buffer;\n \n-\tprivate String name;\n+\tprivate String tagName;\n \n \t/**\n \t * Create a new tag reference.\n@@ -96,7 +96,7 @@ void parseCanonical(final RevWalk walk, final byte[] rawTag)\n \n \t\tint p = pos.value += 4; // \"tag \"\n \t\tfinal int nameEnd = RawParseUtils.nextLF(rawTag, p) - 1;\n-\t\tname = RawParseUtils.decode(Constants.CHARSET, rawTag, p, nameEnd);\n+\t\ttagName = RawParseUtils.decode(Constants.CHARSET, rawTag, p, nameEnd);\n \n \t\tif (walk.isRetainBody())\n \t\t\tbuffer = rawTag;\n@@ -186,7 +186,7 @@ public final String getShortMessage() {\n \t * @return parsed tag.\n \t */\n \tpublic Tag asTag(final RevWalk walk) {\n-\t\treturn new Tag(walk.db, this, name, buffer);\n+\t\treturn new Tag(walk.db, this, tagName, buffer);\n \t}\n \n \t/**\n@@ -204,7 +204,7 @@ public final RevObject getObject() {\n \t * @return name of the tag, according to the tag header.\n \t */\n \tpublic final String getName() {\n-\t\treturn name;\n+\t\treturn tagName;\n \t}\n \n \tfinal void disposeBody() {\n-- \n1.6.4.225.gb589e\n"},{"id":"120450","messageId":"200908122237.37148.robin.rosenberg.lists@dewire.com","threadId":"20559","inReplyTo":"1250105956-17795-1-git-send-email-spearce@spearce.org","subject":"Re: [JGIT PATCH] Rename RevTag.getName() to RevTag.getTagName()","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg.lists@dewire.com","sentAt":"2009-08-12T20:37:36Z","receivedAt":"2009-08-12T20:37:36Z","isPatch":true,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"onsdag 12 augusti 2009 21:39:16 skrev \"Shawn O. Pearce\" <spearce@spearce.org>:\n> The method getName() conflicts semantically with the method name()\n> we have inherited from our base class, ObjectId.  It is a rather\n> unfortunate turn of events that for performance reasons we wind up\n> subclassing what should be a property of this class, but since we\n> do that we need to pay attention to the methods declared on our\n> base class.\n> \n> We want to use getName() to be a mirror of name() on AnyObjectId,\n> as it has a more JavaBeans style feel to the accessing of that\n> particular value.  So, rename getTagName() so it doesn't wind up\n> conflicting with the SHA-1 hex formatted string.\n\n> @@ -204,7 +204,7 @@ public final RevObject getObject() {\n>  \t * @return name of the tag, according to the tag header.\n>  \t */\n>  \tpublic final String getName() {\n> -\t\treturn name;\n> +\t\treturn tagName;\n>  \t}\n>  \n>  \tfinal void disposeBody() {\n\nYou forgot the rename of the method here, and all uses of it.\n\n-- robin\n"},{"id":"120453","messageId":"20090812205108.GI1033@spearce.org","threadId":"20559","inReplyTo":"200908122237.37148.robin.rosenberg.lists@dewire.com","subject":"[JGIT PATCH v2] Rename RevTag.getName() to RevTag.getTagName()","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2009-08-12T20:51:08Z","receivedAt":"2009-08-12T20:51:08Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"The method getName() conflicts semantically with the method name()\nwe have inherited from our base class, ObjectId.  It is a rather\nunfortunate turn of events that for performance reasons we wind up\nsubclassing what should be a property of this class, but since we\ndo that we need to pay attention to the methods declared on our\nbase class.\n\nWe want to use getName() to be a mirror of name() on AnyObjectId,\nas it has a more JavaBeans style feel to the accessing of that\nparticular value.  So, rename getTagName() so it doesn't wind up\nconflicting with the SHA-1 hex formatted string.\n\nNoticed-by: Alex Blewitt <alex.blewitt@gmail.com>\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n Robin Rosenberg <robin.rosenberg.lists@dewire.com> wrote:\n > You forgot the rename of the method here, and all uses of it.\n\n Quite right.  #@*!! Eclipse.  I thought I refactored that method,\n but I guess it didn't actually do the work, and I failed to read\n the diff closely enough to notice.  *sigh* That's what I get for\n trying to quickly bang out a \"simple\" change.\n\n .../org/spearce/jgit/revwalk/RevTagParseTest.java  |    8 ++++----\n .../src/org/spearce/jgit/revwalk/RevTag.java       |   10 +++++-----\n 2 files changed, 9 insertions(+), 9 deletions(-)\n\ndiff --git a/org.spearce.jgit.test/tst/org/spearce/jgit/revwalk/RevTagParseTest.java b/org.spearce.jgit.test/tst/org/spearce/jgit/revwalk/RevTagParseTest.java\nindex 66bc901..9f91154 100644\n--- a/org.spearce.jgit.test/tst/org/spearce/jgit/revwalk/RevTagParseTest.java\n+++ b/org.spearce.jgit.test/tst/org/spearce/jgit/revwalk/RevTagParseTest.java\n@@ -75,7 +75,7 @@ private void testOneType(final int typeCode) throws Exception {\n \n \t\tc = new RevTag(id(\"9473095c4cb2f12aefe1db8a355fe3fafba42f67\"));\n \t\tassertNull(c.getObject());\n-\t\tassertNull(c.getName());\n+\t\tassertNull(c.getTagName());\n \n \t\tc.parseCanonical(rw, b.toString().getBytes(\"UTF-8\"));\n \t\tassertNotNull(c.getObject());\n@@ -117,15 +117,15 @@ public void testParseAllFields() throws Exception {\n \n \t\tc = new RevTag(id(\"9473095c4cb2f12aefe1db8a355fe3fafba42f67\"));\n \t\tassertNull(c.getObject());\n-\t\tassertNull(c.getName());\n+\t\tassertNull(c.getTagName());\n \n \t\tc.parseCanonical(rw, body.toString().getBytes(\"UTF-8\"));\n \t\tassertNotNull(c.getObject());\n \t\tassertEquals(treeId, c.getObject().getId());\n \t\tassertSame(rw.lookupTree(treeId), c.getObject());\n \n-\t\tassertNotNull(c.getName());\n-\t\tassertEquals(name, c.getName());\n+\t\tassertNotNull(c.getTagName());\n+\t\tassertEquals(name, c.getTagName());\n \t\tassertEquals(\"\", c.getFullMessage());\n \n \t\tfinal PersonIdent cTagger = c.getTaggerIdent();\ndiff --git a/org.spearce.jgit/src/org/spearce/jgit/revwalk/RevTag.java b/org.spearce.jgit/src/org/spearce/jgit/revwalk/RevTag.java\nindex 2fab266..204e9b1 100644\n--- a/org.spearce.jgit/src/org/spearce/jgit/revwalk/RevTag.java\n+++ b/org.spearce.jgit/src/org/spearce/jgit/revwalk/RevTag.java\n@@ -56,7 +56,7 @@\n \n \tprivate byte[] buffer;\n \n-\tprivate String name;\n+\tprivate String tagName;\n \n \t/**\n \t * Create a new tag reference.\n@@ -96,7 +96,7 @@ void parseCanonical(final RevWalk walk, final byte[] rawTag)\n \n \t\tint p = pos.value += 4; // \"tag \"\n \t\tfinal int nameEnd = RawParseUtils.nextLF(rawTag, p) - 1;\n-\t\tname = RawParseUtils.decode(Constants.CHARSET, rawTag, p, nameEnd);\n+\t\ttagName = RawParseUtils.decode(Constants.CHARSET, rawTag, p, nameEnd);\n \n \t\tif (walk.isRetainBody())\n \t\t\tbuffer = rawTag;\n@@ -186,7 +186,7 @@ public final String getShortMessage() {\n \t * @return parsed tag.\n \t */\n \tpublic Tag asTag(final RevWalk walk) {\n-\t\treturn new Tag(walk.db, this, name, buffer);\n+\t\treturn new Tag(walk.db, this, tagName, buffer);\n \t}\n \n \t/**\n@@ -203,8 +203,8 @@ public final RevObject getObject() {\n \t * \n \t * @return name of the tag, according to the tag header.\n \t */\n-\tpublic final String getName() {\n-\t\treturn name;\n+\tpublic final String getTagName() {\n+\t\treturn tagName;\n \t}\n \n \tfinal void disposeBody() {\n-- \n1.6.4.225.gb589e\n"}]}