This issue has been created
There are 3 updates.
 
 
XWiki Rendering / cid:jira-generated-image-avatar-b3184fe1-a4d5-4e23-bd12-887badb6dfd0 XRENDERING-789 Open

The XWiki syntax parser shouldn't use String#replaceAll

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-95cf0496-7a2d-4ed8-96e4-5aa242c5e892 Michael Hamann created this issue on 04/Jun/25 17:41
 
Summary: The XWiki syntax parser shouldn't use String#replaceAll
Issue Type: cid:jira-generated-image-avatar-b3184fe1-a4d5-4e23-bd12-887badb6dfd0 Bug
Affects Versions: 16.10.8
Assignee: Unassigned
Components: Syntax - xwiki/2.0, Syntax - xwiki/2.1
Created: 04/Jun/25 17:41
Labels: performance
Priority: cid:jira-generated-image-static-major-2c69cc29-b95d-42db-8e1b-02919319da27 Major
Reporter: Michael Hamann
Description:

The XWiki 2.0 and 2.1 syntax parser currently uses String#replaceAll to remove "~" from parsed words an spaces. While the performance impact is minor, it is still inefficient as this compiles a regular expression. See also https://medium.com/javarevisited/micro-optimizations-in-java-string-replaceall-c6d0edf2ef6

 
 

3 updates

 
cid:jira-generated-image-avatar-95cf0496-7a2d-4ed8-96e4-5aa242c5e892 Changes by Michael Hamann on 04/Jun/25 17:41
 
Version: 16.10.8
Version: 16.10.0
Description: The XWiki 2.0 and 2.1 syntax parser currently [uses String#replaceAll to remove "~" from parsed words an spaces|https://github.com/xwiki/xwiki-rendering/blob/e46c703435fa0f179560201a5029029a5a34deed/xwiki-rendering-wikimodel/src/main/javacc/XWiki20Scanner.jj#L989]. While the performance impact is minor, it is still inefficient as this compiles a regular expression. See also https://medium.com/javarevisited/micro-optimizations-in-java-string-replaceall-c6d0edf2ef6 and https://rules.sonarsource.com/java/tag/regex/RSPEC-5361/