| 876 | /// |
| 877 | /// the string representation of this `Hashtable`. |
| 878 | @Override |
| 879 | public synchronized String toString() { |
| 880 | if (isEmpty()) { |
| 881 | return "{}"; //$NON-NLS-1$ |
| 882 | } |
| 883 | |
| 884 | StringBuffer buffer = new StringBuffer(size() * 28); |
| 885 | buffer.append('{'); |
| 886 | for (int i = lastSlot; i >= firstSlot; i--) { |
| 887 | Entry<K, V> entry = elementData[i]; |
| 888 | while (entry != null) { |
| 889 | if (entry.key != this) { |
| 890 | buffer.append(entry.key); |
| 891 | } else { |
| 892 | // luni.04=this Map |
| 893 | buffer.append("(this)"); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$ |
| 894 | } |
| 895 | buffer.append('='); |
| 896 | if (entry.value != this) { |
| 897 | buffer.append(entry.value); |
| 898 | } else { |
| 899 | // luni.04=this Map |
| 900 | buffer.append("(this)"); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$ |
| 901 | } |
| 902 | buffer.append(", "); //$NON-NLS-1$ |
| 903 | entry = entry.next; |
| 904 | } |
| 905 | } |
| 906 | // Remove the last ", " |
| 907 | if (elementCount > 0) { |
| 908 | buffer.setLength(buffer.length() - 2); |
| 909 | } |
| 910 | buffer.append('}'); |
| 911 | return buffer.toString(); |
| 912 | } |
| 913 | |
| 914 | /// Returns a collection of the values contained in this `Hashtable`. |
| 915 | /// The collection is backed by this `Hashtable` so changes to one are |