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

locale retrieval from PortletRequestImpl throws NoSuchElement Exception

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.0-M1, 2.0.0
    • 2.0.0
    • None
    • 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);

      Attachments

        Activity

          People

            ate Ate Douma
            ubaggili 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