You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Mark Hobson <ma...@gmail.com> on 2007/06/08 16:48:45 UTC

Re: DefaultArtifact.equals ignoring scope

On 18/01/07, Mark Hobson <ma...@gmail.com> wrote:
> Hi there,
>
> On my travels I noticed DefaultArtifact [1] equals and hashCode
> ignores scope - is that intentional?  Could prove to be a problem when
> check to see if an artifact has moved scope.

Just encountered this again whilst debugging - anyone got an opinion
whether this is right or wrong?

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: DefaultArtifact.equals ignoring scope

Posted by Mark Hobson <ma...@gmail.com>.
On 08/06/07, John Casey <jd...@commonjava.org> wrote:
> IMO, it's a representation of an artifact in the repository (or
> elsewhere)...scope is just a tag designating its use within the
> current build. Therefore, scope has nothing to do with whether two
> artifacts somewhere on the system are equal.
>
> So, I'd say it shouldn't incorporate scope in .equals(..).

I guess Artifact should really be split into a class that represents
the artifact in the repository and a class that represents the
buildtime artifact properties such as scope, etc.  I'll workaround it
for now thanks.

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: DefaultArtifact.equals ignoring scope

Posted by John Casey <jd...@commonjava.org>.
IMO, it's a representation of an artifact in the repository (or  
elsewhere)...scope is just a tag designating its use within the  
current build. Therefore, scope has nothing to do with whether two  
artifacts somewhere on the system are equal.

So, I'd say it shouldn't incorporate scope in .equals(..).

-john


On Jun 8, 2007, at 10:48 AM, Mark Hobson wrote:

> On 18/01/07, Mark Hobson <ma...@gmail.com> wrote:
>> Hi there,
>>
>> On my travels I noticed DefaultArtifact [1] equals and hashCode
>> ignores scope - is that intentional?  Could prove to be a problem  
>> when
>> check to see if an artifact has moved scope.
>
> Just encountered this again whilst debugging - anyone got an opinion
> whether this is right or wrong?
>
> Mark
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>

---
John Casey
Committer and PMC Member, Apache Maven
mail: jdcasey at commonjava dot org
blog: http://www.ejlife.net/blogs/john