[
https://issues.apache.org/jira/browse/CAMEL-10086?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15723307#comment-15723307
]
ASF GitHub Bot commented on CAMEL-10086:
----------------------------------------
GitHub user aefox opened a pull request:
https://github.com/apache/camel/pull/1332
CAMEL-10086 added GenericFileEndpoint.(include|exclude)Pattern for a …
…better reusage
This is part 2 of
[CAMEL-10086](https://issues.apache.org/jira/browse/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 https://github.com/aefox/camel CAMEL-10086
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/camel/pull/1332.patch
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 <[email protected]>
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: https://issues.apache.org/jira/browse/CAMEL-10086
> 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
(v6.3.4#6332)