Community
Participate
Working Groups
The javadoc comment for this method says the following: "For example, the source string <code>class A\n{\n}</code> has 3 lines corresponding to inclusive character ranges [0,8], [8,9], and [10,10]." There appears to be something wrong here. For instance, it seems to say that character 8 lies is part of both line 1 and line two. Guessing at what the behaviour might be, the ranges might rightly be ([0,7], [8,9], [10,10]).
I think the correct answer is: [0,7] [9,9] [10, 10]. If you agree with this, it can easily be fixed. This is clearly a bug in the doc and not in the implementation.
... where's character #8 ? ...
Sorry it is: I think the correct answer is: [0,6] [8,8] [10, 10].
Forget my previous answer. You are right. The right answer is: [0,7], [8,9], [10,10] The line breaks are part of the previous line. So I will update the doc with these values.
Released in 2.1 stream.
Change milestone.
Verified.