Mutable collections #161

1 commit merged into from Feb 25, 2011

2 participants



All tests pass.

I noticed that this not always possible with Hector. For instance OrderedSuperRows.getList returns an unmodifiable list, so does HSuperColumnImpl#getColumns.

I don't see why the user will be forbidden to alter the returned collections.
I found only 5 (not 4) valid occurences, so the change seems small.  
        (112: 23) return Collections.unmodifiableList(columns);  
        (40: 23) return Collections.unmodifiableList(new ArrayList<Row<K, N, V>>(rowsList));  
        (38: 23) return Collections.unmodifiableList(rowsList);  
        (47: 23) return Collections.unmodifiableList(columnsList);

Would you guys agree to drop this constraint?

ps: as of today the immutability constraint is not always applied. For instance SuperRowsImpl#iterator is mutable.


The diff did not pick up an Iterator import and your formatting was ghetto (2 space tabs), but otherwise +1 (I fixed it real quick already).

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment