Skip to content

[Enhancement] Replace this call to "replaceAll()" by a call to the "replace()" method.[PravegaClient] #3503

@Alonexc

Description

@Alonexc

Search before asking

  • I had searched in the issues and found no similar issues.

Enhancement Request

image
located at:
eventmesh-storage/eventmesh-storage-pravega/src/main/java/org/apache/eventmesh/storage/pravega/client/PravegaClient.java line 191
analysis and explanation:
The underlying implementation of String::replaceAll calls the java.util.regex.Pattern.compile() method each time it is called even if the first argument is not a regular expression. This has a significant performance cost and therefore should be used with care.
When String::replaceAll is used, the first argument should be a real regular expression. If it’s not the case, String::replace does exactly the same thing as String::replaceAll without the performance drawback of the regex.

Describe the solution you'd like

Use "replace()" instead of "replaceAll()".

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestgood first issueIssues for first-time contributors

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions