You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Martin Zeltner (JIRA)" <ji...@codehaus.org> on 2006/10/02 09:22:27 UTC

[jira] Created: (MNG-2583) DefaultArtifact: Method getVersionRange returns null also if field version is already set! [SMALL PATCH ATTACHED]

DefaultArtifact: Method getVersionRange returns null also if field version is already set! [SMALL PATCH ATTACHED]
-----------------------------------------------------------------------------------------------------------------

                 Key: MNG-2583
                 URL: http://jira.codehaus.org/browse/MNG-2583
             Project: Maven 2
          Issue Type: Improvement
          Components: Artifacts
    Affects Versions: 2.1
         Environment: Java5, WinXp
            Reporter: Martin Zeltner
         Attachments: patch_maven-artifact_made-getVersionRange-saver.patch

In class *org.apache.maven.artifact.DefaultArtifact* method *getVersionRange* returns *null* altough the version field is already set. In attached patch I check in method getVersionRange if versionRange is null if field version or baseVersion is already set and then create the versionRange by using version/baseVersion. By the way I've replaced HashMap with a LinkedHashMap to remember the insertion order of meta data.

For those who don't see why this patch is needed can try binding the eclipse plugin to a phase before the jar plugin is bound. The eclipse plugin uses the org.apache.maven.artifact.resolver.DefaultArtifactCollector which is invoking method setVersion of org.apache.maven.artifact.DefaultArtifact which will erase field version range and cause a NullPointerException in plugin jar that doesn't check if returned version range is null.

Cheers,
Martin

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MNG-2583) DefaultArtifact: Method getVersionRange returns null also if field version is already set! [SMALL PATCH ATTACHED]

Posted by "Brian Fox (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-2583?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_127557 ] 

Brian Fox commented on MNG-2583:
--------------------------------

Can we get a sample project to reproduce this? The code change seems logical, but trying to reproduce this in a unit shows me that what you see might be a symptom of a larger problem. setVersion() sets version and baseversion and clears the versionRange. How is it that version is null if it just got set? And if it was set to null so would the baseversion so the change shouldn't help. Something else is going on here.

> DefaultArtifact: Method getVersionRange returns null also if field version is already set! [SMALL PATCH ATTACHED]
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: MNG-2583
>                 URL: http://jira.codehaus.org/browse/MNG-2583
>             Project: Maven 2
>          Issue Type: Improvement
>          Components: Artifacts and Repositories
>    Affects Versions: 2.0-alpha-1
>         Environment: Java5, WinXp
>            Reporter: Martin Zeltner
>            Assignee: Jason van Zyl
>             Fix For: 2.0.10
>
>         Attachments: patch_maven-artifact_made-getVersionRange-saver.patch
>
>
> In class *org.apache.maven.artifact.DefaultArtifact* method *getVersionRange* returns *null* altough the version field is already set. In attached patch I check in method getVersionRange if versionRange is null if field version or baseVersion is already set and then create the versionRange by using version/baseVersion. By the way I've replaced HashMap with a LinkedHashMap to remember the insertion order of meta data.
> For those who don't see why this patch is needed can try binding the eclipse plugin to a phase before the jar plugin is bound. The eclipse plugin uses the org.apache.maven.artifact.resolver.DefaultArtifactCollector which is invoking method setVersion of org.apache.maven.artifact.DefaultArtifact which will erase field version range and cause a NullPointerException in plugin jar that doesn't check if returned version range is null.
> Cheers,
> Martin

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MNG-2583) DefaultArtifact: Method getVersionRange returns null also if field version is already set! [SMALL PATCH ATTACHED]

Posted by "Martin Zeltner (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-2583?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_126417 ] 

Martin Zeltner commented on MNG-2583:
-------------------------------------

I can reproduce the problem, so problem must be fixed. Just add the lines in method "getVersionRange". Cheers, Martin

> DefaultArtifact: Method getVersionRange returns null also if field version is already set! [SMALL PATCH ATTACHED]
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: MNG-2583
>                 URL: http://jira.codehaus.org/browse/MNG-2583
>             Project: Maven 2
>          Issue Type: Improvement
>          Components: Artifacts and Repositories
>    Affects Versions: 2.0-alpha-1
>         Environment: Java5, WinXp
>            Reporter: Martin Zeltner
>            Assignee: Jason van Zyl
>             Fix For: 2.0.10
>
>         Attachments: patch_maven-artifact_made-getVersionRange-saver.patch
>
>
> In class *org.apache.maven.artifact.DefaultArtifact* method *getVersionRange* returns *null* altough the version field is already set. In attached patch I check in method getVersionRange if versionRange is null if field version or baseVersion is already set and then create the versionRange by using version/baseVersion. By the way I've replaced HashMap with a LinkedHashMap to remember the insertion order of meta data.
> For those who don't see why this patch is needed can try binding the eclipse plugin to a phase before the jar plugin is bound. The eclipse plugin uses the org.apache.maven.artifact.resolver.DefaultArtifactCollector which is invoking method setVersion of org.apache.maven.artifact.DefaultArtifact which will erase field version range and cause a NullPointerException in plugin jar that doesn't check if returned version range is null.
> Cheers,
> Martin

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Closed: (MNG-2583) DefaultArtifact: Method getVersionRange returns null also if field version is already set! [SMALL PATCH ATTACHED]

Posted by "Martin Zeltner (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-2583?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Zeltner closed MNG-2583.
-------------------------------

       Resolution: Fixed
    Fix Version/s:     (was: 2.0.10)
                   2.0.9

> DefaultArtifact: Method getVersionRange returns null also if field version is already set! [SMALL PATCH ATTACHED]
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: MNG-2583
>                 URL: http://jira.codehaus.org/browse/MNG-2583
>             Project: Maven 2
>          Issue Type: Improvement
>          Components: Artifacts and Repositories
>    Affects Versions: 2.0-alpha-1
>         Environment: Java5, WinXp
>            Reporter: Martin Zeltner
>            Assignee: Jason van Zyl
>             Fix For: 2.0.9
>
>         Attachments: patch_maven-artifact_made-getVersionRange-saver.patch
>
>
> In class *org.apache.maven.artifact.DefaultArtifact* method *getVersionRange* returns *null* altough the version field is already set. In attached patch I check in method getVersionRange if versionRange is null if field version or baseVersion is already set and then create the versionRange by using version/baseVersion. By the way I've replaced HashMap with a LinkedHashMap to remember the insertion order of meta data.
> For those who don't see why this patch is needed can try binding the eclipse plugin to a phase before the jar plugin is bound. The eclipse plugin uses the org.apache.maven.artifact.resolver.DefaultArtifactCollector which is invoking method setVersion of org.apache.maven.artifact.DefaultArtifact which will erase field version range and cause a NullPointerException in plugin jar that doesn't check if returned version range is null.
> Cheers,
> Martin

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (MNG-2583) DefaultArtifact: Method getVersionRange returns null also if field version is already set! [SMALL PATCH ATTACHED]

Posted by "Jason van Zyl (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-2583?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jason van Zyl updated MNG-2583:
-------------------------------

    Patch Submitted:   (was: [Yes])

> DefaultArtifact: Method getVersionRange returns null also if field version is already set! [SMALL PATCH ATTACHED]
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: MNG-2583
>                 URL: http://jira.codehaus.org/browse/MNG-2583
>             Project: Maven 2
>          Issue Type: Improvement
>          Components: Artifacts and Repositories
>    Affects Versions: 2.0-alpha-1
>         Environment: Java5, WinXp
>            Reporter: Martin Zeltner
>            Assignee: Jason van Zyl
>         Attachments: patch_maven-artifact_made-getVersionRange-saver.patch
>
>
> In class *org.apache.maven.artifact.DefaultArtifact* method *getVersionRange* returns *null* altough the version field is already set. In attached patch I check in method getVersionRange if versionRange is null if field version or baseVersion is already set and then create the versionRange by using version/baseVersion. By the way I've replaced HashMap with a LinkedHashMap to remember the insertion order of meta data.
> For those who don't see why this patch is needed can try binding the eclipse plugin to a phase before the jar plugin is bound. The eclipse plugin uses the org.apache.maven.artifact.resolver.DefaultArtifactCollector which is invoking method setVersion of org.apache.maven.artifact.DefaultArtifact which will erase field version range and cause a NullPointerException in plugin jar that doesn't check if returned version range is null.
> Cheers,
> Martin

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (MNG-2583) DefaultArtifact: Method getVersionRange returns null also if field version is already set! [SMALL PATCH ATTACHED]

Posted by "Brian Fox (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-2583?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brian Fox updated MNG-2583:
---------------------------

    Fix Version/s:     (was: Reviewed Pending Version Assignment)
                   2.0.10

I suspect this is already fixed. Can you reproduce?

> DefaultArtifact: Method getVersionRange returns null also if field version is already set! [SMALL PATCH ATTACHED]
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: MNG-2583
>                 URL: http://jira.codehaus.org/browse/MNG-2583
>             Project: Maven 2
>          Issue Type: Improvement
>          Components: Artifacts and Repositories
>    Affects Versions: 2.0-alpha-1
>         Environment: Java5, WinXp
>            Reporter: Martin Zeltner
>            Assignee: Jason van Zyl
>             Fix For: 2.0.10
>
>         Attachments: patch_maven-artifact_made-getVersionRange-saver.patch
>
>
> In class *org.apache.maven.artifact.DefaultArtifact* method *getVersionRange* returns *null* altough the version field is already set. In attached patch I check in method getVersionRange if versionRange is null if field version or baseVersion is already set and then create the versionRange by using version/baseVersion. By the way I've replaced HashMap with a LinkedHashMap to remember the insertion order of meta data.
> For those who don't see why this patch is needed can try binding the eclipse plugin to a phase before the jar plugin is bound. The eclipse plugin uses the org.apache.maven.artifact.resolver.DefaultArtifactCollector which is invoking method setVersion of org.apache.maven.artifact.DefaultArtifact which will erase field version range and cause a NullPointerException in plugin jar that doesn't check if returned version range is null.
> Cheers,
> Martin

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MNG-2583) DefaultArtifact: Method getVersionRange returns null also if field version is already set! [SMALL PATCH ATTACHED]

Posted by "John Casey (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-2583?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=139597#action_139597 ] 

John Casey commented on MNG-2583:
---------------------------------

Still waiting on a test project to reproduce this problem...

> DefaultArtifact: Method getVersionRange returns null also if field version is already set! [SMALL PATCH ATTACHED]
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: MNG-2583
>                 URL: http://jira.codehaus.org/browse/MNG-2583
>             Project: Maven 2
>          Issue Type: Improvement
>          Components: Artifacts and Repositories
>    Affects Versions: 2.0-alpha-1
>         Environment: Java5, WinXp
>            Reporter: Martin Zeltner
>            Assignee: Jason van Zyl
>             Fix For: 2.0.10
>
>         Attachments: patch_maven-artifact_made-getVersionRange-saver.patch
>
>
> In class *org.apache.maven.artifact.DefaultArtifact* method *getVersionRange* returns *null* altough the version field is already set. In attached patch I check in method getVersionRange if versionRange is null if field version or baseVersion is already set and then create the versionRange by using version/baseVersion. By the way I've replaced HashMap with a LinkedHashMap to remember the insertion order of meta data.
> For those who don't see why this patch is needed can try binding the eclipse plugin to a phase before the jar plugin is bound. The eclipse plugin uses the org.apache.maven.artifact.resolver.DefaultArtifactCollector which is invoking method setVersion of org.apache.maven.artifact.DefaultArtifact which will erase field version range and cause a NullPointerException in plugin jar that doesn't check if returned version range is null.
> Cheers,
> Martin

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MNG-2583) DefaultArtifact: Method getVersionRange returns null also if field version is already set! [SMALL PATCH ATTACHED]

Posted by "Martin Zeltner (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-2583?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=139754#action_139754 ] 

Martin Zeltner commented on MNG-2583:
-------------------------------------

With Maven 2.0.8 I had to apply this patch but with 2.0.9 it seams to work without.

It should be that such small things like this issue is discussed when the issue is created (Oct 06) an not 20 months later! So I have also time to discuss it and I'm still in the context of this bug, thanks.

Cheers,
Martin

> DefaultArtifact: Method getVersionRange returns null also if field version is already set! [SMALL PATCH ATTACHED]
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: MNG-2583
>                 URL: http://jira.codehaus.org/browse/MNG-2583
>             Project: Maven 2
>          Issue Type: Improvement
>          Components: Artifacts and Repositories
>    Affects Versions: 2.0-alpha-1
>         Environment: Java5, WinXp
>            Reporter: Martin Zeltner
>            Assignee: Jason van Zyl
>             Fix For: 2.0.9
>
>         Attachments: patch_maven-artifact_made-getVersionRange-saver.patch
>
>
> In class *org.apache.maven.artifact.DefaultArtifact* method *getVersionRange* returns *null* altough the version field is already set. In attached patch I check in method getVersionRange if versionRange is null if field version or baseVersion is already set and then create the versionRange by using version/baseVersion. By the way I've replaced HashMap with a LinkedHashMap to remember the insertion order of meta data.
> For those who don't see why this patch is needed can try binding the eclipse plugin to a phase before the jar plugin is bound. The eclipse plugin uses the org.apache.maven.artifact.resolver.DefaultArtifactCollector which is invoking method setVersion of org.apache.maven.artifact.DefaultArtifact which will erase field version range and cause a NullPointerException in plugin jar that doesn't check if returned version range is null.
> Cheers,
> Martin

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira