Gmane
Gravatar
From: Shawn O. Pearce <spearce <at> spearce.org>
Subject: [JGIT PATCH 1/5] Make RevTag getObject(), getName() final to prevent overrides
Newsgroups: gmane.comp.version-control.git
Date: 2009-06-12 23:00:15 GMT (38 weeks, 6 days, 6 hours and 13 minutes ago)
These methods exist solely to export the object headers from the
tag buffer.  Overriding them may create confusion by trying to
replace the value with something other than what was parsed from
the tag headers.  Other methods like getShortMessage() and the
getTaggerIdent() are likewise already marked final.

Signed-off-by: Shawn O. Pearce <spearce <at> spearce.org>
---
 .../src/org/spearce/jgit/revwalk/RevTag.java       |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/org.spearce.jgit/src/org/spearce/jgit/revwalk/RevTag.java b/org.spearce.jgit/src/org/spearce/jgit/revwalk/RevTag.java
index cace82d..83fd873 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/revwalk/RevTag.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/revwalk/RevTag.java
@@ -189,7 +189,7 @@ public Tag asTag(final RevWalk walk) {
 	 * 
 	 * @return object this tag refers to.
 	 */
-	public RevObject getObject() {
+	public final RevObject getObject() {
 		return object;
 	}

@@ -198,7 +198,7 @@ public RevObject getObject() {
 	 * 
 	 * @return name of the tag, according to the tag header.
 	 */
-	public String getName() {
+	public final String getName() {
 		return name;
 	}

-- 
1.6.3.2.367.gf0de