You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Shmakov Alexey (Jira)" <ji...@apache.org> on 2020/09/23 10:47:00 UTC

[jira] [Updated] (CAMEL-15571) The order of loading settings is changed in the method AbstractLocationPropertiesSource::loadProperties(Predicate)

     [ https://issues.apache.org/jira/browse/CAMEL-15571?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Shmakov Alexey updated CAMEL-15571:
-----------------------------------
    Description: 
As a result of copying from OrderedProperties to Properties, the order of properties is changed  

[https://github.com/apache/camel/blob/master/core/camel-base/src/main/java/org/apache/camel/component/properties/AbstractLocationPropertiesSource.java]
     public Properties loadProperties(Predicate<String> filter) {       

        Properties answer = new Properties();
         for (String name : properties.stringPropertyNames()) {           

                if (filter.test(name))

                  {               

                            answer.put(name, properties.get(name));           

                  }

         }
         return answer;   

    }  

So when creating beans from the application.properties file, the order of their creation changes and beans that depend on other beans are created earlier and do not see the desired beans in the register

 [https://camel.apache.org/components/latest/others/main.html#_specifying_custom_beans]  

  was:
As a result of copying from OrderedProperties to Properties, the order of properties is changed  

https://github.com/apache/camel/blob/master/core/camel-base/src/main/java/org/apache/camel/component/properties/AbstractLocationPropertiesSource.java
    public Properties loadProperties(Predicate<String> filter) {        Properties answer = new Properties();
        for (String name : properties.stringPropertyNames()) \{            if (filter.test(name)) {                answer.put(name, properties.get(name));            }        }
        return answer;    } So when creating beans from the application.properties file, the order of their creation changes and beans that depend on other beans are created earlier and do not see the desired beans in the register  https://camel.apache.org/components/latest/others/main.html#_specifying_custom_beans  


> The order of loading settings is changed in the method AbstractLocationPropertiesSource::loadProperties(Predicate)
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-15571
>                 URL: https://issues.apache.org/jira/browse/CAMEL-15571
>             Project: Camel
>          Issue Type: Task
>          Components: camel-base
>            Reporter: Shmakov Alexey
>            Priority: Major
>
> As a result of copying from OrderedProperties to Properties, the order of properties is changed  
> [https://github.com/apache/camel/blob/master/core/camel-base/src/main/java/org/apache/camel/component/properties/AbstractLocationPropertiesSource.java]
>      public Properties loadProperties(Predicate<String> filter) {       
>         Properties answer = new Properties();
>          for (String name : properties.stringPropertyNames()) {           
>                 if (filter.test(name))
>                   {               
>                             answer.put(name, properties.get(name));           
>                   }
>          }
>          return answer;   
>     }  
> So when creating beans from the application.properties file, the order of their creation changes and beans that depend on other beans are created earlier and do not see the desired beans in the register
>  [https://camel.apache.org/components/latest/others/main.html#_specifying_custom_beans]  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)