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)
else if (obj instanceof StringBuffer)
{ //return insert(offset, obj); return insert(offset, obj.toString()); } return insert(offset, String.valueOf(obj));
}