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

        Hide
        Ate Douma added a comment -

        Fix applied

        Show
        Ate Douma added a comment - Fix applied
        Hide
        Ate Douma added a comment -

        Thanks for the report and the fix Ussama.
        I'll fix it ASAP.

        Show
        Ate Douma added a comment - Thanks for the report and the fix Ussama. I'll fix it ASAP.

          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