aries-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Guillaume Nodet (JIRA)" <j...@apache.org>
Subject [jira] [Assigned] (ARIES-1700) A possible null pointer
Date Mon, 20 Mar 2017 13:03:41 GMT

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

Guillaume Nodet reassigned ARIES-1700:
--------------------------------------

    Assignee: Guillaume Nodet

> A possible null pointer
> -----------------------
>
>                 Key: ARIES-1700
>                 URL: https://issues.apache.org/jira/browse/ARIES-1700
>             Project: Aries
>          Issue Type: Bug
>          Components: Blueprint
>    Affects Versions: blueprint-core-1.7.0
>            Reporter: Hao Zhong
>            Assignee: Guillaume Nodet
>            Priority: Minor
>
> The current version of NoOsgiRecipeBuilder has the following code:
>  else if (v instanceof IdRefMetadata) {
>             // TODO: make it work with property-placeholders?
>             String componentName = ((IdRefMetadata) v).getComponentId();
>             IdRefRecipe rnr = new IdRefRecipe(getName(null), componentName);
>             return rnr;
>         } else {
>             throw new IllegalStateException("Unsupported value: " + v.getClass().getName());
>         }
> Here, v.getClass() can return null. The line shall be revised as:
> throw new IllegalStateException("Unsupported value: " + (v != null ? v.getClass().getName()
: "null"));
> Indeed, I notice that the file, RecipeBuilder, has the following similar code:
> else if (v instanceof IdRefMetadata) {
>             // TODO: make it work with property-placeholders?
>             String componentName = ((IdRefMetadata) v).getComponentId();
>             IdRefRecipe rnr = new IdRefRecipe(getName(null), componentName);
>             return rnr;
>         } else {
>             throw new IllegalStateException("Unsupported value: " + (v != null ? v.getClass().getName()
: "null"));
>         }
> It checks whether v is null or not.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message