use of org.autorefactor.util.UnhandledException in project AutoRefactor by JnRouvignac.
the class SourceCode method computeLines.
private void computeLines() {
try {
final String lineSeparator = this.compilationUnit.findRecommendedLineSeparator();
int fromIndex = 0;
Matcher matcher = Pattern.compile(".*?" + lineSeparator).matcher(this.text);
while (fromIndex < this.text.length() && matcher.find(fromIndex)) {
String lineText = matcher.group();
int offset = this.text.indexOf(lineText, fromIndex);
int length = lineText.length();
this.lines.add(new Line(lineText, offset, length, this));
fromIndex += offset + length;
}
} catch (JavaModelException e) {
throw new UnhandledException(astRoot, e);
}
}
Aggregations