Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
blueprint-core-1.7.0
-
None
Description
The current version of NoOsgiRecipeBuilder has the following code:
else if (v instanceof IdRefMetadata)
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.