On 17.03.2014 2:52, Ulf Zibis wrote:
Am 16.03.2014 23:37, schrieb Ivan Gerasimov:
Here is yet another iteration of the fix:
http://cr.openjdk.java.net/~igerasim/8014066/3/webrev/
2)
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?
Isn't this a perfect situation to use an assert statement? Needless to
say, then the spec must be adapted.
Yeah, it might be more fair to write that it's assumed that the passed
arguments are valid and use asserts as you suggest.
Though I think that the current trend is to do as little modifications
as possible.
Sincerely yours,
Ivan
-Ulf