RFR [8014066] Mistake in documentation of ArrayList#removeRange (original) (raw)
Ivan Gerasimov ivan.gerasimov at oracle.com
Sun Mar 16 22:37:41 UTC 2014
- Previous message: RFR [8014066] Mistake in documentation of ArrayList#removeRange
- Next message: RFR [8014066] Mistake in documentation of ArrayList#removeRange
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Here is yet another iteration of the fix: http://cr.openjdk.java.net/~igerasim/8014066/3/webrev/
- The condition 'fromIndex >= size()' is removed from the spec. I prefer removing it rather than replacing it with 'fromIndex > size()' for two reasons:
- 'fromIndex > size()' already follows on from two other conditions (toIndex > size() || toIndex < fromIndex);
- it is consistent with the spec for CopyOnWriteArrayList#removeRange().
Kept the check for 'fromIndex > toIndex' in removeRange(). While I understand that this should not add anything significant to the current code, as currently removeRange() is always called with valid arguments. However, if it is stated in the spec that in case of 'fromIndex > toIndex' an exception is thrown, I believe it should be thrown, otherwise why it's stated?
Moved the test to MOAT.java The test looks a bit foreign over there, but reuses some of the infrastructure.
Sincerely yours, Ivan
- Previous message: RFR [8014066] Mistake in documentation of ArrayList#removeRange
- Next message: RFR [8014066] Mistake in documentation of ArrayList#removeRange
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]