ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leigh L. Klotz, Jr (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (IVY-1296) dual resolver without @name gives NPE
Date Thu, 26 May 2011 21:12:53 GMT

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

Leigh L. Klotz, Jr updated IVY-1296:
------------------------------------

    Description: 
A <dual> with no name attribute gets an NPE in resolve.

<dual> says it uses common attributes.  If so, it really should check and complain instead
of blowing up cryptically.

Here's a test-caseish description:

<ivysettings>
 <settings defaultResolver="x" />
 <resolvers>
    <chain name="vendor-1">
      <dual >
        <filesystem name="vendor1-ivy" checkmodified="true" changingPattern=".*">
          <ivy pattern="${vendor.dir}/vendor1-ivy/[organization]-ivy.xml" />
        </filesystem>
        <filesystem name="vendor1-jars" checkmodified="true" changingPattern=".*">
          <artifact pattern="${vendor.dir}/vendor1/[artifact].[ext]" />
        </filesystem>
      </dual>
    </chain>
    <chain name="x"> ... </chain>
  </resolvers>
  <modules>
    <module organisation="com.vendor1" module="*" resolver="vendor1" />
  </modules>
</ivysettings>



 vendor1's module object has a resolver with no name, and it gets an NPE trying to cache that
name inside DefaultRepositoryCacheManager.saveResolvers.

main[1] where
  [1] java.util.Hashtable.put (Hashtable.java:394)
  [2] java.util.Properties.setProperty (Properties.java:143)
  [3] org.apache.ivy.core.cache.DefaultRepositoryCacheManager.saveResolvers (DefaultRepositoryCacheManager.java:423)
  [4] org.apache.ivy.core.resolve.IvyNode.loadData (IvyNode.java:176)
  [5] org.apache.ivy.core.resolve.VisitNode.loadData (VisitNode.java:287)
  [6] org.apache.ivy.core.resolve.ResolveEngine.fetchDependencies (ResolveEngine.java:696)
  [7] org.apache.ivy.core.resolve.ResolveEngine.doFetchDependencies (ResolveEngine.java:781)
  [8] org.apache.ivy.core.resolve.ResolveEngine.fetchDependencies (ResolveEngine.java:704)
  [9] org.apache.ivy.core.resolve.ResolveEngine.doFetchDependencies (ResolveEngine.java:781)
  [10] org.apache.ivy.core.resolve.ResolveEngine.fetchDependencies (ResolveEngine.java:704)
  [11] org.apache.ivy.core.resolve.ResolveEngine.getDependencies (ResolveEngine.java:576)
  [12] org.apache.ivy.core.resolve.ResolveEngine.resolve (ResolveEngine.java:237)
  [13] org.apache.ivy.core.resolve.ResolveEngine.resolve (ResolveEngine.java:195)
  [14] org.apache.ivy.Ivy.resolve (Ivy.java:502)
  [15] org.apache.ivy.ant.IvyResolve.doExecute (IvyResolve.java:244)
  [16] org.apache.ivy.ant.IvyTask.execute (IvyTask.java:277)
  [17] org.apache.tools.ant.UnknownElement.execute (UnknownElement.java:291)
  [18] sun.reflect.GeneratedMethodAccessor5.invoke (null)
  [19] sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25)
  [20] java.lang.reflect.Method.invoke (Method.java:597)
  [21] org.apache.tools.ant.dispatch.DispatchUtils.execute (DispatchUtils.java:106)
  [22] org.apache.tools.ant.Task.perform (Task.java:348)
  [23] org.apache.tools.ant.Target.execute (Target.java:390)
  [24] org.apache.tools.ant.Target.performTasks (Target.java:411)
  [25] org.apache.tools.ant.Project.executeSortedTargets (Project.java:1,360)
  [26] org.apache.tools.ant.Project.executeTarget (Project.java:1,329)
  [27] org.apache.tools.ant.helper.DefaultExecutor.executeTargets (DefaultExecutor.java:41)
  [28] org.apache.tools.ant.Project.executeTargets (Project.java:1,212)
  [29] org.apache.tools.ant.Main.runBuild (Main.java:801)
  [30] org.apache.tools.ant.Main.startAnt (Main.java:218)
  [31] org.apache.tools.ant.launch.Launcher.run (Launcher.java:280)
  [32] org.apache.tools.ant.launch.Launcher.main (Launcher.java:109)
main[1] 

  was:
A <dual> with no name attribute gets an NPE in resolve because the
http://ant.apache.org/ivy/history/trunk/settings/resolvers.html#common says that name is required
on resolvers, but it's neither checked nor enforced, and some places later blows up with an
NPE.

<dual> says it uses common attributes.  If so, it really should check and complain instead
of blowing up cryptically.

Alternatively, a schema for ivy-settings would help as well.  (I know it says it's free-form,
but if it crashes with NPE with malformed input, it's not exactly free-form.)

Here's a test-caseish description:

<ivysettings>
 <settings defaultResolver="x" />
 <resolvers>
    <chain name="vendor-1">
      <dual >
        <filesystem name="vendor1-ivy" checkmodified="true" changingPattern=".*">
          <ivy pattern="${vendor.dir}/vendor1-ivy/[organization]-ivy.xml" />
        </filesystem>
        <filesystem name="vendor1-jars" checkmodified="true" changingPattern=".*">
          <artifact pattern="${vendor.dir}/vendor1/[artifact].[ext]" />
        </filesystem>
      </dual>
    </chain>
    <chain name="x"> ... </chain>
  </resolvers>
  <modules>
    <module organisation="com.vendor1" module="*" resolver="vendor1" />
  </modules>
</ivysettings>



 vendor1's module object has a resolver with no name, and it gets an NPE trying to cache that
name inside DefaultRepositoryCacheManager.saveResolvers.

main[1] where
  [1] java.util.Hashtable.put (Hashtable.java:394)
  [2] java.util.Properties.setProperty (Properties.java:143)
  [3] org.apache.ivy.core.cache.DefaultRepositoryCacheManager.saveResolvers (DefaultRepositoryCacheManager.java:423)
  [4] org.apache.ivy.core.resolve.IvyNode.loadData (IvyNode.java:176)
  [5] org.apache.ivy.core.resolve.VisitNode.loadData (VisitNode.java:287)
  [6] org.apache.ivy.core.resolve.ResolveEngine.fetchDependencies (ResolveEngine.java:696)
  [7] org.apache.ivy.core.resolve.ResolveEngine.doFetchDependencies (ResolveEngine.java:781)
  [8] org.apache.ivy.core.resolve.ResolveEngine.fetchDependencies (ResolveEngine.java:704)
  [9] org.apache.ivy.core.resolve.ResolveEngine.doFetchDependencies (ResolveEngine.java:781)
  [10] org.apache.ivy.core.resolve.ResolveEngine.fetchDependencies (ResolveEngine.java:704)
  [11] org.apache.ivy.core.resolve.ResolveEngine.getDependencies (ResolveEngine.java:576)
  [12] org.apache.ivy.core.resolve.ResolveEngine.resolve (ResolveEngine.java:237)
  [13] org.apache.ivy.core.resolve.ResolveEngine.resolve (ResolveEngine.java:195)
  [14] org.apache.ivy.Ivy.resolve (Ivy.java:502)
  [15] org.apache.ivy.ant.IvyResolve.doExecute (IvyResolve.java:244)
  [16] org.apache.ivy.ant.IvyTask.execute (IvyTask.java:277)
  [17] org.apache.tools.ant.UnknownElement.execute (UnknownElement.java:291)
  [18] sun.reflect.GeneratedMethodAccessor5.invoke (null)
  [19] sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25)
  [20] java.lang.reflect.Method.invoke (Method.java:597)
  [21] org.apache.tools.ant.dispatch.DispatchUtils.execute (DispatchUtils.java:106)
  [22] org.apache.tools.ant.Task.perform (Task.java:348)
  [23] org.apache.tools.ant.Target.execute (Target.java:390)
  [24] org.apache.tools.ant.Target.performTasks (Target.java:411)
  [25] org.apache.tools.ant.Project.executeSortedTargets (Project.java:1,360)
  [26] org.apache.tools.ant.Project.executeTarget (Project.java:1,329)
  [27] org.apache.tools.ant.helper.DefaultExecutor.executeTargets (DefaultExecutor.java:41)
  [28] org.apache.tools.ant.Project.executeTargets (Project.java:1,212)
  [29] org.apache.tools.ant.Main.runBuild (Main.java:801)
  [30] org.apache.tools.ant.Main.startAnt (Main.java:218)
  [31] org.apache.tools.ant.launch.Launcher.run (Launcher.java:280)
  [32] org.apache.tools.ant.launch.Launcher.main (Launcher.java:109)
main[1] 


Alternatively, a schema for ivy-settings would help as well.  (I know it says it's free-form,
but if it crashes with NPE with malformed input, it's not exactly free-form.)


> dual resolver without @name gives NPE
> -------------------------------------
>
>                 Key: IVY-1296
>                 URL: https://issues.apache.org/jira/browse/IVY-1296
>             Project: Ivy
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.2.0
>            Reporter: Leigh L. Klotz, Jr
>            Priority: Minor
>              Labels: NPE
>
> A <dual> with no name attribute gets an NPE in resolve.
> <dual> says it uses common attributes.  If so, it really should check and complain
instead of blowing up cryptically.
> Here's a test-caseish description:
> <ivysettings>
>  <settings defaultResolver="x" />
>  <resolvers>
>     <chain name="vendor-1">
>       <dual >
>         <filesystem name="vendor1-ivy" checkmodified="true" changingPattern=".*">
>           <ivy pattern="${vendor.dir}/vendor1-ivy/[organization]-ivy.xml" />
>         </filesystem>
>         <filesystem name="vendor1-jars" checkmodified="true" changingPattern=".*">
>           <artifact pattern="${vendor.dir}/vendor1/[artifact].[ext]" />
>         </filesystem>
>       </dual>
>     </chain>
>     <chain name="x"> ... </chain>
>   </resolvers>
>   <modules>
>     <module organisation="com.vendor1" module="*" resolver="vendor1" />
>   </modules>
> </ivysettings>
>  vendor1's module object has a resolver with no name, and it gets an NPE trying to cache
that name inside DefaultRepositoryCacheManager.saveResolvers.
> main[1] where
>   [1] java.util.Hashtable.put (Hashtable.java:394)
>   [2] java.util.Properties.setProperty (Properties.java:143)
>   [3] org.apache.ivy.core.cache.DefaultRepositoryCacheManager.saveResolvers (DefaultRepositoryCacheManager.java:423)
>   [4] org.apache.ivy.core.resolve.IvyNode.loadData (IvyNode.java:176)
>   [5] org.apache.ivy.core.resolve.VisitNode.loadData (VisitNode.java:287)
>   [6] org.apache.ivy.core.resolve.ResolveEngine.fetchDependencies (ResolveEngine.java:696)
>   [7] org.apache.ivy.core.resolve.ResolveEngine.doFetchDependencies (ResolveEngine.java:781)
>   [8] org.apache.ivy.core.resolve.ResolveEngine.fetchDependencies (ResolveEngine.java:704)
>   [9] org.apache.ivy.core.resolve.ResolveEngine.doFetchDependencies (ResolveEngine.java:781)
>   [10] org.apache.ivy.core.resolve.ResolveEngine.fetchDependencies (ResolveEngine.java:704)
>   [11] org.apache.ivy.core.resolve.ResolveEngine.getDependencies (ResolveEngine.java:576)
>   [12] org.apache.ivy.core.resolve.ResolveEngine.resolve (ResolveEngine.java:237)
>   [13] org.apache.ivy.core.resolve.ResolveEngine.resolve (ResolveEngine.java:195)
>   [14] org.apache.ivy.Ivy.resolve (Ivy.java:502)
>   [15] org.apache.ivy.ant.IvyResolve.doExecute (IvyResolve.java:244)
>   [16] org.apache.ivy.ant.IvyTask.execute (IvyTask.java:277)
>   [17] org.apache.tools.ant.UnknownElement.execute (UnknownElement.java:291)
>   [18] sun.reflect.GeneratedMethodAccessor5.invoke (null)
>   [19] sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25)
>   [20] java.lang.reflect.Method.invoke (Method.java:597)
>   [21] org.apache.tools.ant.dispatch.DispatchUtils.execute (DispatchUtils.java:106)
>   [22] org.apache.tools.ant.Task.perform (Task.java:348)
>   [23] org.apache.tools.ant.Target.execute (Target.java:390)
>   [24] org.apache.tools.ant.Target.performTasks (Target.java:411)
>   [25] org.apache.tools.ant.Project.executeSortedTargets (Project.java:1,360)
>   [26] org.apache.tools.ant.Project.executeTarget (Project.java:1,329)
>   [27] org.apache.tools.ant.helper.DefaultExecutor.executeTargets (DefaultExecutor.java:41)
>   [28] org.apache.tools.ant.Project.executeTargets (Project.java:1,212)
>   [29] org.apache.tools.ant.Main.runBuild (Main.java:801)
>   [30] org.apache.tools.ant.Main.startAnt (Main.java:218)
>   [31] org.apache.tools.ant.launch.Launcher.run (Launcher.java:280)
>   [32] org.apache.tools.ant.launch.Launcher.main (Launcher.java:109)
> main[1] 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message