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

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        5h 18m 1 Igor Vaynberg 28/Oct/11 17:25
        Igor Vaynberg made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 1.5.3 [ 12318550 ]
        Resolution Fixed [ 1 ]
        Igor Vaynberg made changes -
        Field Original Value New Value
        Assignee Igor Vaynberg [ ivaynberg ]
        Dima Magdalena created 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