ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jin Feng (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (IVY-1496) PomModuleDescriptorBuilder. overwriteExtraInfoIfExists keeps on adding ExtraInfo, whether it's in the cache or not
Date Thu, 13 Nov 2014 03:36:26 GMT

     [ https://issues.apache.org/jira/browse/IVY-1496?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Jin Feng updated IVY-1496:
--------------------------
    Description: 
In [PomModuleDescriptorBuilder.java | https://svn.apache.org/repos/asf/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java]

{code}
    private void overwriteExtraInfoIfExists(String key, String value) {
        boolean found = false;
        for (ExtraInfoHolder extraInfoHolder : ivyModuleDescriptor.getExtraInfos()) {
            if (extraInfoHolder.getName().equals(key)) {
                extraInfoHolder.setContent(value);
                found = false;
            }
        }
        if (!found) {
            ivyModuleDescriptor.getExtraInfos().add(new ExtraInfoHolder(key, value));
        }
    }
{code}

The "found = false" inside the for loop should be "found = true".

As a result of the bug, the list is getting longer and longer, in some cases, the ivy command
would run for hours.

I believe the bug was introduced:

{noformat}
$ svn log -r 1592624 -v
------------------------------------------------------------------------
r1592624 | jlboudart | 2014-05-05 12:52:53 -0700 (Mon, 05 May 2014) | 1 line
Changed paths:
   M /ant/ivy/core/trunk/CHANGES.txt
   M /ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/DefaultModuleDescriptor.java
   M /ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/ModuleDescriptor.java
   M /ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/core/BundleInfoAdapter.java
   M /ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/repo/AbstractOSGiResolver.java
   M /ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java
   M /ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java
   M /ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParser.java
   M /ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java
   M /ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorWriterTest.java
   A /ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/test-write-extrainfo-from-maven.xml

FIX: regression introduced by IVY-1457, dependency management wasn't properly handled introducing
lots of resolution failures
------------------------------------------------------------------------
{noformat}

  was:
In [PomModuleDescriptorBuilder.java | https://svn.apache.org/repos/asf/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java]

{code}
    private void overwriteExtraInfoIfExists(String key, String value) {
        boolean found = false;
        for (ExtraInfoHolder extraInfoHolder : ivyModuleDescriptor.getExtraInfos()) {
            if (extraInfoHolder.getName().equals(key)) {
                extraInfoHolder.setContent(value);
                found = false;
            }
        }
        if (!found) {
            ivyModuleDescriptor.getExtraInfos().add(new ExtraInfoHolder(key, value));
        }
    }
{code}

The "found = false" inside the for loop should be "found = true".

As a result of the bug, the list is getting longer and longer, in some cases, the ivy command
would run for hours.


> PomModuleDescriptorBuilder. overwriteExtraInfoIfExists keeps on adding ExtraInfo, whether
it's in the cache or not
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: IVY-1496
>                 URL: https://issues.apache.org/jira/browse/IVY-1496
>             Project: Ivy
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: trunk
>            Reporter: Jin Feng
>
> In [PomModuleDescriptorBuilder.java | https://svn.apache.org/repos/asf/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java]
> {code}
>     private void overwriteExtraInfoIfExists(String key, String value) {
>         boolean found = false;
>         for (ExtraInfoHolder extraInfoHolder : ivyModuleDescriptor.getExtraInfos()) {
>             if (extraInfoHolder.getName().equals(key)) {
>                 extraInfoHolder.setContent(value);
>                 found = false;
>             }
>         }
>         if (!found) {
>             ivyModuleDescriptor.getExtraInfos().add(new ExtraInfoHolder(key, value));
>         }
>     }
> {code}
> The "found = false" inside the for loop should be "found = true".
> As a result of the bug, the list is getting longer and longer, in some cases, the ivy
command would run for hours.
> I believe the bug was introduced:
> {noformat}
> $ svn log -r 1592624 -v
> ------------------------------------------------------------------------
> r1592624 | jlboudart | 2014-05-05 12:52:53 -0700 (Mon, 05 May 2014) | 1 line
> Changed paths:
>    M /ant/ivy/core/trunk/CHANGES.txt
>    M /ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/DefaultModuleDescriptor.java
>    M /ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/ModuleDescriptor.java
>    M /ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/core/BundleInfoAdapter.java
>    M /ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/repo/AbstractOSGiResolver.java
>    M /ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java
>    M /ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java
>    M /ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParser.java
>    M /ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java
>    M /ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorWriterTest.java
>    A /ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/xml/test-write-extrainfo-from-maven.xml
> FIX: regression introduced by IVY-1457, dependency management wasn't properly handled
introducing lots of resolution failures
> ------------------------------------------------------------------------
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message