[ 
https://issues.apache.org/jira/browse/IVY-1495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16025698#comment-16025698
 ] 

ASF GitHub Bot commented on IVY-1495:
-------------------------------------

GitHub user jaikiran reopened a pull request:

    https://github.com/apache/ant-ivy/pull/21

    Fix IVY-1495

    The commit here is a potential fix for the issue reported in 
https://issues.apache.org/jira/browse/IVY-1495. 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 https://github.com/jaikiran/ant-ivy ivy-1495

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

    https://github.com/apache/ant-ivy/pull/21.patch

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 <jaikiran....@gmail.com>
Date:   2017-05-19T09:00:33Z

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

----


> Using matcher attribute on ttl in settings file cause NullPointerException
> --------------------------------------------------------------------------
>
>                 Key: IVY-1495
>                 URL: https://issues.apache.org/jira/browse/IVY-1495
>             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="com.abc"  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(DefaultRepositoryCacheManager.java:252)
> {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
(v6.3.15#6346)

Reply via email to