Pluto
  1. Pluto
  2. PLUTO-487

PortletPreferencesImpl should not store the preferences every time it is instantiated

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-refactoring, 2.0.0
    • Fix Version/s: 2.0-refactoring, 1.1.6, 2.0.0
    • Component/s: portlet container
    • Labels:
      None
    • Environment:
      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;
      }

        Activity

        Nikita Dubrovsky created issue -
        Nikita Dubrovsky made changes -
        Field Original Value New Value
        Attachment P487-1.1.x-Rev656347.diff [ 12382075 ]
        Nikita Dubrovsky made changes -
        Fix Version/s 1.1.6 [ 12313075 ]
        Eric Dalquist made changes -
        Assignee Eric Dalquist [ edalquist ]
        Eric Dalquist made changes -
        Fix Version/s 2.0.0 [ 12312914 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Craig Doremus made changes -
        Affects Version/s 1.1.5 [ 12312652 ]
        Affects Version/s 2.0.0 [ 12312914 ]
        Affects Version/s 2.0-refactoring [ 12313313 ]
        Craig Doremus made changes -
        Status Resolved [ 5 ] Reopened [ 4 ]
        Resolution Fixed [ 1 ]
        Eric Dalquist made changes -
        Resolution Fixed [ 1 ]
        Status Reopened [ 4 ] Resolved [ 5 ]
        Fix Version/s 2.0-refactoring [ 12313313 ]
        Mark Thomas made changes -
        Workflow jira [ 12431096 ] Default workflow, editable Closed status [ 12565007 ]
        Mark Thomas made changes -
        Workflow Default workflow, editable Closed status [ 12565007 ] jira [ 12585935 ]

          People

          • Assignee:
            Eric Dalquist
            Reporter:
            Nikita Dubrovsky
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development