You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by "Jin Feng (JIRA)" <ji...@apache.org> on 2014/11/14 02:21:34 UTC

[jira] [Resolved] (IVY-1496) PomModuleDescriptorBuilder. overwriteExtraInfoIfExists keeps on adding ExtraInfo, whether it's in the cache or not

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

Jin Feng resolved IVY-1496.
---------------------------
    Resolution: Duplicate

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