Wicket
  1. Wicket
  2. WICKET-4184

AppendingStringBuffer.insert infinite loop

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.5.2
    • Fix Version/s: 1.5.3
    • Component/s: wicket
    • Labels:
      None

      Description

      When trying to insert a StringBuffer into an AppendingStringBuffer, the method

      public AppendingStringBuffer insert(final int offset, final Object obj)

      will call itself repeatedly generating an infinite loop.

      The fix would be to call toString() method if the object is a StringBuffer

      public AppendingStringBuffer insert(final int offset, final Object obj)
      {
      if (obj instanceof AppendingStringBuffer)

      { AppendingStringBuffer asb = (AppendingStringBuffer)obj; return insert(offset, asb.value, 0, asb.count); }

      else if (obj instanceof StringBuffer)

      { //return insert(offset, obj); return insert(offset, obj.toString()); }

      return insert(offset, String.valueOf(obj));
      }

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Igor Vaynberg
            Reporter:
            Dima Magdalena
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development