Beispiel #1
0
 /**
  * Appends the contents of the specified {@code StringBuffer}. If the
  * StringBuffer is {@code null}, then the string {@code "null"} is
  * appended.
  *
  * @param sb
  *            the {@code StringBuffer} to append.
  * @return this builder.
  */
 public StringBuilder append(StringBuffer sb)
 {
     if (sb == null) {
         appendNull();
     } else {
         append0(sb.getValue(), 0, sb.length());
     }
     return this;
 }
Beispiel #2
0
 /**
  * Adds the specified java.lang.StringBuffer to the end of this buffer.
  * <p />
  * If the specified java.lang.StringBuffer is {@code null} the string {@code "null"}
  * is appended, otherwise the contents of the specified java.lang.StringBuffer is
  * appended.
  *
  * @param sb
  *            the java.lang.StringBuffer to append (may be null).
  * @return this StringBuffer.
  *
  * @since 1.4
  */
 public java.lang.StringBuffer append(StringBuffer sb)
 {
     lock (this) {
         if (sb == null) {
             appendNull();
         } else {
             lock (sb) {
                 append0(sb.getValue(), 0, sb.length());
             }
         }
         return this;
     }
 }