OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Rev

Rev 83 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 83 Rev 177
Line 107... Line 107...
107
    public String toString() {
107
    public String toString() {
108
        return this.getClass().getSimpleName() + " " + this.delegate.toString();
108
        return this.getClass().getSimpleName() + " " + this.delegate.toString();
109
    }
109
    }
110
 
110
 
111
    @Override
111
    @Override
112
    protected Object clone() throws CloneNotSupportedException {
112
    protected Object clone() {
113
        try {
113
        try {
114
            final Map<K, V> delegate = CopyUtils.copy(this.delegate);
114
            final Map<K, V> delegate = CopyUtils.copy(this.delegate);
115
            @SuppressWarnings("unchecked")
115
            @SuppressWarnings("unchecked")
116
            final AbstractMapDecorator<K, V> res = (AbstractMapDecorator<K, V>) super.clone();
116
            final AbstractMapDecorator<K, V> res = (AbstractMapDecorator<K, V>) super.clone();
117
            res.delegate = delegate;
117
            res.delegate = delegate;
118
            return res;
118
            return res;
119
        } catch (CloneNotSupportedException e) {
119
        } catch (CloneNotSupportedException e) {
120
            throw e;
-
 
121
        } catch (Exception e) {
-
 
122
            final CloneNotSupportedException exn = new CloneNotSupportedException();
-
 
123
            exn.initCause(e);
120
            // As done in java.util collections
124
            throw exn;
121
            throw new InternalError(e);
125
        }
122
        }
126
    }
123
    }
127
}
124
}