You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Jens Mühlenhoff (JIRA)" <ji...@codehaus.org> on 2009/02/26 17:13:19 UTC

[jira] Created: (MRELEASE-417) generated ReleaseDescriptor contains buggy method: getDependencyDevelopmentVersion and getDependencyReleaseVersion

generated ReleaseDescriptor contains buggy method: getDependencyDevelopmentVersion and getDependencyReleaseVersion
------------------------------------------------------------------------------------------------------------------

                 Key: MRELEASE-417
                 URL: http://jira.codehaus.org/browse/MRELEASE-417
             Project: Maven 2.x Release Plugin
          Issue Type: Bug
            Reporter: Jens Mühlenhoff


The following two methods will always return null if the attribute resolvedSnapshotDependencies is not null.

Second you can avoid extra lookups by doing a get and check if the value is null (without calling containsKey before).

    /**
     * Retrieve the release version for the resolved snapshot dependency.
     *
     */
    public String getDependencyDevelopmentVersion( String artifactConflictId )
    {
        if ( ( resolvedSnapshotDependencies == null ) && ( resolvedSnapshotDependencies.containsKey( artifactConflictId ) ) )
        {
            java.util.Map versionMap = ( java.util.Map ) resolvedSnapshotDependencies.get( artifactConflictId );
            return ( String ) versionMap.get( DEVELOPMENT_KEY );
        }
        return null;
    }

    /**
     * Retrieve the release version for the resolved snapshot dependency.
     *
     */
    public String getDependencyReleaseVersion( String artifactConflictId )
    {
        if ( ( resolvedSnapshotDependencies == null ) && ( resolvedSnapshotDependencies.containsKey( artifactConflictId ) ) )
        {
            java.util.Map versionMap = ( java.util.Map ) resolvedSnapshotDependencies.get( artifactConflictId );
            return ( String ) versionMap.get( RELEASE_KEY );
        }
        return null;
    }


-- 
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: (MRELEASE-417) generated ReleaseDescriptor contains buggy method: getDependencyDevelopmentVersion and getDependencyReleaseVersion

Posted by "Dennis Lundberg (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MRELEASE-417?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dennis Lundberg updated MRELEASE-417:
-------------------------------------

    Component/s: prepare

> generated ReleaseDescriptor contains buggy method: getDependencyDevelopmentVersion and getDependencyReleaseVersion
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: MRELEASE-417
>                 URL: http://jira.codehaus.org/browse/MRELEASE-417
>             Project: Maven 2.x Release Plugin
>          Issue Type: Bug
>          Components: prepare
>            Reporter: Jens Mühlenhoff
>
> The following two methods will always return null if the attribute resolvedSnapshotDependencies is not null.
> Second you can avoid extra lookups by doing a get and check if the value is null (without calling containsKey before).
>     /**
>      * Retrieve the release version for the resolved snapshot dependency.
>      *
>      */
>     public String getDependencyDevelopmentVersion( String artifactConflictId )
>     {
>         if ( ( resolvedSnapshotDependencies == null ) && ( resolvedSnapshotDependencies.containsKey( artifactConflictId ) ) )
>         {
>             java.util.Map versionMap = ( java.util.Map ) resolvedSnapshotDependencies.get( artifactConflictId );
>             return ( String ) versionMap.get( DEVELOPMENT_KEY );
>         }
>         return null;
>     }
>     /**
>      * Retrieve the release version for the resolved snapshot dependency.
>      *
>      */
>     public String getDependencyReleaseVersion( String artifactConflictId )
>     {
>         if ( ( resolvedSnapshotDependencies == null ) && ( resolvedSnapshotDependencies.containsKey( artifactConflictId ) ) )
>         {
>             java.util.Map versionMap = ( java.util.Map ) resolvedSnapshotDependencies.get( artifactConflictId );
>             return ( String ) versionMap.get( RELEASE_KEY );
>         }
>         return null;
>     }

-- 
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] (MRELEASE-417) generated ReleaseDescriptor contains buggy method: getDependencyDevelopmentVersion and getDependencyReleaseVersion

Posted by "Robert Scholte (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/MRELEASE-417?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=291443#comment-291443 ] 

Robert Scholte commented on MRELEASE-417:
-----------------------------------------

The current code still has this invalid fragment, but it doesn't seem to bother because it is never used within the release project.
So I'm considering to just remove it. But there's one small issue: it's a public method, so I can't be sure it's never used by other projects, although I doubt it.
                
> generated ReleaseDescriptor contains buggy method: getDependencyDevelopmentVersion and getDependencyReleaseVersion
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: MRELEASE-417
>                 URL: https://jira.codehaus.org/browse/MRELEASE-417
>             Project: Maven 2.x Release Plugin
>          Issue Type: Bug
>          Components: prepare
>            Reporter: Jens Mühlenhoff
>
> The following two methods will always return null if the attribute resolvedSnapshotDependencies is not null.
> Second you can avoid extra lookups by doing a get and check if the value is null (without calling containsKey before).
> {code}
>     /**
>      * Retrieve the release version for the resolved snapshot dependency.
>      *
>      */
>     public String getDependencyDevelopmentVersion( String artifactConflictId )
>     {
>         if ( ( resolvedSnapshotDependencies == null ) && ( resolvedSnapshotDependencies.containsKey( artifactConflictId ) ) )
>         {
>             java.util.Map versionMap = ( java.util.Map ) resolvedSnapshotDependencies.get( artifactConflictId );
>             return ( String ) versionMap.get( DEVELOPMENT_KEY );
>         }
>         return null;
>     }
>     /**
>      * Retrieve the release version for the resolved snapshot dependency.
>      *
>      */
>     public String getDependencyReleaseVersion( String artifactConflictId )
>     {
>         if ( ( resolvedSnapshotDependencies == null ) && ( resolvedSnapshotDependencies.containsKey( artifactConflictId ) ) )
>         {
>             java.util.Map versionMap = ( java.util.Map ) resolvedSnapshotDependencies.get( artifactConflictId );
>             return ( String ) versionMap.get( RELEASE_KEY );
>         }
>         return null;
>     }
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] (MRELEASE-417) generated ReleaseDescriptor contains buggy method: getDependencyDevelopmentVersion and getDependencyReleaseVersion

Posted by "Robert Scholte (JIRA)" <ji...@codehaus.org>.
     [ https://jira.codehaus.org/browse/MRELEASE-417?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robert Scholte updated MRELEASE-417:
------------------------------------

    Description: 
The following two methods will always return null if the attribute resolvedSnapshotDependencies is not null.

Second you can avoid extra lookups by doing a get and check if the value is null (without calling containsKey before).
{code}
    /**
     * Retrieve the release version for the resolved snapshot dependency.
     *
     */
    public String getDependencyDevelopmentVersion( String artifactConflictId )
    {
        if ( ( resolvedSnapshotDependencies == null ) && ( resolvedSnapshotDependencies.containsKey( artifactConflictId ) ) )
        {
            java.util.Map versionMap = ( java.util.Map ) resolvedSnapshotDependencies.get( artifactConflictId );
            return ( String ) versionMap.get( DEVELOPMENT_KEY );
        }
        return null;
    }

    /**
     * Retrieve the release version for the resolved snapshot dependency.
     *
     */
    public String getDependencyReleaseVersion( String artifactConflictId )
    {
        if ( ( resolvedSnapshotDependencies == null ) && ( resolvedSnapshotDependencies.containsKey( artifactConflictId ) ) )
        {
            java.util.Map versionMap = ( java.util.Map ) resolvedSnapshotDependencies.get( artifactConflictId );
            return ( String ) versionMap.get( RELEASE_KEY );
        }
        return null;
    }
{code}

  was:
The following two methods will always return null if the attribute resolvedSnapshotDependencies is not null.

Second you can avoid extra lookups by doing a get and check if the value is null (without calling containsKey before).

    /**
     * Retrieve the release version for the resolved snapshot dependency.
     *
     */
    public String getDependencyDevelopmentVersion( String artifactConflictId )
    {
        if ( ( resolvedSnapshotDependencies == null ) && ( resolvedSnapshotDependencies.containsKey( artifactConflictId ) ) )
        {
            java.util.Map versionMap = ( java.util.Map ) resolvedSnapshotDependencies.get( artifactConflictId );
            return ( String ) versionMap.get( DEVELOPMENT_KEY );
        }
        return null;
    }

    /**
     * Retrieve the release version for the resolved snapshot dependency.
     *
     */
    public String getDependencyReleaseVersion( String artifactConflictId )
    {
        if ( ( resolvedSnapshotDependencies == null ) && ( resolvedSnapshotDependencies.containsKey( artifactConflictId ) ) )
        {
            java.util.Map versionMap = ( java.util.Map ) resolvedSnapshotDependencies.get( artifactConflictId );
            return ( String ) versionMap.get( RELEASE_KEY );
        }
        return null;
    }


    
> generated ReleaseDescriptor contains buggy method: getDependencyDevelopmentVersion and getDependencyReleaseVersion
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: MRELEASE-417
>                 URL: https://jira.codehaus.org/browse/MRELEASE-417
>             Project: Maven 2.x Release Plugin
>          Issue Type: Bug
>          Components: prepare
>            Reporter: Jens Mühlenhoff
>
> The following two methods will always return null if the attribute resolvedSnapshotDependencies is not null.
> Second you can avoid extra lookups by doing a get and check if the value is null (without calling containsKey before).
> {code}
>     /**
>      * Retrieve the release version for the resolved snapshot dependency.
>      *
>      */
>     public String getDependencyDevelopmentVersion( String artifactConflictId )
>     {
>         if ( ( resolvedSnapshotDependencies == null ) && ( resolvedSnapshotDependencies.containsKey( artifactConflictId ) ) )
>         {
>             java.util.Map versionMap = ( java.util.Map ) resolvedSnapshotDependencies.get( artifactConflictId );
>             return ( String ) versionMap.get( DEVELOPMENT_KEY );
>         }
>         return null;
>     }
>     /**
>      * Retrieve the release version for the resolved snapshot dependency.
>      *
>      */
>     public String getDependencyReleaseVersion( String artifactConflictId )
>     {
>         if ( ( resolvedSnapshotDependencies == null ) && ( resolvedSnapshotDependencies.containsKey( artifactConflictId ) ) )
>         {
>             java.util.Map versionMap = ( java.util.Map ) resolvedSnapshotDependencies.get( artifactConflictId );
>             return ( String ) versionMap.get( RELEASE_KEY );
>         }
>         return null;
>     }
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] Issue Comment Edited: (MRELEASE-417) generated ReleaseDescriptor contains buggy method: getDependencyDevelopmentVersion and getDependencyReleaseVersion

Posted by "Dennis Lundberg (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MRELEASE-417?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=167184#action_167184 ] 

Dennis Lundberg edited comment on MRELEASE-417 at 2/9/10 12:40 PM:
-------------------------------------------------------------------

Sorry, I cant edit my bug, it belongs to the prepare component. VErsion of maven is 2.0.10.

This could be a fix, but I don't know how to tell it maven to use it during code generation:
{code:java}
    public String getDependencyDevelopmentVersion( String artifactConflictId )
    {
        if( resolvedSnapshotDependencies != null ) {
            java.util.Map versionMap = ( java.util.Map ) resolvedSnapshotDependencies.get( artifactConflictId );
            if( versionMap != null ) {
                return ( String ) versionMap.get( DEVELOPMENT_KEY );
            }
        }
        return null;
    }

    public String getDependencyReleaseVersion( String artifactConflictId )
    {
        if ( ( resolvedSnapshotDependencies != null ) {
            java.util.Map versionMap = ( java.util.Map ) resolvedSnapshotDependencies.get( artifactConflictId );
            if( versionMap != null ) {
                return ( String ) versionMap.get( RELEASE_KEY );
            }
        }
        return null;
    }
{code}

      was (Author: jens.muehlenhoff):
    Sorry, I cant edit my bug, it belongs to the prepare component. VErsion of maven is 2.0.10.

This could be a fix, but I don't know how to tell it maven to use it during code generation:
{{noformat}
    public String getDependencyDevelopmentVersion( String artifactConflictId )
    {
        if( resolvedSnapshotDependencies != null ) {
            java.util.Map versionMap = ( java.util.Map ) resolvedSnapshotDependencies.get( artifactConflictId );
            if( versionMap != null ) {
                return ( String ) versionMap.get( DEVELOPMENT_KEY );
            }
        }
        return null;
    }

    public String getDependencyReleaseVersion( String artifactConflictId )
    {
        if ( ( resolvedSnapshotDependencies != null ) {
            java.util.Map versionMap = ( java.util.Map ) resolvedSnapshotDependencies.get( artifactConflictId );
            if( versionMap != null ) {
                return ( String ) versionMap.get( RELEASE_KEY );
            }
        }
        return null;
    }
{{noformat}
  
> generated ReleaseDescriptor contains buggy method: getDependencyDevelopmentVersion and getDependencyReleaseVersion
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: MRELEASE-417
>                 URL: http://jira.codehaus.org/browse/MRELEASE-417
>             Project: Maven 2.x Release Plugin
>          Issue Type: Bug
>          Components: prepare
>            Reporter: Jens Mühlenhoff
>
> The following two methods will always return null if the attribute resolvedSnapshotDependencies is not null.
> Second you can avoid extra lookups by doing a get and check if the value is null (without calling containsKey before).
>     /**
>      * Retrieve the release version for the resolved snapshot dependency.
>      *
>      */
>     public String getDependencyDevelopmentVersion( String artifactConflictId )
>     {
>         if ( ( resolvedSnapshotDependencies == null ) && ( resolvedSnapshotDependencies.containsKey( artifactConflictId ) ) )
>         {
>             java.util.Map versionMap = ( java.util.Map ) resolvedSnapshotDependencies.get( artifactConflictId );
>             return ( String ) versionMap.get( DEVELOPMENT_KEY );
>         }
>         return null;
>     }
>     /**
>      * Retrieve the release version for the resolved snapshot dependency.
>      *
>      */
>     public String getDependencyReleaseVersion( String artifactConflictId )
>     {
>         if ( ( resolvedSnapshotDependencies == null ) && ( resolvedSnapshotDependencies.containsKey( artifactConflictId ) ) )
>         {
>             java.util.Map versionMap = ( java.util.Map ) resolvedSnapshotDependencies.get( artifactConflictId );
>             return ( String ) versionMap.get( RELEASE_KEY );
>         }
>         return null;
>     }

-- 
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: (MRELEASE-417) generated ReleaseDescriptor contains buggy method: getDependencyDevelopmentVersion and getDependencyReleaseVersion

Posted by "Jens Mühlenhoff (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MRELEASE-417?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=167184#action_167184 ] 

Jens Mühlenhoff commented on MRELEASE-417:
------------------------------------------

This could be a fix, but I don't know how to tell it maven to use it during code generation:

    public String getDependencyDevelopmentVersion( String artifactConflictId )
    {
        if( resolvedSnapshotDependencies != null ) {
            java.util.Map versionMap = ( java.util.Map ) resolvedSnapshotDependencies.get( artifactConflictId );
            if( versionMap != null ) {
                return ( String ) versionMap.get( DEVELOPMENT_KEY );
            }
        }
        return null;
    }

    public String getDependencyReleaseVersion( String artifactConflictId )
    {
        if ( ( resolvedSnapshotDependencies != null ) {
            java.util.Map versionMap = ( java.util.Map ) resolvedSnapshotDependencies.get( artifactConflictId );
            if( versionMap != null ) {
                return ( String ) versionMap.get( RELEASE_KEY );
            }
        }
        return null;
    }


> generated ReleaseDescriptor contains buggy method: getDependencyDevelopmentVersion and getDependencyReleaseVersion
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: MRELEASE-417
>                 URL: http://jira.codehaus.org/browse/MRELEASE-417
>             Project: Maven 2.x Release Plugin
>          Issue Type: Bug
>            Reporter: Jens Mühlenhoff
>
> The following two methods will always return null if the attribute resolvedSnapshotDependencies is not null.
> Second you can avoid extra lookups by doing a get and check if the value is null (without calling containsKey before).
>     /**
>      * Retrieve the release version for the resolved snapshot dependency.
>      *
>      */
>     public String getDependencyDevelopmentVersion( String artifactConflictId )
>     {
>         if ( ( resolvedSnapshotDependencies == null ) && ( resolvedSnapshotDependencies.containsKey( artifactConflictId ) ) )
>         {
>             java.util.Map versionMap = ( java.util.Map ) resolvedSnapshotDependencies.get( artifactConflictId );
>             return ( String ) versionMap.get( DEVELOPMENT_KEY );
>         }
>         return null;
>     }
>     /**
>      * Retrieve the release version for the resolved snapshot dependency.
>      *
>      */
>     public String getDependencyReleaseVersion( String artifactConflictId )
>     {
>         if ( ( resolvedSnapshotDependencies == null ) && ( resolvedSnapshotDependencies.containsKey( artifactConflictId ) ) )
>         {
>             java.util.Map versionMap = ( java.util.Map ) resolvedSnapshotDependencies.get( artifactConflictId );
>             return ( String ) versionMap.get( RELEASE_KEY );
>         }
>         return null;
>     }

-- 
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] Issue Comment Edited: (MRELEASE-417) generated ReleaseDescriptor contains buggy method: getDependencyDevelopmentVersion and getDependencyReleaseVersion

Posted by "Jens Mühlenhoff (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MRELEASE-417?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=167184#action_167184 ] 

Jens Mühlenhoff edited comment on MRELEASE-417 at 2/26/09 11:03 AM:
--------------------------------------------------------------------

Sorry, I cant edit my bug, it belongs to the prepare component. VErsion of maven is 2.0.10.

This could be a fix, but I don't know how to tell it maven to use it during code generation:
{{noformat}
    public String getDependencyDevelopmentVersion( String artifactConflictId )
    {
        if( resolvedSnapshotDependencies != null ) {
            java.util.Map versionMap = ( java.util.Map ) resolvedSnapshotDependencies.get( artifactConflictId );
            if( versionMap != null ) {
                return ( String ) versionMap.get( DEVELOPMENT_KEY );
            }
        }
        return null;
    }

    public String getDependencyReleaseVersion( String artifactConflictId )
    {
        if ( ( resolvedSnapshotDependencies != null ) {
            java.util.Map versionMap = ( java.util.Map ) resolvedSnapshotDependencies.get( artifactConflictId );
            if( versionMap != null ) {
                return ( String ) versionMap.get( RELEASE_KEY );
            }
        }
        return null;
    }
{{noformat}

      was (Author: jens.muehlenhoff):
    This could be a fix, but I don't know how to tell it maven to use it during code generation:

    public String getDependencyDevelopmentVersion( String artifactConflictId )
    {
        if( resolvedSnapshotDependencies != null ) {
            java.util.Map versionMap = ( java.util.Map ) resolvedSnapshotDependencies.get( artifactConflictId );
            if( versionMap != null ) {
                return ( String ) versionMap.get( DEVELOPMENT_KEY );
            }
        }
        return null;
    }

    public String getDependencyReleaseVersion( String artifactConflictId )
    {
        if ( ( resolvedSnapshotDependencies != null ) {
            java.util.Map versionMap = ( java.util.Map ) resolvedSnapshotDependencies.get( artifactConflictId );
            if( versionMap != null ) {
                return ( String ) versionMap.get( RELEASE_KEY );
            }
        }
        return null;
    }

  
> generated ReleaseDescriptor contains buggy method: getDependencyDevelopmentVersion and getDependencyReleaseVersion
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: MRELEASE-417
>                 URL: http://jira.codehaus.org/browse/MRELEASE-417
>             Project: Maven 2.x Release Plugin
>          Issue Type: Bug
>            Reporter: Jens Mühlenhoff
>
> The following two methods will always return null if the attribute resolvedSnapshotDependencies is not null.
> Second you can avoid extra lookups by doing a get and check if the value is null (without calling containsKey before).
>     /**
>      * Retrieve the release version for the resolved snapshot dependency.
>      *
>      */
>     public String getDependencyDevelopmentVersion( String artifactConflictId )
>     {
>         if ( ( resolvedSnapshotDependencies == null ) && ( resolvedSnapshotDependencies.containsKey( artifactConflictId ) ) )
>         {
>             java.util.Map versionMap = ( java.util.Map ) resolvedSnapshotDependencies.get( artifactConflictId );
>             return ( String ) versionMap.get( DEVELOPMENT_KEY );
>         }
>         return null;
>     }
>     /**
>      * Retrieve the release version for the resolved snapshot dependency.
>      *
>      */
>     public String getDependencyReleaseVersion( String artifactConflictId )
>     {
>         if ( ( resolvedSnapshotDependencies == null ) && ( resolvedSnapshotDependencies.containsKey( artifactConflictId ) ) )
>         {
>             java.util.Map versionMap = ( java.util.Map ) resolvedSnapshotDependencies.get( artifactConflictId );
>             return ( String ) versionMap.get( RELEASE_KEY );
>         }
>         return null;
>     }

-- 
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