Skip to content

Commit e96534b

Browse files
committed
[UNDERTOW-2743] Speedup by removing non pattern replaceAll with constant arg
replaceAll("ABC", "") is non Pattern method and therefore must be replaced to simple fast replace() A proofs of changes: https://gist.github.com/tbw777/8a6ef60af21487c5faec67037099fd0b Commit: apache/tomcat@399ea1b Signed-off-by: Flavia Rainone <frainone@redhat.com>
1 parent d929bec commit e96534b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/main/java/org/apache/jasper/compiler/SmapUtil.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -758,12 +758,12 @@ private static String getSmap(String className, ClassLoader cl) {
758758

759759
InputStream is = null;
760760
try {
761-
is = cl.getResourceAsStream(className.replaceAll("\\.","/") + ".smap");
761+
is = cl.getResourceAsStream(className.replace(".","/") + ".smap");
762762
if (is != null) {
763763
encoding = SMAP_ENCODING;
764764
found = true;
765765
} else {
766-
is = cl.getResourceAsStream(className.replaceAll("\\.","/") + ".class");
766+
is = cl.getResourceAsStream(className.replace(".","/") + ".class");
767767
// Alternative approach would be to read the class file as per the
768768
// JLS. That would require duplicating a lot of BCEL functionality.
769769
int b = is.read();

0 commit comments

Comments
 (0)