Skip to content

Commit 591f30e

Browse files
author
Vladimir Kotal
committed
avoid using regex replacement when CharSequence is enough
reported by Sonar
1 parent 950de23 commit 591f30e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

opengrok-indexer/src/main/java/org/opengrok/indexer/history/PerforceRepository.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ static String protectPerforceFilename(String name) {
6767
/* the recognized escape sequence for perforce. */
6868
/* NOTE: Must replace '%' first, or that translation would */
6969
/* affect the output of the others. */
70-
String t = name.replaceAll("%", "%25");
71-
t = t.replaceAll("#", "%23");
72-
t = t.replaceAll("\\*", "%2A");
73-
t = t.replaceAll("@", "%40");
70+
String t = name.replace("%", "%25");
71+
t = t.replace("#", "%23");
72+
t = t.replace("*", "%2A");
73+
t = t.replace("@", "%40");
7474
if (!name.equals(t)) {
7575
LOGGER.log(Level.FINEST,
7676
"protectPerforceFilename: replaced ''{0}'' with ''{1}''",

0 commit comments

Comments
 (0)