ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "M Kim (JIRA)" <j...@apache.org>
Subject [jira] [Created] (IVY-1514) NullPointerException occurs during listTokenValues in IBiblioResolver
Date Mon, 16 Feb 2015 18:12:11 GMT
M Kim created IVY-1514:
--------------------------

             Summary: NullPointerException occurs during listTokenValues in IBiblioResolver
                 Key: IVY-1514
                 URL: https://issues.apache.org/jira/browse/IVY-1514
             Project: Ivy
          Issue Type: Bug
    Affects Versions: 2.4.0
            Reporter: M Kim


NullPointerException occurs during listTokenValues in IBiblioResolver. During the process
of findIvyNames, tokenValues of ORGANISATION_KEY may be null. 

{code}
    protected Collection<String> findIvyNames(Map<String, String> tokenValues,
String token) {
        Collection<String> names = new HashSet<String>();
        tokenValues = new HashMap<String, String>(tokenValues);
        tokenValues.put(IvyPatternHelper.ARTIFACT_KEY, "ivy");
        tokenValues.put(IvyPatternHelper.TYPE_KEY, "ivy");
        tokenValues.put(IvyPatternHelper.EXT_KEY, "xml");
        if (isM2compatible()) {
            convertM2TokenValuesForResourceSearch(tokenValues);
        }
        //...
    }

    protected void convertM2TokenValuesForResourceSearch(Map<String, String> tokenValues)
{
        tokenValues.put(IvyPatternHelper.ORGANISATION_KEY,
            convertM2OrganizationForResourceSearch(tokenValues
                    .get(IvyPatternHelper.ORGANISATION_KEY))); //arg can be null
    }
{code}

<Stack Trace>
{code}
test(Test1)java.lang.NullPointerException
at org.apache.ivy.plugins.resolver.AbstractPatternsBasedResolver.convertM2OrganizationForResourceSearch(AbstractPatternsBasedResolver.java:354)
at org.apache.ivy.plugins.resolver.AbstractPatternsBasedResolver.convertM2TokenValuesForResourceSearch(AbstractPatternsBasedResolver.java:358)
at org.apache.ivy.plugins.resolver.AbstractPatternsBasedResolver.findIvyNames(AbstractPatternsBasedResolver.java:139)
at org.apache.ivy.plugins.resolver.AbstractPatternsBasedResolver.findNames(AbstractPatternsBasedResolver.java:125)
at org.apache.ivy.plugins.resolver.BasicResolver.listTokenValues(BasicResolver.java:925)
at org.apache.ivy.plugins.resolver.IBiblioResolver.listTokenValues(IBiblioResolver.java:327)
at Test1.test(Test1.java:42)
{code}

<Test Case>
{code}
public void test() {
  BintrayResolver resolver = new BintrayResolver();
  Map tokenValues = ModuleRevisionId.newInstance("", "hi!", "hi!").getQualifiedExtraAttributes();
  resolver.listTokenValues("token", tokenValues);
}
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message