[
https://issues.apache.org/jira/browse/ARIES-1700?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Guillaume Nodet resolved ARIES-1700.
------------------------------------
Resolution: Fixed
Fix Version/s: blueprint-noosgi-1.1.3
Committing to https://svn.apache.org/repos/asf/aries/trunk ...
M
blueprint/blueprint-noosgi/src/main/java/org/apache/aries/blueprint/container/NoOsgiRecipeBuilder.java
Committed r1787778
> 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
> Fix For: blueprint-noosgi-1.1.3
>
>
> 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)