camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Commented] (CAMEL-10086) Remove Pattern.compile usages
Date Mon, 05 Dec 2016 20:35:58 GMT


ASF GitHub Bot commented on CAMEL-10086:

GitHub user aefox opened a pull request:

    CAMEL-10086 added GenericFileEndpoint.(include|exclude)Pattern for a …

    …better reusage
    This is part 2 of [CAMEL-10086](
    It follows on the suggestion from the ticket description:
    `GenericFileEndpoint could contain also excludePattern as well.`
    Please note couple of things:
    1) This PR might not be considered complete because:
    - I'm not sure if javadoc should be added on the new methods in `GenericFileEndpoint`
    - Also I have only checked that the existing tests work as before and didn't investigate
if/what needs to be updated
    - Any suggestions related to the above 2 lines would be appreciated
    2) I have raised this PR to get a validation that this approach is good and can continue
in this direction
    3) This PR also contains some other cleanup that I noticed could be done

You can merge this pull request into a Git repository by running:

    $ git pull CAMEL-10086

Alternatively you can review and apply these changes as the patch at:

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1332
commit 12be6a2f56877546e5ae446f4450150336a1715c
Author: aefox <>
Date:   2016-12-05T20:15:28Z

    CAMEL-10086 added GenericFileEndpoint.(include|exclude)Pattern for a better reusage


> Remove Pattern.compile usages
> -----------------------------
>                 Key: CAMEL-10086
>                 URL:
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>            Reporter: Mateusz Nowakowski
>            Priority: Minor
>             Fix For: Future
> Please heck Pattern.compile usage across Camel source code - also *not* direct usage.
> For example: 
> Whenever one of these methods are used from String class a Pattern.compile() is utilized:
> - matches
> - replaceFirst
> - replaceAll
> - replace
> - split: has an optimization and for certain characters it doesn’t use Pattern.compile.
> For example:
> GenericFileConsumer.isMatched calls name.matches(endpoint.getExclude())
> GenericFileEndpoint could contain also excludePattern as well.
> Possible solution:
> Walk through the code and replace usages of these methods with static Pattern variables.

This message was sent by Atlassian JIRA

View raw message