Pluto
  1. Pluto
  2. PLUTO-541

locale retrieval from PortletRequestImpl throws NoSuchElement Exception

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0-M1, 2.0.0
    • Fix Version/s: 2.0.0
    • Component/s: None
    • Labels:
      None

      Description

      when a portlet is trying to retrieve the locales and compare them with prefferedLocale and/or add them, the Enumeration that is used to retrieve the elements checks for "hasNextElement" but then retrieves "nextElement" twice.

      I'm attaching a patch for th simple fix:

      Index: pluto-container/src/main/java/org/apache/pluto/container/impl/PortletRequestImpl.java
      ===================================================================
      — pluto-container/src/main/java/org/apache/pluto/container/impl/PortletRequestImpl.java (revision 757432)
      +++ pluto-container/src/main/java/org/apache/pluto/container/impl/PortletRequestImpl.java (working copy)
      @@ -349,7 +349,7 @@
      Locale locale = (Locale)e.nextElement();
      if (!locale.equals(preferredLocale))

      { - locales.add((Locale)e.nextElement()); + locales.add(locale); }

      }
      return Collections.enumeration(locales);
      @@ -518,7 +518,7 @@
      Locale locale = (Locale)e.nextElement();
      if (!locale.equals(preferredLocale))

      { - locales.add(e.nextElement().toString()); + locales.add(locale.toString()); }

      }
      return Collections.enumeration(locales);

        Activity

        Ussama Baggili created issue -
        Ate Douma made changes -
        Field Original Value New Value
        Assignee Ate Douma [ adouma ]
        Ate Douma made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Fix Version/s 2.0.0-M1 [ 12313469 ]
        Resolution Fixed [ 1 ]
        Mark Thomas made changes -
        Workflow jira [ 12457138 ] Default workflow, editable Closed status [ 12565080 ]
        Mark Thomas made changes -
        Workflow Default workflow, editable Closed status [ 12565080 ] jira [ 12586141 ]

          People

          • Assignee:
            Ate Douma
            Reporter:
            Ussama Baggili
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 5m
              5m
              Remaining:
              Remaining Estimate - 5m
              5m
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development