src/hotspot/share/libadt/set.cpp
changeset 55743 fb2b47f0e067
parent 53546 63eb7e38ce84
equal deleted inserted replaced
55742:6e1161923897 55743:fb2b47f0e067
    41 //------------------------------setstr-----------------------------------------
    41 //------------------------------setstr-----------------------------------------
    42 // Create a string with a printable representation of a set.
    42 // Create a string with a printable representation of a set.
    43 // The caller must deallocate the string.
    43 // The caller must deallocate the string.
    44 char *Set::setstr() const
    44 char *Set::setstr() const
    45 {
    45 {
    46   if( this == NULL ) return os::strdup("{no set}");
       
    47   Set &set = clone();           // Virtually copy the basic set.
    46   Set &set = clone();           // Virtually copy the basic set.
    48   set.Sort();                   // Sort elements for in-order retrieval
    47   set.Sort();                   // Sort elements for in-order retrieval
    49 
    48 
    50   uint len = 128;               // Total string space
    49   uint len = 128;               // Total string space
    51   char *buf = NEW_C_HEAP_ARRAY(char,len, mtCompiler);// Some initial string space
    50   char *buf = NEW_C_HEAP_ARRAY(char,len, mtCompiler);// Some initial string space