public String(@GuardSatisfied StringBuffer buffer){
synchronized (buffer) {
    this.value=Arrays.copyOf(buffer.getValue(),buffer.length());
  }
}

public String ( @ GuardSatisfied StringBuffer buffer ) { synchronized ( buffer ) { this . value = Arrays . copyOf ( buffer . getValue ( ) , buffer . length ( ) ) ; } }
allocates a new string that contains the sequence of characters currently contained in the string buffer argument . the contents of the string buffer are copied ; subsequent modification of the string buffer does not affect the newly created string .
