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 2023/07/26 09:46:29 UTC

[camel] branch camel-3.x updated: CAMEL-19279: Fix checkstyle violations (#10829)

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

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


The following commit(s) were added to refs/heads/camel-3.x by this push:
     new 832d842e3bc CAMEL-19279: Fix checkstyle violations (#10829)
832d842e3bc is described below

commit 832d842e3bc70acdbf8070533b545c8e7017e936
Author: Nicolas Filotto <es...@users.noreply.github.com>
AuthorDate: Wed Jul 26 11:46:22 2023 +0200

    CAMEL-19279: Fix checkstyle violations (#10829)
    
    ## Motivation
    
    Some checkstyle violations prevent the build to pass and must be fixed
    
    ## Modifications
    
    * Applies checkstyle recommendations
---
 .../org/apache/camel/component/file/azure/FilesConsumer.java     | 2 +-
 .../java/org/apache/camel/component/file/azure/FilesPath.java    | 4 ++--
 .../java/org/apache/camel/component/file/azure/FilesToken.java   | 9 ++++++---
 .../org/apache/camel/component/file/azure/FilesURIStrings.java   | 3 +++
 .../apache/camel/component/file/azure/NormalizedOperations.java  | 2 +-
 .../camel/component/file/azure/FilesConfigurationTests.java      | 4 +---
 6 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/components/camel-azure/camel-azure-files/src/main/java/org/apache/camel/component/file/azure/FilesConsumer.java b/components/camel-azure/camel-azure-files/src/main/java/org/apache/camel/component/file/azure/FilesConsumer.java
index 0ade389b101..8c593a7cfb3 100644
--- a/components/camel-azure/camel-azure-files/src/main/java/org/apache/camel/component/file/azure/FilesConsumer.java
+++ b/components/camel-azure/camel-azure-files/src/main/java/org/apache/camel/component/file/azure/FilesConsumer.java
@@ -210,7 +210,7 @@ public class FilesConsumer extends RemoteFileConsumer<ShareFileItem> {
         answer.setEndpointPath(endpointPath);
         answer.setFile(file);
         answer.setFileNameOnly(file.getName());
-        if (file.isDirectory() == false) {
+        if (!file.isDirectory()) {
             answer.setFileLength(file.getFileSize());
             answer.setLastModified(lastModified(file));
         }
diff --git a/components/camel-azure/camel-azure-files/src/main/java/org/apache/camel/component/file/azure/FilesPath.java b/components/camel-azure/camel-azure-files/src/main/java/org/apache/camel/component/file/azure/FilesPath.java
index 141e95a07de..2637bc5162b 100644
--- a/components/camel-azure/camel-azure-files/src/main/java/org/apache/camel/component/file/azure/FilesPath.java
+++ b/components/camel-azure/camel-azure-files/src/main/java/org/apache/camel/component/file/azure/FilesPath.java
@@ -22,7 +22,7 @@ package org.apache.camel.component.file.azure;
  * The absolute paths start with the path separator, they do not include the share name and they are relative to the
  * share root rather than to the endpoint starting directory.
  */
-public class FilesPath {
+public final class FilesPath {
 
     public static final String PARENT = "..";
 
@@ -126,7 +126,7 @@ public class FilesPath {
         }
 
         var includeRoot = preserveRootAsStep && path.startsWith(SHARE_ROOT);
-        if (!(includeRoot)) {
+        if (!includeRoot) {
             path = ensureRelative(path);
         }
 
diff --git a/components/camel-azure/camel-azure-files/src/main/java/org/apache/camel/component/file/azure/FilesToken.java b/components/camel-azure/camel-azure-files/src/main/java/org/apache/camel/component/file/azure/FilesToken.java
index 2a718d758d1..902b86ab9ff 100644
--- a/components/camel-azure/camel-azure-files/src/main/java/org/apache/camel/component/file/azure/FilesToken.java
+++ b/components/camel-azure/camel-azure-files/src/main/java/org/apache/camel/component/file/azure/FilesToken.java
@@ -149,12 +149,15 @@ final class FilesToken {
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
+        if (this == obj) {
             return true;
-        if (obj == null)
+        }
+        if (obj == null) {
             return false;
-        if (getClass() != obj.getClass())
+        }
+        if (getClass() != obj.getClass()) {
             return false;
+        }
         FilesToken other = (FilesToken) obj;
         return Objects.equals(sdd, other.sdd) && Objects.equals(se, other.se)
                 && Objects.equals(si, other.si) && Objects.equals(sig, other.sig)
diff --git a/components/camel-azure/camel-azure-files/src/main/java/org/apache/camel/component/file/azure/FilesURIStrings.java b/components/camel-azure/camel-azure-files/src/main/java/org/apache/camel/component/file/azure/FilesURIStrings.java
index 5a3268e70fb..28c5ec65f12 100644
--- a/components/camel-azure/camel-azure-files/src/main/java/org/apache/camel/component/file/azure/FilesURIStrings.java
+++ b/components/camel-azure/camel-azure-files/src/main/java/org/apache/camel/component/file/azure/FilesURIStrings.java
@@ -32,6 +32,9 @@ final class FilesURIStrings {
 
     public static final char QUERY_SEPARATOR = '?';
 
+    private FilesURIStrings() {
+    }
+
     /**
      * Get the base uri part before the options as they can be non URI valid such as the expression using $ chars and
      * the URI constructor will regard $ as an illegal character and we don't want to enforce end users to to escape the
diff --git a/components/camel-azure/camel-azure-files/src/main/java/org/apache/camel/component/file/azure/NormalizedOperations.java b/components/camel-azure/camel-azure-files/src/main/java/org/apache/camel/component/file/azure/NormalizedOperations.java
index 05b6cbbe24c..bb76f6ccf48 100644
--- a/components/camel-azure/camel-azure-files/src/main/java/org/apache/camel/component/file/azure/NormalizedOperations.java
+++ b/components/camel-azure/camel-azure-files/src/main/java/org/apache/camel/component/file/azure/NormalizedOperations.java
@@ -54,6 +54,6 @@ abstract class NormalizedOperations implements RemoteFileOperations<ShareFileIte
     }
 
     /** Normalized form of {@link #buildDirectory(String, boolean)}. */
-    abstract protected boolean buildDirectory(String path);
+    protected abstract boolean buildDirectory(String path);
 
 }
diff --git a/components/camel-azure/camel-azure-files/src/test/java/org/apache/camel/component/file/azure/FilesConfigurationTests.java b/components/camel-azure/camel-azure-files/src/test/java/org/apache/camel/component/file/azure/FilesConfigurationTests.java
index 5b2e47d3a07..419e4e493de 100644
--- a/components/camel-azure/camel-azure-files/src/test/java/org/apache/camel/component/file/azure/FilesConfigurationTests.java
+++ b/components/camel-azure/camel-azure-files/src/test/java/org/apache/camel/component/file/azure/FilesConfigurationTests.java
@@ -47,7 +47,7 @@ public class FilesConfigurationTests extends CamelTestSupport {
     }
 
     @Test
-    void hostForAccountURIShouldDefaultTo_file_core_windows_netSuffix() {
+    void hostForAccountURIShouldDefaultToFileCoreWindowsNetSuffix() {
         var remoteConf = context.getEndpoint("azure-files://account/share", FilesEndpoint.class).getConfiguration();
         assertEquals("account.file.core.windows.net", remoteConf.getHost());
     }
@@ -127,7 +127,6 @@ public class FilesConfigurationTests extends CamelTestSupport {
     @Test
     void dirForValidDirectoryNameURIShouldBeExtracted2() {
         var remoteConf = context.getEndpoint("azure-files://account/share/dir?", FilesEndpoint.class).getConfiguration();
-        ;
         assertEquals("/dir", remoteConf.getDirectory());
         assertEquals("/dir", remoteConf.getDirectoryName());
     }
@@ -135,7 +134,6 @@ public class FilesConfigurationTests extends CamelTestSupport {
     @Test
     void dirForValidDirectoryNameURIShouldBeExtracted3() {
         var remoteConf = context.getEndpoint("azure-files://account/share/dir/?", FilesEndpoint.class).getConfiguration();
-        ;
         assertEquals("/dir", remoteConf.getDirectory());
         assertEquals("/dir", remoteConf.getDirectoryName());
     }