Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-3084

CharSetUtil.getEncoding fails with an IndexOutOfBoundsException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.4.0, 1.4.1, 1.4.2, 1.4.3, 1.4.4, 1.4.5, 1.4.6, 1.4.7, 1.4.8, 1.4.9, 1.4.10, 1.4.11, 1.4.12
    • 1.4.13, 1.5-M3
    • wicket-extensions
    • None
    • Windows XP; Wicket 1.4.x.

    Description

      We are experiencing some problems in CharSetUtil.getEncoding(). When used, we see the following stacktrace appear:

      java.lang.IndexOutOfBoundsException: Index: 4, Size: 0
      at java.util.ArrayList.add(ArrayList.java:367)
      at org.apache.wicket.extensions.util.encoding.CharSetMap.<init>(CharSetMap.java:238)
      at org.apache.wicket.extensions.util.encoding.CharSetUtil.initialize(CharSetUtil.java:72)
      at org.apache.wicket.extensions.util.encoding.CharSetUtil.getEncoding(CharSetUtil.java:102)

      As I understand the code in CharSetMap, it looks like the construction of the encodings array list fails. The paths it tries to load encoding map files from yield exceptions causing the array list to remain empty.

      See attached quickstart for a sample.

      Attachments

        1. charsetutil-jira3084.zip
          7 kB
          J.W. Janssen

        Activity

          People

            ivaynberg Igor Vaynberg
            jajans J.W. Janssen
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: