You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by nf...@apache.org on 2022/10/24 08:49:28 UTC

[camel] branch main updated: CAMEL-18608: camel-file - Fix is done file checker (#8613)

This is an automated email from the ASF dual-hosted git repository.

nfilotto pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new 741513d26df CAMEL-18608: camel-file - Fix is done file checker (#8613)
741513d26df is described below

commit 741513d26df0216cd4882a96cf50b9f981889c90
Author: Nicolas Filotto <es...@users.noreply.github.com>
AuthorDate: Mon Oct 24 10:49:21 2022 +0200

    CAMEL-18608: camel-file - Fix is done file checker (#8613)
    
    ## Motivation
    
    The tests `FtpConsumerDoneFileNameStepwiseIT` and `FtpConsumerDoneFileNameIT` are failing systematically on the Jenkins build indicating that there is regression to fix.
    
    ## Modifications:
    
    * Restore the previous test to check if it is a prefix to avoid getting true when it starts with `${`.
    * Add the `NOSONAR` tag indicating that it is expected and must be ignored by sonar.
---
 .../java/org/apache/camel/component/file/GenericFileEndpoint.java     | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/components/camel-file/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java b/components/camel-file/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java
index 71f29e59362..6544a266c6f 100644
--- a/components/camel-file/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java
+++ b/components/camel-file/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java
@@ -1715,8 +1715,8 @@ public abstract class GenericFileEndpoint<T> extends ScheduledPollEndpoint imple
         }
 
         // the static part of the pattern, is that a prefix or suffix?
-        // its a prefix if ${ start token is not at the start of the pattern
-        boolean prefix = pattern.contains("${");
+        // it is a prefix if ${ start token is not at the start of the pattern
+        boolean prefix = pattern.indexOf("${") > 0; // NOSONAR
 
         // remove dynamic parts of the pattern so we only got the static part
         // left