# [EGIT PATCH] Provide a more JavaBeans-style 'getName' accessor for the id Signed-off-by: Alex Blewitt <alex.blewitt@gmail.com>

9 messages from 2009-05-09 to 2009-08-12. Participants: Alex Blewitt, Shawn O. Pearce, Robin Rosenberg.
Thread: https://gitlist.dev/t/19261

## Alex Blewitt, 2009-05-09 22:57

Subject: [EGIT PATCH] Provide a more JavaBeans-style 'getName' accessor for the id Signed-off-by: Alex Blewitt <alex.blewitt@gmail.com>
Message-ID: <1241909854-11498-1-git-send-email-alex.blewitt@gmail.com>
URL: https://gitlist.dev/e/1241909854-11498-1-git-send-email-alex.blewitt%40gmail.com

```
---
 .../src/org/spearce/jgit/lib/AnyObjectId.java      |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/AnyObjectId.java b/org.spearce.jgit/src/org/spearce/jgit/lib/AnyObjectId.java
index acb3cb5..015042a 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/lib/AnyObjectId.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/AnyObjectId.java
@@ -448,6 +448,12 @@ public final String name() {
 	}
 
 	/**
+	 * @return string form of the SHA-1, in lower case hexadecimal.
+	 */
+	public final String getName() {
+		return name();
+	}
+	/**
 	 * Return unique abbreviation (prefix) of this object SHA-1.
 	 * <p>
 	 * This method is a utility for <code>abbreviate(repo, 8)</code>.
-- 
1.6.2.2

```

## Shawn O. Pearce, 2009-05-10 21:19

Subject: Re: [EGIT PATCH] Provide a more JavaBeans-style 'getName' accessor for the id Signed-off-by: Alex Blewitt <alex.blewitt@gmail.com>
Message-ID: <20090510211900.GB30527@spearce.org>
URL: https://gitlist.dev/e/20090510211900.GB30527%40spearce.org
In-Reply-To: <1241909854-11498-1-git-send-email-alex.blewitt@gmail.com>

```
Alex Blewitt <alex.blewitt@gmail.com> wrote:
>  	/**
> +	 * @return string form of the SHA-1, in lower case hexadecimal.
> +	 */
> +	public final String getName() {
> +		return name();
> +	}
> +	/**

Ok, but how about unit tests?

-- 
Shawn.

```

## Shawn O. Pearce, 2009-08-10 15:52

Subject: Re: [EGIT PATCH] Provide a more JavaBeans-style 'getName' accessor for the id Signed-off-by: Alex Blewitt <alex.blewitt@gmail.com>
Message-ID: <20090810155207.GW1033@spearce.org>
URL: https://gitlist.dev/e/20090810155207.GW1033%40spearce.org
In-Reply-To: <1241909854-11498-1-git-send-email-alex.blewitt@gmail.com>

```
Alex Blewitt <alex.blewitt@gmail.com> wrote:
> ---
>  .../src/org/spearce/jgit/lib/AnyObjectId.java      |    6 ++++++
>  1 files changed, 6 insertions(+), 0 deletions(-)
> 
> diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/AnyObjectId.java b/org.spearce.jgit/src/org/spearce/jgit/lib/AnyObjectId.java
> index acb3cb5..015042a 100644
> --- a/org.spearce.jgit/src/org/spearce/jgit/lib/AnyObjectId.java
> +++ b/org.spearce.jgit/src/org/spearce/jgit/lib/AnyObjectId.java
> @@ -448,6 +448,12 @@ public final String name() {
>  	}
>  
>  	/**
> +	 * @return string form of the SHA-1, in lower case hexadecimal.
> +	 */
> +	public final String getName() {
> +		return name();
> +	}

Obviously you didn't compile test this in JGit:

./org/spearce/jgit/revwalk/RevTag.java:206: getName() in
org.spearce.jgit.revwalk.RevTag cannot override getName() in
org.spearce.jgit.lib.AnyObjectId; overridden method is final

:-(

-- 
Shawn.

```

## Alex Blewitt, 2009-08-10 18:11

Subject: Re: [EGIT PATCH] Provide a more JavaBeans-style 'getName' accessor for the id Signed-off-by: Alex Blewitt <alex.blewitt@gmail.com>
Message-ID: <A85D4F42-88A0-4508-80A2-22F069CB2F49@gmail.com>
URL: https://gitlist.dev/e/A85D4F42-88A0-4508-80A2-22F069CB2F49%40gmail.com
In-Reply-To: <20090810155207.GW1033@spearce.org>

```
That was ages ago that I submitted that patch. I'm pretty sure that it  
compiled at the time for the version of JGit that I had back then.

Sent from my (new) iPhone

On 10 Aug 2009, at 16:52, "Shawn O. Pearce" <spearce@spearce.org> wrote:

> Alex Blewitt <alex.blewitt@gmail.com> wrote:
>> ---
>> .../src/org/spearce/jgit/lib/AnyObjectId.java      |    6 ++++++
>> 1 files changed, 6 insertions(+), 0 deletions(-)
>>
>> diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/ 
>> AnyObjectId.java b/org.spearce.jgit/src/org/spearce/jgit/lib/ 
>> AnyObjectId.java
>> index acb3cb5..015042a 100644
>> --- a/org.spearce.jgit/src/org/spearce/jgit/lib/AnyObjectId.java
>> +++ b/org.spearce.jgit/src/org/spearce/jgit/lib/AnyObjectId.java
>> @@ -448,6 +448,12 @@ public final String name() {
>>    }
>>
>>    /**
>> +     * @return string form of the SHA-1, in lower case hexadecimal.
>> +     */
>> +    public final String getName() {
>> +        return name();
>> +    }
>
> Obviously you didn't compile test this in JGit:
>
> ./org/spearce/jgit/revwalk/RevTag.java:206: getName() in
> org.spearce.jgit.revwalk.RevTag cannot override getName() in
> org.spearce.jgit.lib.AnyObjectId; overridden method is final
>
> :-(
>
> -- 
> Shawn.

```

## Alex Blewitt, 2009-08-10 18:19

Subject: Re: [EGIT PATCH] Provide a more JavaBeans-style 'getName' accessor for the id Signed-off-by: Alex Blewitt <alex.blewitt@gmail.com>
Message-ID: <E861EAC5-150C-4CF8-AD0F-EBF15CEAE114@gmail.com>
URL: https://gitlist.dev/e/E861EAC5-150C-4CF8-AD0F-EBF15CEAE114%40gmail.com
In-Reply-To: <20090810155207.GW1033@spearce.org>

```
That patch was originally mailed on the 11th May. Has it taken until  
now to notice the problem, or was the other method added in the last  
month or so? If I'm to blame, I apologise but didn't note any compile  
time issues at the time.

Alex

Sent from my (new) iPhone

On 10 Aug 2009, at 16:52, "Shawn O. Pearce" <spearce@spearce.org> wrote:

> Alex Blewitt <alex.blewitt@gmail.com> wrote:
>> ---
>> .../src/org/spearce/jgit/lib/AnyObjectId.java      |    6 ++++++
>> 1 files changed, 6 insertions(+), 0 deletions(-)
>>
>> diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/ 
>> AnyObjectId.java b/org.spearce.jgit/src/org/spearce/jgit/lib/ 
>> AnyObjectId.java
>> index acb3cb5..015042a 100644
>> --- a/org.spearce.jgit/src/org/spearce/jgit/lib/AnyObjectId.java
>> +++ b/org.spearce.jgit/src/org/spearce/jgit/lib/AnyObjectId.java
>> @@ -448,6 +448,12 @@ public final String name() {
>>    }
>>
>>    /**
>> +     * @return string form of the SHA-1, in lower case hexadecimal.
>> +     */
>> +    public final String getName() {
>> +        return name();
>> +    }
>
> Obviously you didn't compile test this in JGit:
>
> ./org/spearce/jgit/revwalk/RevTag.java:206: getName() in
> org.spearce.jgit.revwalk.RevTag cannot override getName() in
> org.spearce.jgit.lib.AnyObjectId; overridden method is final
>
> :-(
>
> -- 
> Shawn.

```

## Shawn O. Pearce, 2009-08-10 20:59

Subject: Re: [EGIT PATCH] Provide a more JavaBeans-style 'getName' accessor for the id Signed-off-by: Alex Blewitt <alex.blewitt@gmail.com>
Message-ID: <20090810205907.GY1033@spearce.org>
URL: https://gitlist.dev/e/20090810205907.GY1033%40spearce.org
In-Reply-To: <E861EAC5-150C-4CF8-AD0F-EBF15CEAE114@gmail.com>

```
Alex Blewitt <alex.blewitt@gmail.com> wrote:
> That patch was originally mailed on the 11th May. Has it taken until now 
> to notice the problem, or was the other method added in the last month or 
> so? If I'm to blame, I apologise but didn't note any compile time issues 
> at the time.

Arrgh, you are right, I lost this patch in my inbox, and in the
interm we applied new features to RevTag which added getName there.

> On 10 Aug 2009, at 16:52, "Shawn O. Pearce" <spearce@spearce.org> wrote:
>> Obviously you didn't compile test this in JGit:

Never mind.

>> ./org/spearce/jgit/revwalk/RevTag.java:206: getName() in
>> org.spearce.jgit.revwalk.RevTag cannot override getName() in
>> org.spearce.jgit.lib.AnyObjectId; overridden method is final

I can't apply this patch because getName() on RevTag is already
defined with a different meaning.  :-(

-- 
Shawn.

```

## Alex Blewitt, 2009-08-11 12:53

Subject: Re: [EGIT PATCH] Provide a more JavaBeans-style 'getName' accessor for the id Signed-off-by: Alex Blewitt <alex.blewitt@gmail.com>
Message-ID: <8ACC6C83-75FD-477C-9083-96CA426FC069@gmail.com>
URL: https://gitlist.dev/e/8ACC6C83-75FD-477C-9083-96CA426FC069%40gmail.com
In-Reply-To: <20090810205907.GY1033@spearce.org>

```
On 10 Aug 2009, at 21:59, "Shawn O." <spearce@spearce.org> wrote:

> Alex Blewitt <alex.blewitt@gmail.com> wrote:
>> That patch was originally mailed on the 11th May. Has it taken  
>> until now
>> to notice the problem, or was the other method added in the last  
>> month or
>> so? If I'm to blame, I apologise but didn't note any compile time  
>> issues
>> at the time.
>
> Arrgh, you are right, I lost this patch in my inbox, and in the
> interm we applied new features to RevTag which added getName there. .
>
>>> ./org/spearce/jgit/revwalk/RevTag.java:206: getName() in
>>> org.spearce.jgit.revwalk.RevTag cannot override getName() in
>>> org.spearce.jgit.lib.AnyObjectId; overridden method is final
>
> I can't apply this patch because getName() on RevTag is already
> defined with a different meaning.  :-(

That sounds dangerous. We now have a .name() and a .getName() with  
different semantics. Can we not change the RevTag method name to  
something else so that we dont have an inconsistency?
>

Alex 

```

## Shawn O. Pearce, 2009-08-12 14:20

Subject: Re: [EGIT PATCH] Provide a more JavaBeans-style 'getName' accessor for the id Signed-off-by: Alex Blewitt <alex.blewitt@gmail.com>
Message-ID: <20090812142049.GA1033@spearce.org>
URL: https://gitlist.dev/e/20090812142049.GA1033%40spearce.org
In-Reply-To: <8ACC6C83-75FD-477C-9083-96CA426FC069@gmail.com>

```
Alex Blewitt <alex.blewitt@gmail.com> wrote:
> On 10 Aug 2009, at 21:59, "Shawn O." <spearce@spearce.org> wrote:
>>
>>>> ./org/spearce/jgit/revwalk/RevTag.java:206: getName() in
>>>> org.spearce.jgit.revwalk.RevTag cannot override getName() in
>>>> org.spearce.jgit.lib.AnyObjectId; overridden method is final
>>
>> I can't apply this patch because getName() on RevTag is already
>> defined with a different meaning.  :-(
>
> That sounds dangerous. We now have a .name() and a .getName() with  
> different semantics. Can we not change the RevTag method name to  
> something else so that we dont have an inconsistency?

Good point.  We didn't think that RevTag.getName method through
very well.  Rename it to getTagName() ?

-- 
Shawn.

```

## Robin Rosenberg, 2009-08-12 19:09

Subject: Re: [EGIT PATCH] Provide a more JavaBeans-style 'getName' accessor for the id Signed-off-by: Alex Blewitt <alex.blewitt@gmail.com>
Message-ID: <200908122109.29560.robin.rosenberg.lists@dewire.com>
URL: https://gitlist.dev/e/200908122109.29560.robin.rosenberg.lists%40dewire.com
In-Reply-To: <20090812142049.GA1033@spearce.org>

```
onsdag 12 augusti 2009 16:20:49 skrev "Shawn O. Pearce" <spearce@spearce.org>:
> Alex Blewitt <alex.blewitt@gmail.com> wrote:
> > On 10 Aug 2009, at 21:59, "Shawn O." <spearce@spearce.org> wrote:
> >>
> >>>> ./org/spearce/jgit/revwalk/RevTag.java:206: getName() in
> >>>> org.spearce.jgit.revwalk.RevTag cannot override getName() in
> >>>> org.spearce.jgit.lib.AnyObjectId; overridden method is final
> >>
> >> I can't apply this patch because getName() on RevTag is already
> >> defined with a different meaning.  :-(
> >
> > That sounds dangerous. We now have a .name() and a .getName() with  
> > different semantics. Can we not change the RevTag method name to  
> > something else so that we dont have an inconsistency?
> 
> Good point.  We didn't think that RevTag.getName method through
> very well.  Rename it to getTagName() ?

Ok with me.

-- robin

```
