src/services/Snippets.java
BeforeProposed
+1−1
99 int length=document.text.codePointCount(0,document.text.length());
1010 int start=hits.isEmpty()?0:Math.max(0,hits.get(0).start()-size/2);
1111 int end=Math.min(length,start+size);
12 String text=document.text.substring(start,end);
12 String text=document.text.substring(document.text.offsetByCodePoints(0,start),document.text.offsetByCodePoints(0,end));
1313 ArrayNode spans=SearchController.JSON.createArrayNode();
1414 for(Token token:hits) {
1515 int left=Math.max(start,token.start()),right=Math.min(end,token.end());