Skip to content

Commit

Permalink
Remove unused method.
Browse files Browse the repository at this point in the history
  • Loading branch information
shartte committed Dec 22, 2023
1 parent b3db535 commit f96658a
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions src/main/java/JavadocHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -314,35 +314,4 @@ public static int getLastLineLength(PsiWhiteSpace psiWhiteSpace) {
private record JavadocTag(String tagName, @Nullable String refersTo, String text) {
}

public static void splitIntoMultipleLines(int maxLength, String str, BiConsumer<String, Integer> consumer) {
if (str == null) return;

final BreakIterator boundary = BreakIterator.getWordInstance(Locale.ENGLISH);
StringBuilder currentLine = null;
int amount = 0;

boundary.setText(str);
int start = boundary.first();

for (int end = boundary.next();
end != BreakIterator.DONE;
start = end, end = boundary.next()) {
final String word = str.substring(start, end);
if (currentLine == null) {
currentLine = new StringBuilder().append(word);
} else {
if (currentLine.length() + word.length() > maxLength) {
consumer.accept(currentLine.toString().trim(), amount++);
currentLine = new StringBuilder().append(word);
} else {
currentLine.append(word);
}
}
}

if (currentLine != null) {
consumer.accept(currentLine.toString(), amount);
}
}

}

0 comments on commit f96658a

Please sign in to comment.