Uploaded image for project: 'Aries'
  1. Aries
  2. ARIES-1700

A possible null pointer

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • blueprint-core-1.7.0
    • blueprint-noosgi-1.1.3
    • Blueprint
    • None

    Description

      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.

      Attachments

        Activity

          People

            gnodet Guillaume Nodet
            haozhong Hao Zhong
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: