public void clear() {
        boolean useIterator = true;
        Iterator it = getKeys();
        while (it.hasNext()) {
            String key = (String)it.next();
            if (useIterator) {
                try {
                    it.remove();
                } catch (UnsupportedOperationException usoex) {
                    useIterator = false;
                }
            }

            if (useIterator && containsKey(key)) {
                useIterator = false;
            }

            if (!useIterator) {
                // workaround for Iterators that do not remove the property
                // on calling remove() or do not support remove() at all
                clearProperty(key);
            }
        }

    }