You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Guangtai Liang (JIRA)" <ji...@codehaus.org> on 2012/02/16 06:47:02 UTC

[jira] (MWAR-275) An incomplete fix for the NPE bugs in WebappStructure.java

Guangtai Liang created MWAR-275:
-----------------------------------

             Summary: An incomplete fix for the NPE bugs in WebappStructure.java
                 Key: MWAR-275
                 URL: https://jira.codehaus.org/browse/MWAR-275
             Project: Maven 2.x WAR Plugin
          Issue Type: Bug
            Reporter: Guangtai Liang
            Priority: Critical


The fix revision 712569 was aimed to remove an NPE bug on the value of  "dependenciesInfo " in the method "getDependencies" of the file "/maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/util/WebappStructure.java" , but it is incomplete. 
Since the value  "dependenciesInfo " could be null during the runtime execution, its value should also be null-checked before being dereferenced in other methods. 

The buggy code locations the same fix needs to be applied at are as bellows: 

Line 389 of the method "registerTargetFileName";
public void registerTargetFileName( Artifact artifact, String targetFileName )
    {
[Line 389] final Iterator it = dependenciesInfo.iterator();
        while ( it.hasNext() )
        {
            DependencyInfo dependencyInfo = (DependencyInfo) it.next();
            if ( WarUtils.isRelated( artifact, dependencyInfo.getDependency() ) )
            {
                dependencyInfo.setTargetFileName( targetFileName );
            }
        }
    }


--
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] (MWAR-275) An incomplete fix for the NPE bugs in WebappStructure.java

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

Dennis Lundberg updated MWAR-275:
---------------------------------

    Description: 
The fix revision 712569 was aimed to remove an NPE bug on the value of  "dependenciesInfo " in the method "getDependencies" of the file "/maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/util/WebappStructure.java" , but it is incomplete. 
Since the value  "dependenciesInfo " could be null during the runtime execution, its value should also be null-checked before being dereferenced in other methods. 

The buggy code locations the same fix needs to be applied at are as bellows: 

Line 389 of the method "registerTargetFileName";
{code}
public void registerTargetFileName( Artifact artifact, String targetFileName )
    {
[Line 389] final Iterator it = dependenciesInfo.iterator();
        while ( it.hasNext() )
        {
            DependencyInfo dependencyInfo = (DependencyInfo) it.next();
            if ( WarUtils.isRelated( artifact, dependencyInfo.getDependency() ) )
            {
                dependencyInfo.setTargetFileName( targetFileName );
            }
        }
    }
{code}


  was:
The fix revision 712569 was aimed to remove an NPE bug on the value of  "dependenciesInfo " in the method "getDependencies" of the file "/maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/util/WebappStructure.java" , but it is incomplete. 
Since the value  "dependenciesInfo " could be null during the runtime execution, its value should also be null-checked before being dereferenced in other methods. 

The buggy code locations the same fix needs to be applied at are as bellows: 

Line 389 of the method "registerTargetFileName";
public void registerTargetFileName( Artifact artifact, String targetFileName )
    {
[Line 389] final Iterator it = dependenciesInfo.iterator();
        while ( it.hasNext() )
        {
            DependencyInfo dependencyInfo = (DependencyInfo) it.next();
            if ( WarUtils.isRelated( artifact, dependencyInfo.getDependency() ) )
            {
                dependencyInfo.setTargetFileName( targetFileName );
            }
        }
    }


    
> An incomplete fix for the NPE bugs in WebappStructure.java
> ----------------------------------------------------------
>
>                 Key: MWAR-275
>                 URL: https://jira.codehaus.org/browse/MWAR-275
>             Project: Maven 2.x WAR Plugin
>          Issue Type: Bug
>            Reporter: Guangtai Liang
>            Priority: Critical
>
> The fix revision 712569 was aimed to remove an NPE bug on the value of  "dependenciesInfo " in the method "getDependencies" of the file "/maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/util/WebappStructure.java" , but it is incomplete. 
> Since the value  "dependenciesInfo " could be null during the runtime execution, its value should also be null-checked before being dereferenced in other methods. 
> The buggy code locations the same fix needs to be applied at are as bellows: 
> Line 389 of the method "registerTargetFileName";
> {code}
> public void registerTargetFileName( Artifact artifact, String targetFileName )
>     {
> [Line 389] final Iterator it = dependenciesInfo.iterator();
>         while ( it.hasNext() )
>         {
>             DependencyInfo dependencyInfo = (DependencyInfo) it.next();
>             if ( WarUtils.isRelated( artifact, dependencyInfo.getDependency() ) )
>             {
>                 dependencyInfo.setTargetFileName( targetFileName );
>             }
>         }
>     }
> {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] (MWAR-275) An incomplete fix for the NPE bugs in WebappStructure.java

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

Dennis Lundberg closed MWAR-275.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 2.3
         Assignee: Dennis Lundberg

Fixed in [r1390192|http://svn.apache.org/viewvc?view=revision&revision=1390192].
Thanks for the detailed report!
                
> An incomplete fix for the NPE bugs in WebappStructure.java
> ----------------------------------------------------------
>
>                 Key: MWAR-275
>                 URL: https://jira.codehaus.org/browse/MWAR-275
>             Project: Maven 2.x WAR Plugin
>          Issue Type: Bug
>            Reporter: Guangtai Liang
>            Assignee: Dennis Lundberg
>            Priority: Critical
>             Fix For: 2.3
>
>
> The fix revision 712569 was aimed to remove an NPE bug on the value of  "dependenciesInfo " in the method "getDependencies" of the file "/maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/util/WebappStructure.java" , but it is incomplete. 
> Since the value  "dependenciesInfo " could be null during the runtime execution, its value should also be null-checked before being dereferenced in other methods. 
> The buggy code locations the same fix needs to be applied at are as bellows: 
> Line 389 of the method "registerTargetFileName";
> {code}
> public void registerTargetFileName( Artifact artifact, String targetFileName )
>     {
> [Line 389] final Iterator it = dependenciesInfo.iterator();
>         while ( it.hasNext() )
>         {
>             DependencyInfo dependencyInfo = (DependencyInfo) it.next();
>             if ( WarUtils.isRelated( artifact, dependencyInfo.getDependency() ) )
>             {
>                 dependencyInfo.setTargetFileName( targetFileName );
>             }
>         }
>     }
> {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