You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by or...@apache.org on 2022/10/13 15:53:50 UTC

[camel] 02/02: (chores) camel-base: avoid shadowing variables

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

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

commit d2b43a44c60cb1430c64f8bb8113821223b6e93e
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Thu Oct 13 14:51:18 2022 +0200

    (chores) camel-base: avoid shadowing variables
---
 .../component/properties/PropertiesComponent.java    | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/core/camel-base/src/main/java/org/apache/camel/component/properties/PropertiesComponent.java b/core/camel-base/src/main/java/org/apache/camel/component/properties/PropertiesComponent.java
index 47737b59e11..f2ea6628935 100644
--- a/core/camel-base/src/main/java/org/apache/camel/component/properties/PropertiesComponent.java
+++ b/core/camel-base/src/main/java/org/apache/camel/component/properties/PropertiesComponent.java
@@ -359,14 +359,14 @@ public class PropertiesComponent extends ServiceSupport
      * locations from this option.
      */
     public void setLocations(String[] locationStrings) {
-        List<PropertiesLocation> locations = new ArrayList<>();
+        List<PropertiesLocation> propertiesLocations = new ArrayList<>();
         if (locationStrings != null) {
             for (String locationString : locationStrings) {
-                locations.add(new PropertiesLocation(locationString));
+                propertiesLocations.add(new PropertiesLocation(locationString));
             }
         }
 
-        setLocations(locations);
+        setLocations(propertiesLocations);
     }
 
     public void addLocation(PropertiesLocation location) {
@@ -794,23 +794,23 @@ public class PropertiesComponent extends ServiceSupport
     private List<PropertiesLocation> parseLocations(List<PropertiesLocation> locations) {
         List<PropertiesLocation> answer = new ArrayList<>();
 
-        for (PropertiesLocation location : locations) {
-            LOG.trace("Parsing location: {}", location);
+        for (PropertiesLocation propertiesLocation : locations) {
+            LOG.trace("Parsing location: {}", propertiesLocation);
 
             try {
-                String path = FilePathResolver.resolvePath(location.getPath());
+                String path = FilePathResolver.resolvePath(propertiesLocation.getPath());
                 LOG.debug("Parsed location: {}", path);
                 if (ObjectHelper.isNotEmpty(path)) {
                     answer.add(new PropertiesLocation(
-                            location.getResolver(),
+                            propertiesLocation.getResolver(),
                             path,
-                            location.isOptional()));
+                            propertiesLocation.isOptional()));
                 }
             } catch (IllegalArgumentException e) {
-                if (!ignoreMissingLocation && !location.isOptional()) {
+                if (!ignoreMissingLocation && !propertiesLocation.isOptional()) {
                     throw e;
                 } else {
-                    LOG.debug("Ignored missing location: {}", location);
+                    LOG.debug("Ignored missing location: {}", propertiesLocation);
                 }
             }
         }