1
0
mirror of https://github.com/Stirling-Tools/Stirling-PDF.git synced 2024-11-13 03:00:10 +01:00

(Sonar) Fix "String#replace should be preferred to String#replaceAll" (#1056)

Co-authored-by: pixeebot[bot] <104101892+pixeebot[bot]@users.noreply.github.com>
This commit is contained in:
pixeebot[bot] 2024-04-09 06:52:52 +01:00 committed by GitHub
parent 66d5f3e4b5
commit 5564f378e5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -185,7 +185,7 @@ public class GeneralUtils {
// Insert multiplication between a number and 'n' (e.g., "4n" becomes "4*n")
String withMultiplication = expression.replaceAll("(\\d)n", "$1*n");
// Now replace 'n' with its current value
return withMultiplication.replaceAll("n", String.valueOf(nValue));
return withMultiplication.replace("n", String.valueOf(nValue));
}
private static List<Integer> handlePart(String part, int totalPages, int offset) {