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

PortletPreferencesImpl should not store the preferences every time it is instantiated

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.0-refactoring, 2.0.0
    • 2.0-refactoring, 1.1.6, 2.0.0
    • portlet container
    • None
    • Tomcat 5.5.26

    Description

      In Pluto 1.1.5, the constructor of org.apache.pluto.internal.impl.PortletPreferencesImpl calls internalStore() every time. It would be better to only store the preferences when it is actually necessary – I believe this is the case only when the prefs from portlet.xml have not yet been stored:
      ...
      Set portletXmlPrefNames = getPreferenceNames(defaultPreferences);
      Set persistedPrefNames = getPreferenceNames(storedPreferences);
      if (!persistedPrefNames.containsAll(portletXmlPrefNames))

      { internalStore(); }

      ...

      private Set getPreferenceNames(InternalPortletPreference[] prefs) {
      Set prefNames = new HashSet();
      for (int i = 0; i < prefs.length; i++)

      { prefNames.add(prefs[i].getName()); }

      return prefNames;
      }

      Attachments

        1. P487-1.1.x-Rev656347.diff
          2 kB
          Nikita Dubrovsky

        Activity

          People

            edalquist Eric Dalquist
            nikd Nikita Dubrovsky
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: