* @deprecated There is no need to retrieve the mapped positions anymore.
*/
public int[] getMappedPositions() {
+ if (null!=mappedPositions) {
+ for (int i=0;i<mappedPositions.length;i++) {
+ if (mappedPositions[i]>=formattedSource.length()) {
+ mappedPositions[i]=formattedSource.length()-1;
+ }
+ }
+ }
return mappedPositions;
}
if (posToMap < 0 || posToMap >= sourceLength) {
// protection against out of bounds position
if (posToMap == sourceLength) {
- mappedPositions[indexToMap] = formattedSource.length()-1;
+ mappedPositions[indexToMap] = formattedSource.length();
}
indexToMap = positionsToMap.length; // no more mapping
return;
} else {
mappedPositions[indexToMap] = posToMap + globalDelta + lineDelta;
}
- if (mappedPositions[indexToMap]>=formattedSource.length()) {
- mappedPositions[indexToMap]=formattedSource.length()-1;
- }
}
indexToMap++;
}
while (indexInMap < mappedPositions.length && startPosition <= mappedPositions[indexInMap]
&& mappedPositions[indexInMap] < endPosition && indexInMap < indexToMap) {
mappedPositions[indexInMap] += splitDelta;
- if (mappedPositions[indexInMap]>=formattedSource.length()) {
- mappedPositions[indexInMap]=formattedSource.length()-1;
- }
indexInMap++;
}
}