Uploaded image for project: 'Ivy'
  1. Ivy
  2. IVY-1495

Using matcher attribute on ttl in settings file cause NullPointerException

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.4.0-RC1
    • Fix Version/s: 2.5.0-rc1
    • Component/s: Core
    • Labels:
      None

      Description

      Using similar config in ivysettings cause NullPointerException

      	<caches default="ivyCache" >
      	 <cache name="ivyCache" basedir="${default.cache.dir}" defaultTTL="eternal" >
      	    <ttl organisation="com.abc"  duration="0ms" matcher="regexp"/>
      	 </cache>
      	</caches>
      

      Value of matcher doesn't matter

      c:\test-ttl.xml:23: impossible to configure ivy:settings with given file: c:\ivysettings.xml : java.text.ParseException: failed to load settings from file:/c:/ivysettings.xml: impossible to add configured child for ttl on class org.apache.ivy.core.cache.DefaultRepositoryCacheManager: java.lang.NullPointerException at org.apache.ivy.core.cache.DefaultRepositoryCacheManager.addConfiguredTtl(DefaultRepositoryCacheManager.java:252)
      

      Looking and debugging line 252 in DefaultrepositoryCacheManager, the settings variable is not yet initialized in that point of parsing

      addTTL(attributes,
                  matcher == null ? ExactPatternMatcher.INSTANCE : settings.getMatcher(matcher),
                  parseDuration(duration));
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                hibou Nicolas Lalevée
                Reporter:
                Martin Krajc Martin Krajc
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: