Uploaded image for project: 'Pluto'
  1. Pluto
  2. PLUTO-145

Bug in ResourceBundleFactory: NullPointerException when 'portlet.xml' does not define short-title or keywords.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.1.0-alpha1
    • 1.1.0-alpha1
    • portlet container
    • None

    Description

      I found a bug in org.apache.pluto.core.impl.ResourceBundleFactory (pluto-container subproject). When deploying new portlet app to pluto (1.1-ALPHA), if any of short-title or keywords is not defined in portlet.xml, a NullPointerException will be thrown out by GenericPortlet.getTitle() method. The reason is:

      In the constructor:

      defaultBundle = new ListResourceBundle() {
      Object[][] contents = new String[][]

      {title, shrtt, keys}

      ;
      public Object[][] getContents()

      { return contents; }

      };

      java.util.ListResourceBundle requires that, for the key/value pairs returned by getContents() method, both key and value should not be null. But the inner ListResourceBundle subclass does not check for null values.

      Regards.
      ZHENG Zhong

      Attachments

        1. ResourceBundleFactory.java
          4 kB
          @deprecated ZHENG Zhong

        Activity

          People

            ddewolf David H. DeWolf
            heavyz @deprecated ZHENG Zhong
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: