ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Commented] (IVY-1495) Using matcher attribute on ttl in settings file cause NullPointerException
Date Fri, 19 May 2017 11:57:04 GMT


ASF GitHub Bot commented on IVY-1495:

GitHub user jaikiran opened a pull request:

    Fix IVY-1495

    The commit here is a potential fix for the issue reported in
The issue happens when the `ivysettings.xml` is being parsed and the `IvySettings` instance
isn't yet available for getting hold of a relevant `matcher` referred to in the `ttl` config.
    The commit here delays the access to the `matcher` from the `settings` instance, to when
the settings instance is available.
    The commit also includes a test case to verify the change.

You can merge this pull request into a Git repository by running:

    $ git pull ivy-1495

Alternatively you can review and apply these changes as the patch at:

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #21
commit 0a50b2b3b5ecb67565505217876f355f74f5078f
Author: Jaikiran Pai <>
Date:   2017-05-19T09:00:33Z

    IVY-1495 Delay the processing of configured cache ttls, until the IvySettings object is


> Using matcher attribute on ttl in settings file cause NullPointerException
> --------------------------------------------------------------------------
>                 Key: IVY-1495
>                 URL:
>             Project: Ivy
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.4.0-RC1
>            Reporter: Martin Krajc
> Using similar config in ivysettings cause NullPointerException
> {code}
> 	<caches default="ivyCache" >
> 	 <cache name="ivyCache" basedir="${default.cache.dir}" defaultTTL="eternal" >
> 	    <ttl organisation=""  duration="0ms" matcher="regexp"/>
> 	 </cache>
> 	</caches>
> {code}
> Value of matcher doesn't matter
> {code}
> 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(
> {code}
> Looking and debugging line 252 in DefaultrepositoryCacheManager, the settings variable
is not yet initialized in that point of parsing 
> {code}
> addTTL(attributes,
>             matcher == null ? ExactPatternMatcher.INSTANCE : settings.getMatcher(matcher),
>             parseDuration(duration));
> {code}

This message was sent by Atlassian JIRA

View raw message