[ 
https://issues.apache.org/jira/browse/CAMEL-10086?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15720436#comment-15720436
 ] 

ASF GitHub Bot commented on CAMEL-10086:
----------------------------------------

GitHub user aefox opened a pull request:

    https://github.com/apache/camel/pull/1329

    Camel 10086 - Moved Pattern.compile() usages into static variables

    This PR covers a first set of changes for 
[CAMEL-10086](https://issues.apache.org/jira/browse/CAMEL-10086) which targets 
extracting some `Pattern.compile()` usages from within methods into static 
variables.
    
    Couple of things to note:
    - I did not pay attention and ended up with 3 commits. if this is a problem 
let me know and I'll close this PR, squash the commits on a new branch and 
re-raise
    - This PR also has some typo fixes and some license fixes (I found those by 
chance and could not leave them as they were); I hope that's ok

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/1329.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 #1329
    
----
commit e785f4b38e8034242a3b4779a6b1f7ec24ca5479
Author: aefox <[email protected]>
Date:   2016-12-04T17:10:25Z

    CAMEL-10086 moved Pattern.compile usages into static variables

commit 7d4fd6c1b590c33c378c56af4315b7bc97c44470
Author: aefox <[email protected]>
Date:   2016-12-04T17:10:25Z

    CAMEL-10086 moved Pattern.compile usages into static variables

commit cc537416db2cd260468f1382b08988766d29aca3
Author: aefox <[email protected]>
Date:   2016-12-04T19:09:32Z

    CAMEL-10086 Naming fixes + license updated in 2 java classes

----


> 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)

Reply via email to